9 ms·
PHP On Pie takes a fresh new approach.
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.
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.
http://phponpie.com
- jmathai 16y agoClickable. http://phponpie.com http://phponpie.com
- Qz 16y agoFirst 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 16y agoSo many frameworks to choose from; why pick yours? Give me a single sentence mind-changer.
- MC27 16y agoI would prefer to see something of more substance, like a feature comparison table with other frameworks.
- EGreg 16y agoYeah 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 16y agoIF you don't have something concrete, make something up that sounds concrete, within the realm of puffery.
- EGreg 16y agoYeah, that's a good point. The site doesn't really sell the framework. Until now I haven't really devoted a lot of time to evangelizing it or anything. Beyond open sourcing it, I didn't really put in the time to grow a community around it. What I wrote here is more of an early notice to the hackers out there who are interested in developing kick-ass applications in PHP. If you ask me -- and I've gone through a lot of frameworks -- this is definitely designed to help you achieve that with a minimum of fuss and a lot of power. I finished the documentation, but the sales job needs a lot more work. If anyone wants to contribute their time and energy to helping me grow this open source project, I'd much appreciate it. You would definitely have a huge role in the framework community if you did that. At the moment, though, I am more focused on my startup, and bringing developers on board to help with it. The documentation is there to help get them up to speed.
- crazydiamond 16y agoI 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 16y agoThe 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 16y agoThanks, 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.
- tmcw 16y agoWhat'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 16y agoIt's inverse is extract(). What's icky about using compact()?
- photon_off 16y agoWhenever 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 16y ago>What makes it icky is that developers then need to worry about how they name their variables. Good point.
- tmcw 16y agoBecause it's highly dependent on scope? Like, if I wanted to template each list item in an array, I could use array_map with another template function, but here I would have to keep re-assigning a variable in a foreach. And it seems to be unclear on how you'd pass array and object members to it? It seems very much to encourage variable creep?
- dangrossman 16y agoI want to see something significant built with the framework. That's what gets me to try something new.
- mcantelon 16y agoNicely done site, but I would say that immediately your site should tell what makes your framework stand out from the crowd.
- bithub 16y agoAt 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 16y agoThanks 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 16y agoframework/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 16y agoRight ... 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.
- mrjbq7 16y agoYou have a typo on #10 - s/Competely/Completely/.
- EGreg 16y agoFixed, thanks.
- petervandijck 16y agoThe 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.