2. WTF is Fuel?
• A “new” PHP framework
• “Combines the best of multiple frameworks”
• Fresh start
• PHP 5.3 only
• Made by a bunch of CodeIgniter guys
3.
4. It’s freaking brilliant!
• Incredibly lightweight
• Easy to learn
• Huge community
• Helpful forums
• Backwards compatibility is key
• Minimal dependencies
• PHP 5.1.6
5. It’s PHP5ier!
• Still lightweight
• Everything is a class
• No more $ci =& get_instance();
• PHP 5 autoloading - no loader!
CodeIgniter Fuel
$this->load->library('session'); Session::get('foo');
$this->session->userdata('foo');
• Authentication + Hierarchal MVC (HMVC)
• “Everything” is a driver
6. • Cascading file system
• No namespacing
- OAuth_Provider_Facebook
- OAuthProvider_Facebook
• Splintered: v2.4 versus v3.2
• Great DB builder, not loving the ORM
7. We stole it!
• Improved Cascading File System
Autoloader::add_classes(array(
'Mongo_OdmCollection'
=> __DIR__.'/classes/collection.php',
'Mongo_OdmDatabase'
=> __DIR__.'/classes/database.php',
'Mongo_OdmDocument'
=> __DIR__.'/classes/document.php',
'Mongo_OdmJSON'
=> __DIR__.'/classes/json.php',
));
• Added Namespacing
class Config extends FuelCoreConfig {}
• Modules = Routable ‘mini-applications’
• Packages = Installable ‘gem’-like class collections
• Recycled a few other bits
• Views
• OAuth
• Num (Credit card masking and other bits)
8. • Command-line tools
• Database Migrations and ORM bundled in
• Twig = awesome parser
• Namespaces by the metric fuck-ton
namespace AcmeHelloBundleController;
use SymfonyComponentHttpFoundationResponse;
class HelloController
{
public function indexAction($name)
{
return new Response('<html><body>Hello '.$name.'!</
body></html>');
}
}
10. // old usage still valid, will load app/views/example.php
View::forge('example');
// load a Mustache template, will load and parse app/views/
View::forge('example.mustache');
// load a Twig template, will load and parse app/views/example.twig
View::forge('example.twig');
// load a Jade template, will load and parse app/views/example.jade
View::forge('example.jade');
// load a Haml template, will load and parse app/views/example.haml
View::forge('example.haml');
// load a Smarty template, will load and parse app/views/
View::forge('example.smarty');
// load a Dwoo template, ATTENTION: this one expects app/views/
View::forge('example.dwoo');
11.
12. • Beautiful command line • Conventions through the nose
• Interactive Debugging • How the f**k does that work
• Package installation • Gem conflicts = AGGHHHH!
• http://rubygems.org/ • Consult a wizard if it breaks
• Scaffolding • ORM restrictions?
• ORM - perfect for RAD
13. • Beautiful command line • No conventions
• Interactive Debugging • Simple OOP
• Package installation • Application specific packages
• http://cells.fuelphp.com/ • Pretty exceptions
• Scaffolding • Scaffold templates
• ORM - perfect for RAD • DWTFYL ORM
14. $ oil create blog
$ cd blog
$ oil generate scaffold title:string summary:text body:text