PHP Frameworks in 2008

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

2 comments

Comments 1 - 2 of 2 previous next Post a comment

  • + lvanderree lvanderree 5 months ago
    Except for the benchmarks these slights are great!

    These simple benchmarks won’t tell you a thing, except if you would write such a tiny application. Imagine you have to do user-validation, combine several tables, translate labels (i18n), etc. And now do a benchmark.... It would probably take forever to write the baseline, and that is where the power of the frameworks show themselves.

    Best Example, if you want to write 'hello world', why not write it in HTML, instead of php echo 'hello world', or start-complete MVC framework, get 'hello world' from model, pass it through the controller and show it in the view...
  • + hoangtk Trần Khải Hoàng 11 months ago
    This slide is very useful. Why did you not benchmark other framework like symfony or zend ?
Post a comment
Embed Video
Edit your comment Cancel

18 Favorites, 2 Groups & 1 Event

PHP Frameworks in 2008 - Presentation Transcript

  1. STATE OF PLAY: PHP FRAMEWORKS IN 2008 Akash Mehta, Web Developer - http://bitmeta.org/ OSDC Sydney 2008
    • Brisbane-based web developer, author, student
    • Experimenting with Rails before it was cool
    • Worked on production code in Cake, CI, Zend
    About the Speaker
  2. What is PHP?
  3.  
  4.  
  5.  
  6. What if we had a framework?
  7.  
  8.  
  9.  
  10. PHP Frameworks
  11. Why?
  12. PHP: A community in transition
    • Late 90s
      • Rasmus' personal home page.
    • 2000 - 2004
      • Forums
      • CMS Systems
    • 2005 - ?
      • Complex applications
      • Web services
  13. A fine line
    • What’s a website?
    • What’s a web application?
    • What’s an application served over the web?
  14. Basic LEGO Process
    • Try a few pieces
    • Push them together
    • Experiment with combinations
    • Monitor the overall result
  15. Advanced LEGO Process
    • Diagram, visualise
    • Plan components, and how they fit together
    • Experiment on individual sections
    • Build each module
    • Plug them together
  16.  
  17. Basic PHP Process
    • Create index file
    • Create some libraries, maybe in a folder
    • Extend, generalise.
    • Lather, rinse, repeat.
  18. Advanced PHP Process
    • Describe data model of problem domain
    • Generate schema / model files
    • Write data logic
    • Write business logic
    • Create presentation layer
  19. With a helping hand…
  20. Rails…
    • Purpose-built, 37signals
    • Commonplace tasks easier “out of the box”
      • Convention over configuration
    • Build system, dev server
    • ActiveRecord: ORM
  21. State of play
  22. Fast-forward to present day...
    • Mingle2: CakePHP, dating site, 66 hours
    • Mozilla Addons: 4M views/day, Cake
    • Bug.gd: Integrated error search, CodeIgniter
    • Fox Media: 50 IGN properties built on ZF
    • Yahoo! Bookmarks: mostly Symfony
  23. Remora
    • Mozilla Addons, CakePHP
    • Massive database schema
    • Master/slave DB replication
    • Lussumo Vanilla integration
    • Managed
      • Team trapped in Whistler, Canada by rock slide
      • Filed bug report (severity: blocking)
  24. Available Frameworks
    • Agavi
    • Akelos PHP Framework
    • Caffeine PHP
    • CakePHP
    • Canvas Framework
    • CodeIgniter
    • Drupal
    • epesiBIM
    • Horde
    • IVY Framework
    • Joomla!
    • Mambo (software)
    • MediaWiki
    • Midgard and MidCOM
    • MODx
    • Orinoco Framework
    • PHP on Trax
    • PEAR
    • PHP For Applications
    • PHPNuke
    • PRADO
    • Qcodo
    • QPHP Framework
    • Seagull PHP Framework
    • SilverStripe
    • Simplicity PHP framework
    • SWiZ
    • Symfony
    • Tigermouse
    • TYPO3
    • XOOPS
    • Zend Framework
    • Zoop Framework
  25. Visible Frameworks
    • Cake
    • Zend Framework
    • Symfony
    • CodeIgniter
    • eZ Components
  26. Visible Frameworks
    • Cake
    • Zend Framework
    • Symfony
    • CodeIgniter
    • eZ Components
  27. Common principles
    • Code reuse
    • Flexibility
    • Functionality for common tasks
      • Validation, DAL, Forms…
    • Best practices, design patterns
      • The “common ground” to agree on
  28. Exploring the options
  29. Full-stack or glue?
  30. Features
    • Architecture patterns – MVC
    • Database – DALs, ORMs
    • Il8n
    • Unit Testing
    • Code generation
  31. Design Patterns
    • ActiveRecord, ORM
    • MVC, Front Controller
    • URL Routers/Dispatchers
      • http://localhost/controller/action/param/param...
    • Testable architecture
  32. What’s all this magic?
    • E.g. Cake:
      • eval("class DboTest extends $class {…")
    • Workarounds for compatibility
      • Frameworks quietly manage deployment issues
    • On-the-fly introspection
      • What URL are we really hosted at?
    • Magic: convention
  33. Foreigners
    • Application-level schema definitions
    • Database migrations
    • Development servers
    • from django.db import models
    • class User(models.Model):
    • username = models.CharField(max_length= 255 )
    • password = models.CharField(max_length= 255 )
    • name = models.CharField(max_length= 255 )
    • admin = models.BooleanField(default= False )
    • list_display = ( 'name' , 'admin' )
    • list_filter = [ 'admin' ]
    • def __unicode__( self):
    • return self.username
    • $ python manage.py syncdb
    App-level schema definitions
  34. Automatic Admin
  35. Automatic Admin
  36. CakePHP
    • Full-stack, MIT license
    • Modelled after Rails
    • PHP4/5
    • CRUD+ORM
    • Single-LOC scaffolding
    • CLI utility – bake
    • Make simple apps quick
  37. CakePHP Usage Scenarios
    • Single-developer, small dev shops
    • Building applications from scratch
      • esp. complex databases, ORM layer.
    • General audience open source projects
  38. Zend Framework
    • Glue, New BSD License
    • No single paradigm
    • PHP 5.1.4/5.2.3+
    • Zend QA, maintenance
    • Loosely-coupled
    • Lucene, AMF, GData
    • Showcase current trends
  39. Zend Framework Usage Scenarios
    • Flexibility to suit existing approaches
      • “ Enterprise” projects reuse components
      • Mid-size teams use toolchain
    • Integrates well with other frameworks
      • Cake, CI; Just add Zend
    • Manage developer turnover
  40. Symfony
    • Full-stack, MIT license
    • Incorporates other libraries
      • Propel, Prado, Spyc, Pake
      • Prototype, TinyMCE
    • CLI Environment
    • Admin generator
    • Extremely configurable
    • Corporate sponsor
  41. Symfony Usage Scenarios
    • Reasonably flexible for existing teams
    • Steeper learning curve
      • Complete stack
    • “ Enterprise-context” – purpose-built
    • Not so suited to individuals
  42. CodeIgniter
    • Full-stack, Apache/BSD
    • Minimal, lightweight
    • PHP 4/5
    • Rough MVC
    • Rails features
      • Validation, Caching
      • Scaffolding, AR
    • Optional templating
    • Very flexible
  43. CodeIgniter Usage Scenarios
    • Individuals, small dev teams
      • Low learning curve, excellent documentation
    • Saleable software
      • Broad environment compatibility, drop in place
    • Distributed teams
      • Popular among offshore developers
  44. Which is right for you?
    • Don’t mind “magic”
    • Clean slate
    • Smaller team / individual
    • Complex data
    • Some control over server
    • Less magic, need reliability
    • Existing code feasible
    • Mid-size+ team (inc. FOSS)
    • Complex business logic
    • Control over server
    • Cake
    • Zend
  45. Which is right for you?
    • Happy with magic
    • Clean slate
    • Mid-size team
    • Complex structure
    • Some control over server
    • Don’t need magic
    • Clean slate
    • Smaller team / individual
    • Straightforward system
    • No control over server
    • Symfony
    • CodeIgniter
  46. Features   Cake Zend Symfony CodeIgniter eZ Components Type Full-stack Glue / Full-stack Full-stack Glue / Full-stack Glue PHP 4 Yes No No Yes No Code Generation Yes No Yes No No MVC (Push) 1 Yes, AR Yes Yes Yes, AR No ORM Yes, AR Yes, Data Gateway Yes, Doctrine Yes, Plugin Yes AJAX 2 Yes, Prototype No Yes, Prototype Yes, Plugin No Il8n Yes Yes Yes Yes Yes Scaffolding Yes No Yes Yes No Unit Testing Yes, Plugin Yes Yes Yes Yes DB Migrations Yes, Plugin Yes Yes, Plugin Yes, Plugin Yes Security Yes, ACL Yes, ACL Yes Yes Yes Template Yes Yes Yes Yes Yes Validation Yes Yes Yes Yes Yes Caching Yes Yes Yes Yes Yes
  47. Benchmarks
  48. Baseline
    • <? php
    • class Users extends Controller {
    • function index () {
    • $this -> load -> model ( 'User_model' , 'user' , TRUE );
    • $data = array ( 'users' => $this -> user -> db -> get ( 'users' ));
    • $this -> load -> view ( 'users_index' , $data );
    • }
    • }
    • <? php
    • class User_model extends Model {
    • }
    • < h1 > Users </ h1 >
    • < table >
    • < tr >
    • < th > ID </ th >
    • < th > Name </ th >
    • < th > Bio </ th >
    • </ tr >
    • <? php foreach ( $users -> result_array () as $user ): ?>
    • < tr >
    • < td ><? = $user [ 'usernum' ] ?></ td >
    • < td ><? = $user [ 'name' ] ?></ td >
    • < td ><? = $user [ 'bio' ] ?></ td >
    • </ tr >
    • <? php endforeach ; ?>
    • </ table >
    CodeIgniter
  49. CakePHP
  50. Results ./ab –n 500 –c 10 http://localhost/frameworks/baseline.html /baseline.php /cake_.../users/ /codeigniter.../index.php/users/ Measure Baseline Vanilla PHP CodeIgniter CakePHP Requests/sec (mean) 1033.91 166.93 21.48 6.00 Time taken 0.48s 2.99s 23.28s 83.30s 50% reqs max time 15ms 15ms 436ms 936ms
    • Identical HTML (±50b), varying header lengths
    • Cake: CPU bound (1.67 GHz Core Duo, 2GB RAM)
    • CI: nearly CPU bound (~80%)
    • Baseline: disk bound?
    • 15ms system clock limitation
      • Baseline HTML: “98%” reqs under 15ms
    • Caching (APC, general) – File count?
      • DB caches e.g. Cake
    Discussion
  51. Questions
  52. CONTACT: SCYTHEREAL@BITMETA.ORG

+ DraiconeDraicone, 11 months ago

custom

3190 views, 18 favs, 0 embeds more stats

State of Play: PHP Frameworks in 2008. A review of more

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 3190
    • 3190 on SlideShare
    • 0 from embeds
  • Comments 2
  • Favorites 18
  • Downloads 0
Most viewed embeds

more

All embeds

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories

Groups / Events