PHPRPC and PHP frameworks

I started the process to submit PHPRPC to the major frameworks. I feel like I should submit it to all the major frameworks, so I can make sure people can use PHP-RPC regardless of their framework of choice.

Besides that, it might be a good way to gather feedback or critique from the pro's.

PEAR

PEAR

For PEAR I submitted it as a new PEAR2 package. PEAR2 is the upcoming next major version of PEAR, and will be PHP5-only. Much of my code (seemed) to follow PEAR2 coding standards, but the approval process will tell.

The most interesting (or weird) change I had to make the standards to include classes from within other classes. The old PEAR standards dictate:

<?php
require_once 'My/Other/Class.php';

?>

Which assumes PEAR and its packages are in the include_path. However, the standard for PEAR2 is:

<?php
if (!class_exists( 'My_Other_Class',true )) {
     throw new Exception('Undefined class: My_Other_Class');
}
?>

So, this means that the user of the package has to manually include all the dependencies. There is also an allfiles.php in every directory, which loads the entire package.

This allfiles.php is considered 'for beginners'. The wiki states that its also for opcode cache friendliness, but this is false (I submitted a bug report). So as a consequence of this all that using PEAR2 packages becomes a bit more harder to use for the following target audience: "Advanced developer, but doesn't want to trace each class' dependency tree"

The proposal.

Solar

Solar Framework

I opened a ticket in Solar's trac asking if its smarter to first write the Solar implementation, or first ask for approval for the contribution, because it would be good to know if Paul M. Jones hates the idea before I start.

Solar follows PEAR's old coding standards. The only annoyance here is that I need to prepend underscores to every private and protected property. (An idea that stems from the PHP4 era, where there was no property visibility).

The ticket.

Zend Framework

Zend Framework

I haven't really started with Zend yet, the coding standards seem to be nearly the exact same as the ones I use myself (except for the change from Sabre_ to Zend_), but in order to submit code to Zend, or even propose a package you have to sign a contract first; which means I have to print, sign and scan their pdf. Sadly, the only type of paper we have in this house is rolling paper.

Web mentions

Comments

  • Sam Hennessy

    Sam Hennessy

    Did you think about submitting something to PRADO (http://pradosoft.com/). It would be easy to adapt the SOAP implementation.
  • Arnaud

    Arnaud

    Just for the record the PEAR2 standards are not in place yet, they are just being discussed.
  • Tomek

    Tomek

    I'm interested in that "opcode cache friendliness" problem - can you tell where can I find your bug submission or maybe point some other resources on that matter? thanks
  • Arnold Daniels

    Arnold Daniels

    You're not reading the code correctly. PEAR2 does not ask for the user to include all dependencies. class_exists( 'My_Other_Class',true ) The true here is significant, it means that an autoloader will be called to load the class.
  • Evert Pot

    Evert Pot

    Sam, I'd love to see more implementations! However, doing 3 is already quite the chore. Lets first see how these turn out, then maybe I could look into others. You are of course more than welcome to help out ;) Arnaud, For sure.. I'm absolutely confident that the final code standards will work well for everybody.. I just want to jump on the bandwagon early. Tomek/Arnold, If you want to get the most out of APC, you need to make all your includes non-conditional. When you include a file based on a function result, or using autoload the include is considered 'conditional', which is a bit slower. I submitted my comment to the pear-dev mailing list, and the problem was acknowledged. The posting + greg beavers' response: http://marc.info/?l=pear-dev&m=118677555930011&w=2
  • stefan

    stefan

    If you need any help in getting a symfony plugin for it, let me know, I can probably be of service there :) Drop me an e-mail and we'll see if we can write a nice plugin for it.
  • andot

    andot

    Here is another phprpc: http://www.phprpc.org it supports more languages, not only PHP.