Fuel - A simple and flexible PHP Web Framework
fuelphp.com
fuelphp.com
A lot of people are complaining, and saying things like we don't use namespaces properly. My response: Then don't use the framework. I started the framework because no current framework met my needs. Here are some of the reasons I did not simply use an existing framework:
CodeIgniter - Slow to evolve, requires a lot of code for simple things, nothing autoloaded (don't even try to mention the autoload config file.
Symfony2 - Over-complication of menial tasks, kind of slow.
CakePHP - Slowest (php) framework known too man, bloated, need I say more?
Zend - Slow, bloated.
Yii - Just don't generally like the syntax.
Kohana - There isn't much I don't like about Kohana actually...other than its not PHP 5.3 yet (not going into specifics on why this is bad).
DooPHP - Not full-featured-enough.
I also wanted things like HMVC (i know some of the above support it), Modular Routing and a few other things.
To the guy that said he was turned off by the Html class: if you don't want it, don't use it, stop whining.
I mean, if you were developing a new social network site, would you try to seed it with the Amish?
If you completely disagree that's fine, move on to something else then - no hard feelings either way I hope. Just don't assume we just created this at random. Dan's remark was spot on, we chose the way we handle namespaces and autoloading very deliberately and we'll take the time to explain our motivations if you ask. But if you come in telling us that our setup sucks because we should be all-something because product X has that as well: don't expect we'll spend any time on you. There are lots of others with a more open-minded approach whom our time is far better spent on, and of course especially those actively helping out being the community you refer to.
The only thing that I keep wishing for is that the whole 'new school' PHP 5.3+ gets something similar to Ruby's gems and having more high quality code that lives outside of frameworks.
(That's no criticism towards FuelPHP at all - just seeing that you guys are writing some 'good PHP code' it might be worth considering if it wouldn't be great when some of it was available outside of FuelPHP as well.)
We intend to create a repository for packages and classes installable through Oil directly into your Fuel install. At this time we are still using a single Github profile to fork any repo into that will be available through Oil package install: https://github.com/fuel-packages (install the packages without the "fuel-" prefix as their name)
You have to worry about your application being compatible with the version installed on the server and all sorts of other madness. Through this incredibly simple system (which will shortly become more powerful with its own interface) we can basically just install a package into your application in the same way most people would normally download, unzip, etc.
php oil install foo
Then add it to git, push and you're all good. Otherwise you have to run around installing dependencies and all sorts of other junk.
http://blog.stuartherbert.com/php/beyond-frameworks/
I hope you find it useful.
There was one comment here about namespaces... Phil gave a detailed answer; Dan says 'if you don't like it, don't use the framework'. Someone brought up the HTML class... Phil explains why it's there and that it isn't loaded unless you want to use it; Dan says the same thing, but adds 'stop whining'. I think Dan is incredibly talented, but I've seen he is very quick to use the words dumb, idiot and retard in his Twitter stream.
As a mid-level developer that uses mainly CodeIgniter, there is a lot about Fuel that is new to me and I don't fully understand. If I were to start using Fuel and had maybe a dumb question about how something worked, part of me wonders if I'd be berated publicly or called an idiot. That doesn't make me want to rush out and start learning something new.
I'm really grateful to all the Fuel devs for busting their asses to release this framework, the one criticism I have is one of PR, and the supposed 'community-driven' aspect of it.
Try asking a question in #rails. Chances are you won't even see anybody post for 3 days, and if they reply they'll call you a fking noob.
As a framework that is designed for simplicity I'm sure it's going to be an attractive choice for junior to intermediate developers, especially because there is a lot that you can learn from it which I can attest to as I already have. Thank you BTW. But that being said, and as you guys already know, there will be a lot of no0bish questions and seemingly stupid things said simply out of ignorance (Within the true meaning of the word ignorance as in "uninformed or lack of knowledge". Sorry, had to put that in there as I've seen and heard that word get misused a lot). Those questions need to be dealt with professionally. Lest we forget that we were all no0bs once. Never forget where you came from!
Going forward, I would suggest that all PR should be dealt with by you and Jelmer. At the same time though I can understand that that's a whole lot work that you guys would rather not have split between just the two of you. But what else can you do? I know you guys understand.
Anyway, something I know that you guys don't hear enough: Thanks for all of your hard work for giving us a sweet new kickass PHP framework. It really is f*#king amazing and I fall more and more in love with it every time I play with it. As a CI user of 2 years I now feel bored when I have to work on my CI based projects. That's a good thing. Cheers.
Go look at something like Twig (http://www.twig-project.org/) from the Symphony devs. That's step one I would take before using your project, is to hack it to use Twig templates instead of your views.
You could add Twig into Fuel in the time it took you to write that comment.
To answer your question specifically: it would be smart to use Twig by default, rather than developing your own custom Fuel template engine, because you would need to spend a significant amount of time to get something with the same feature-set, build quality and documentation coverage. Would this time not be better spent elsewhere?
As a pretty content Fuel user, I should also mention that your tone doesn't benefit the project.
Your replies to any not purely positive comments or criticism in this thread or elsewhere come off as very abrasive and rude by the way: not the kind of attitude HN expects and is certainly not the way to attract more of a community.
Your framework looks very neat and I'm interested in seeing what it turns into in the coming months/years: don't spoil your reputation before you even leave the gate.
Sure, those people would also be able to learn Python, Ruby, or whatever the flavor of the month is. But it would take you significantly longer to train them to work on your project. And they might want more money if they realize they now have a more valuable skill ;).
I believe this is why Facebook still uses PHP.
In that light: a new PHP framework that makes things even easier is a good thing.
That said, it's NOT true that Facebook still uses PHP because they get cheap developer power. See this Quora thread: http://www.quora.com/Why-hasn-t-Facebook-migrated-away-from-...
From FB's former Director of Engineering:
The reason Facebook hasn't migrated away from PHP is because it has incumbent inertia (it's what's there) and Facebook's engineers have managed to work around many of its flaws [...]
"Tons of problems and weaknesses" is largely untrue at this point. Many of the problems that were traditionally pointed to were corrected in 5 and 5.3. There is no interest in breaking backwards compatibility, so the built-in function parameter order inconsistencies are still valid. Most frameworks work around this issue with an OOP wrapper for array and string operations.
It is difficult to find good dev-power for PHP that's cheap. I've tried. You can find many people who have a basic level of PHP knowledge and refer to web apps as "scripts". Finding people who have an understanding of OOP and modern development techniques is much harder and more expensive.
Here's why I program web apps in PHP: it works and I know it well. If I need a library for something web related, I can assume it will be available as open-source. I don't have concerns that I can make a PHP application scale if I need to. When features don't make sense to implement in PHP, I'll snap them off and implement them in the most appropriate language in the background. Most of the heavy-lifting for web applications typically happens in the background.
Definitely hear you on the lack of PHP developers with an understanding of OOP and all though. Seen it myself when my previous company tried to hire one, the 'range' of people applying is incredible.
If it really bugs you it could easily be solved with a few helper/wrapper functions.
(Besides that, regarding elegance of syntax, there's no doubt that most other languages used for web dev'ing are lightyears ahead of PHP.)
This Fuel framework looks like they took Kohana 2.3.4, cleaned up some bugs, added the command line utility and migrations to it, and that's it. Awesome!
Really only one thing that seems to be missing (and maybe it's in there but not in the documentation): how do you put validation in the model, so you're not duplicating model validation in every action that processes submitted form data?
Other than that, I would also agree with what others have said about the tone of the developers -- it's not going to help the growth of the project's community in the long run.
And I will admit that the Ko3 docs are now much better than they were a year ago (well, that unofficial wiki is -- the official docs are still severely lacking).
This is the major thing that turned me off about Kohana. I loved the original concept - "PHP5 fork of CodeIgniter" - and we actually have it backing our two largest web apps. But I would never recommend Kohana again for a commercial project that is under active development.
Between minor versions there was major API breakage, that wasn't really documented - and was going on in parallel with 3.0 development (think Rails 2 -> 3 with no documentation). For a long time the "Unofficial Kohana 3 Wiki" was actually the only source of documentation for KO3 (even after release).
It seems like the PHP community keeps fragmenting into new PHP frameworks to replace old stodgy (cough PHP4) frameworks (good), with modern design practices (good), but then totally ignoring the community aspect of OS software, documentation, and maintenance.
class Controller_Foo{}
namespace Fuel\Task;
class Foo{}
It seems confusing.Previous to PHP5.3 (when namespaces were introduced) most frameworks followed the Zend_Style_Of_Naming (That class would be located in Zend/Style/Of/Naming.php).
All new frameworks that support PHP5.3+ (with the exception of Fuel, it seems) have done away with Zend_Style_Naming and follow direct namespace <-> file mapping.
http://groups.google.com/group/php-standards/web/psr-0-final...
Was 'ratified' by some of the bigger framework developers out there a while ago.
http://groups.google.com/group/php-standards/web/psr-0-final...
Voted on back in 2009 by members of Solar, Cake, Doctrine, Zend, Symfony, Typo3, PHP Core, Yahoo! and others.
And I stand by those. The first allows for more flexibility when it comes to code organization and the second makes mistakes in classloading a lot less common. You can disagree with these but we have documented them clearly. Also it's quite easy to add another autoloader, ours won't even do a filesystem check when trying to load from an unknown namespace so it should add hardly any overhead to attach a Zend (or anything) compatible loader.
There are 4 main namespaces.
Fuel\Core Fuel\App Fuel\Tasks Fuel\Migrations
Then packages have their own namespace too.
These help code that could potentially have the same name exists and allows for easy extending of core classes.
Class Foo extends Fuel\Core\Foo.
Thanks to a cascading file system very similar to Kohamas this is all very simPlenand very quick.
The Zend_Style_Class equates to classes/Zend/style/class.php and could exist in core or app, or packages, etc.
Perhaps they should have a page explaining how Fuel is different from Cake, Zend and Code igniter.
The comparisson to Cake & Zend is a bit apples and oranges. Both are hugemongous frameworks in comparisson, especially Cake has a pretty big footprint. Zend is even a whole other approach in the sense that it is more like a collection of loosly coupled classes, while Fuel is a more intergrated framework. I know for example that some have already been using Zend classes with Fuel, combining the large offerings of Zend with the development base we offer.
That's the worse degrading browser support I've seen :)
But I was thinking of things like the different browser (HTML5) Audio APIs 'we' are facing right now and my point was that you are probably better off just focusing on getting things right in one environment first before spending too much time on 'making it work for everyone'. Which is 'overrated' anyway, depending on the project. Just think of how Beatport.com is entirely based on Flash which is still the most convenient way of adding audio.
Why block your content from people who want to see it; just stop supporting it, put up a blank css file for < IE9, let the site be broken.
Doing this is the easiest way to lose me as a viewer of your website... if I am blocked at work there is no way I would go back to the site once I am home using a modern browser... It just seems silly to me!
Now to our own site disallowing IE7 while being targetted at web professionals. Pretty much no-one doing serious web development will be limited to IE6/7 - let alone use it as their primary browser. If you do and your employer is short-sighted enough to keep at IE6, you'll be part of a very very tiny minority which will most likely still not have access to PHP5.3 either.
We do use slightly modified versions of Kohana's querybuilder & View classes (something we're very upfront about, and from Ko3 btw not Ko2.3) but the framework by and large was build by us originally. And if parts were taken from other frameworks it is mentioned explicitly in the code, but those are the exceptions rather than the rule.
I didn't look at the underlying code at all, just browsed through the docs and to my eyes the "API" or "structure" of Fuel looked very similar to Kohana, which is a HUGE compliment coming from me, as Kohana is (was?!) my favorite PHP framework. Definitely not accusing anyone of stealing code -- just trying to answer the guy's question. I don't think anyone could argue that if you compare Fuel to Kohana and Symfony [as was the question], Fuel is WAY closer to the Kohana end of the spectrum.
Anyways, I'm really looking forward to trying this out on my next non-CMS project -- thank you for creating this.
I found a broken link though - http://fuelphp.com/docs/classes/agent.html and the error page looks a lot like CodeIgniter/Expression Engine :S
Symfony (which Delicious 2.0, Yahoo! Answers, Yahoo! Bookmarks, Dailymotion v2009, etc. were built on) has a CLI too ("symfony doctrine:migrate"), and is 5+ years old.
So although you mention doctrine:migrate - Yahoo were not using it on Answers, and if Delicious, Bookmarks and Daily Motion were using the Yahoo version of symfony, neither were they.
Remember though, that class won't be loaded unless you want it.
That doesn't tell you a lot about the quality or reliability of the framework and what's to come but personally I prefer the "let's get this out there" approach over borderline vapourware.
Besides that, browsing the FuelPHP forum it looks like people are already busy adding functionality through plugins and the team seems to be helpful and embracing it. So they've definitely got 'momentum'.
Also the 'docs' on FuelPHP seem to be pretty 'complete' at first glance, also giving me the impression that they are totally up-to-date while I can't even figure out where the proper 'docs' for Lithium are. They don't seem to have things arranged for 'being in the spotlight' yet.
And I can't comment on what's going on under the hood really, as I am more interested in 'libraries' that are not depending on any framework these days.
But as far as I can see, FuelPHP is sitting there for you along with current docs and a dedicated team to try out and give it a shot.
The links you are looking for:
• documentation (javadoc-style): http://lithify.me/docs
• drafts (book-like): http://dev.lithify.me/drafts/source/en
• community: irc://irc.freenode.net/#li3
They are hard to find, I agree.