

PHP On Pie takes a fresh new approach. - EGreg

Hey everyone. I've been creating a "social application framework" called PHP On Pie over the past 2 years, mainly to streamline my own work with social media applications and also to re-use code and help my developers get up to speed quicker. I'm open sourcing it under the BSD license and hopefully others among you find it useful. If you do, feel free to contribute back to it.<p>I came up with its design after using a lot of other PHP frameworks, including Cake (RoR clone basically), symfony/agavi, CodeIgniter, Kohana and Zend. And drupal. I think PIE really tries to take advantage of the PHP way, and make things simple. If you want, you can drop classes from ZF or PEAR into it and they "just work". Anyway if anyone wants to get involved, drop me a line.<p>http://phponpie.com
======
Qz
First thought: The opening tag line,

 _You can make great applications with PHP._

Is relatively underwhelming. It's like saying 'you can make great cakes with
sugar.' - true, but not really saying a lot.

~~~
pruhstal
So many frameworks to choose from; why pick yours? Give me a single sentence
mind-changer.

~~~
EGreg
Yeah I should put something there. I haven't thought of a single killer
reason, except "it's faster, more powerful, takes advantage of PHP's unique
strengths and encourages clean web programming"

~~~
Qz
IF you don't have something concrete, make something up that sounds concrete,
within the realm of puffery.

------
tmcw
What's up with the constant usage of compact()? Isn't it as icky and avoidable
as its inverse, explode()?

Starting off the 'Technology' tab with supported OSes and servers couldn't be
a good idea: those familiar with PHP will understand that incompatible with a
system on which PHP is supported is a bug, but compatibility within PHP is
obvious.

That said, the event system is interesting, and might be a good rethink of the
Drupal hook system.

~~~
mcantelon
It's inverse is extract(). What's icky about using compact()?

~~~
photon_off
Whenever reflection can be avoided, it should be. What makes it icky is that
developers then need to worry about how they name their variables. It
shouldn't be a problem so long there's a convention established.

Personally, when passing a lot of parameters, I condense them into a "Holder"
class:

    
    
        $holder->var1 = "foo";
        $holder->var2 = "foo";
        //or set from array
        $holder->addArray(array("var1"=>"foo", "var2"=>"foo"));
        //later on, retrieving values
        $holder->useStrictMode(true); //optional: throws exception if key isn't present (rather than returning null)
        echo $holder->var1;
        echo $holder->var2;
        echo $holder->var3; //throws exception that var3 was expected to be present
    

It's worked well for me. It's also very handy for returning multiple values
and status codes.

~~~
mcantelon
>What makes it icky is that developers then need to worry about how they name
their variables.

Good point.

------
jmathai
Clickable. <http://phponpie.com>

------
bithub
At a quick glimpse at the framework code, I found several no gos for me: 1)
First file i opened contained Methods with > 600 lines of code with mixed
variable naming (camelcase and underscore). I don't want to debug that stuff,
if I run into a framework bug. 2) Several classes/interfaces in a single file.
What if I ie want to write my own adapters by using the given interfaces?

On the other side the code is very well commented (not all but most of it),
which is a very huge plus.

~~~
EGreg
Thanks for the feedback, but are you looking at the right framework? I am hard
pressed to imagine how you could encounter either 1) or 2) in it, let alone
both in a single file. As for your question, PIE is designed to let you write
any adapters you want. For example it currently supports only MySQL, but you
are free to add support for e.g. Postgres, SQLite or even NoSQL databases.

I'm just a bit surprised by your comments because they describe the exact
opposite of how most of PIE is designed, and the philosophy behind it.
Although I take your point with mixed variable naming. There is lots of room
for standardizing the internal codebase more than it is.

~~~
jameskilton
framework/classes/pie.php 1082 lines long

Methods existing in the file: microtime, exceptionHandler, includeFile,
autoload, var_dump, do_dump.

It's the first file I opened, and I see exactly what this guy saw immediately
as well.

~~~
EGreg
Right ... but I thought he said there were methods with > 600 lines of code,
and files with multiple classes/interfaces all over the place. That's why I
took issue with it. But yeah, the Pie class has all the core functions.

------
petervandijck
The site doesn't explain (anywhere that I could find) what is different about
this framework, or what this "fresh new approach" is. That should be the first
thing on the homepage.

------
crazydiamond
I must say, you've made a neat and clean website. Very inviting.

What would really get me to try it out is a video link on the first page. Just
like the one on the play (Java) website. It should like play, show a
jquery/ajax update. I've wanted to learn php (and a framework) for a long
time, this could be it, if you give a short 10 minute demo.

~~~
mike-cardwell
The site is completely broken without javascript enabled.

You can't download the framework, you can't view the feature list, you can't
click the "technology" tab.

None of those things require any particular functionality of javascript and
could work as simple anchor tags.

~~~
EGreg
Thanks, that's something I should fix. I don't think I'm using Javascript for
anything other than the tabs + ajax. I'll convert them to regular anchors as a
fallback.

------
mcantelon
Nicely done site, but I would say that immediately your site should tell what
makes your framework stand out from the crowd.

------
dangrossman
I want to see something significant built with the framework. That's what gets
me to try something new.

------
mrjbq7
You have a typo on #10 - s/Competely/Completely/.

~~~
EGreg
Fixed, thanks.

