SlideShare a Scribd company logo
PHP Framework “Battle”
Zakir Hemraj
• Slides and code will
be posted on the
meetup group
• Video will be posted
on:
achievers.com/tech
• Tell your friends!
About Me
• Dev Team Lead @ Achievers
• Professional Web Framework Experience:
– J2EE with Spring, Hibernate
– PHP with CodeIgniter
– Ruby on Rails
• Not an expert in Zend Framework, CakePHP or
Symfony
PHP Framework Battle
PHP Framework Battle
Goal
1. Give you “flavor” of a few frameworks
2. Share some scientific and subjective
comparisons
3. Make you better equipped to compare and
choose the right framework
What I’m not doing…
• In-depth framework code walkthrough of all
features and functions
• Handing you a silver bullet
Agenda
1. Overview of frameworks
2. Review basic concepts
– MVC, ORMs
3. The application
– requirements, db schema
4. Code walkthrough
5. Performance and other comparisons
6. Final thoughts
The Contenders
Big Sites
CakePHP Zend Framework Symfony CodeIgniter
askmen.com legaldownload.net cfl.ca dictionary.com
usafootball.com onewishlist.net flash-wars.com codeguru.com
gamestous.com manageme.in ted.com expressionengine.com
Sources:
http://book.cakephp.org/1.2/view/510/Sites-in-the-wild
http://framework.zend.com/wiki/pages/viewpage.action?pageId=14134
http://trac.symfony-project.org/wiki/ApplicationsDevelopedWithSymfony
“You can write shitty code in any
language, any framework”
Review - MVC
Source: http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller
• Most web frameworks
are MVC these days
• Lots of inconsistencies
with the “model” layer
HTTP Request
HTML
Business Logic
& DB Access
Review - ORM
• Object Relational Mapping
• Maps database records to objects
• 1-to-1 table to object class
– E.g. job table -> job class
• Layer of abstraction to:
– Make code more maintainable
– Enable stronger OO programming
class TechTalk{ }
table:
tech_talk
O
R
M
Now What?
The Application
• A basic job board where people can:
– Add jobs
– View a listing of jobs
– Look at a post in more detail
• So simple, you could probably code it in your
sleep
The Schema
Setup
1. Download
framework *
2. Configure your app
with your db
3. Point your web
server to the
directory (i.e. vhost
in apache)
4. Start coding
PHP Framework Battle
Zend Code Summary
• Nice command line tools -> less typing
• Hard object instantiations play nice with IDE
• Good, OO separation of layers, including db
access, business logic, and forms
• Cons: We’ll discuss later ;)
PHP Framework Battle
CI Code Summary
• Super lightweight
• Very few conventions or “magic”
– Doesn’t force things on you
– Very explicit
• Lots of well documented tools and libraries
PHP Framework Battle
CAKE Summary
• Rails-like convention over configuration
• Very powerful, with convenient tools like
scaffolding and strong relational mapping
• Lots of “magic” that you need to be aware of
CONFIGURATION
CONVENTION
CI CAKEZend
Documentation
• Zend:
– Complete, but fragmented
– hard to follow.
• CI
– Great
• CAKE
– Outstanding
Other Comparisons
Zend CI CAKE
i18n Y Y Y
unit testing Y N * Y
templating Y Y * Y
security utils Y Y Y
authentication Y N Y
caching Y Y Y
Performance
• Source:
http://www.ruilog.com/blog/view/b6f0e42cf7
05.html
• Simple MVC logic, no DB connection
• See site for full hardware specs
Requests per Second
2331
873
678
1367
0
500
1000
1500
2000
2500
CodeIgniter 2.1 CakePHP 2.0.4 Zend 1.11.11 Symfony 2.0.6
Memory Usage (KB)
752.55
2824.26
2576.47
1711.57
0
500
1000
1500
2000
2500
3000
CodeIgniter 2.1 CakePHP 2.0.4 Zend 1.11.11 Symfony 2.0.6
System Load Average in 1 Minute
1.65
5.1
10.02
1.44
0
2
4
6
8
10
12
CodeIgniter 2.1 CakePHP 2.0.4 Zend 1.11.11 Symfony 2.0.6
Avg. Response Time (Milliseconds)
7.24
14.73
20.22
12.79
0
5
10
15
20
25
CodeIgniter 2.1 CakePHP 2.0.4 Zend 1.11.11 Symfony 2.0.6
Number of Function Calls
491
834
1789
792
0
200
400
600
800
1000
1200
1400
1600
1800
2000
CodeIgniter 2.1 CakePHP 2.0.4 Zend 1.11.11 Symfony 2.0.6
Number of Included Files
0
10
20
30
40
50
60
70
CodeIgniter 2.1 CakePHP 2.0.4 Zend 1.11.11 Symfony 2.0.6
AND LASTLY…
My Two Cents
• Too much abstraction is bad
• Understand the tradeoffs
• You will need to break out of the framework
• Stay curious
<?
echo “END”;
die();
?>

More Related Content

PPT
Php Frameworks
Ryan Davis
 
PPTX
PHP framework difference
iScripts
 
PPTX
Introduction to MVC Web Framework with CodeIgniter
Pongsakorn U-chupala
 
PPTX
PHP Frameworks & Introduction to CodeIgniter
Jamshid Hashimi
 
PDF
Best PHP Frameworks
Clixlogix Technologies
 
PDF
CodeIgniter - PHP MVC Framework by silicongulf.com
Christopher Cubos
 
PPT
Codeigniter
minhrau111
 
PPTX
Modular PHP Development using CodeIgniter Bonfire
Jeff Fox
 
Php Frameworks
Ryan Davis
 
PHP framework difference
iScripts
 
Introduction to MVC Web Framework with CodeIgniter
Pongsakorn U-chupala
 
PHP Frameworks & Introduction to CodeIgniter
Jamshid Hashimi
 
Best PHP Frameworks
Clixlogix Technologies
 
CodeIgniter - PHP MVC Framework by silicongulf.com
Christopher Cubos
 
Codeigniter
minhrau111
 
Modular PHP Development using CodeIgniter Bonfire
Jeff Fox
 

What's hot (20)

PPT
Zend framework 01 - introduction
Tricode (part of Dept)
 
PPT
Top 10 web application development frameworks 2016
iMOBDEV Technologies Pvt. Ltd.
 
PPTX
Yii2 by Peter Jack Kambey
k4ndar
 
PPTX
yii1
Rajat Gupta
 
PPTX
Panada: An Introduction by Iskandar Soesman
k4ndar
 
PPTX
Comparing web frameworks
Aditya Sengupta
 
PDF
PHP Indonesia Meetup - What's New in Yii2 and PHP5.5
Petra Barus
 
PPT
ColdFusion framework comparison
VIkas Patel
 
PPT
My cool new Slideshow!
netzwelt12345
 
PPTX
Feature and Future of ASP.NET
Md. Mahedee Hasan
 
PPTX
Mainframe, the fast PHP framework
bibakis
 
PDF
Scaling Yii2 Application
Petra Barus
 
PPTX
Web application framework
Pankaj Chand
 
PPTX
MVC4 framework
imarkovic
 
PPTX
Basic concepts for python web development
NexSoftsys
 
PPTX
A site in 15 minutes with yii
Andy Kelk
 
PPT
A Microsoft primer for PHP devs
guest0a62e8
 
DOCX
Entity framework (EF) 7
Paul Graham
 
PDF
Codeigniter
Joram Salinas
 
PPTX
Asp.net mvc 4
Hrichi Mohamed
 
Zend framework 01 - introduction
Tricode (part of Dept)
 
Top 10 web application development frameworks 2016
iMOBDEV Technologies Pvt. Ltd.
 
Yii2 by Peter Jack Kambey
k4ndar
 
yii1
Rajat Gupta
 
Panada: An Introduction by Iskandar Soesman
k4ndar
 
Comparing web frameworks
Aditya Sengupta
 
PHP Indonesia Meetup - What's New in Yii2 and PHP5.5
Petra Barus
 
ColdFusion framework comparison
VIkas Patel
 
My cool new Slideshow!
netzwelt12345
 
Feature and Future of ASP.NET
Md. Mahedee Hasan
 
Mainframe, the fast PHP framework
bibakis
 
Scaling Yii2 Application
Petra Barus
 
Web application framework
Pankaj Chand
 
MVC4 framework
imarkovic
 
Basic concepts for python web development
NexSoftsys
 
A site in 15 minutes with yii
Andy Kelk
 
A Microsoft primer for PHP devs
guest0a62e8
 
Entity framework (EF) 7
Paul Graham
 
Codeigniter
Joram Salinas
 
Asp.net mvc 4
Hrichi Mohamed
 
Ad

Similar to PHP Framework Battle (20)

PDF
Sitecore development approach evolution – destination helix
Peter Nazarov
 
PDF
Best Practices for WordPress
Taylor Lovett
 
KEY
Zend Code in ZF 2.0
Ralph Schindler
 
KEY
UPenn on Rails intro
Mat Schaffer
 
PPTX
Documenting an API for the First Time? Quick-Start Tips for Your First API Do...
Petko Mikhailov
 
PDF
Code for Startup MVP (Ruby on Rails) Session 1
Henry S
 
PPTX
10 Reasons You MUST Consider Pattern-Aware Programming
PostSharp Technologies
 
PDF
Headless cms architecture
Kevin Wenger
 
PPTX
2011 NetUG HH: ASP.NET MVC & HTML 5
Daniel Fisher
 
PDF
Devconf 2011 - PHP - How Yii framework is developed
Alexander Makarov
 
PPTX
CodeIgniter
Nitin Reddy Katkam
 
PDF
PHP Frameworks Review - Mar 19 2015
kyphpug
 
PPT
Code igniter overview
umesh patil
 
PPTX
Best Practices for Building WordPress Applications
Taylor Lovett
 
PPTX
Setting Up CircleCI Workflows for Your Salesforce Apps
Daniel Stange
 
PPTX
Debugging with Zend Studio for Eclipse
OSSCube
 
PPTX
How to build a JavaScript toolkit
Michael Nelson
 
PPTX
Untangling spring week1
Derek Jacoby
 
PPTX
Building a REST API Microservice for the DevNet API Scavenger Hunt
Ashley Roach
 
Sitecore development approach evolution – destination helix
Peter Nazarov
 
Best Practices for WordPress
Taylor Lovett
 
Zend Code in ZF 2.0
Ralph Schindler
 
UPenn on Rails intro
Mat Schaffer
 
Documenting an API for the First Time? Quick-Start Tips for Your First API Do...
Petko Mikhailov
 
Code for Startup MVP (Ruby on Rails) Session 1
Henry S
 
10 Reasons You MUST Consider Pattern-Aware Programming
PostSharp Technologies
 
Headless cms architecture
Kevin Wenger
 
2011 NetUG HH: ASP.NET MVC & HTML 5
Daniel Fisher
 
Devconf 2011 - PHP - How Yii framework is developed
Alexander Makarov
 
CodeIgniter
Nitin Reddy Katkam
 
PHP Frameworks Review - Mar 19 2015
kyphpug
 
Code igniter overview
umesh patil
 
Best Practices for Building WordPress Applications
Taylor Lovett
 
Setting Up CircleCI Workflows for Your Salesforce Apps
Daniel Stange
 
Debugging with Zend Studio for Eclipse
OSSCube
 
How to build a JavaScript toolkit
Michael Nelson
 
Untangling spring week1
Derek Jacoby
 
Building a REST API Microservice for the DevNet API Scavenger Hunt
Ashley Roach
 
Ad

More from Achievers Tech (7)

PPTX
Accessibility: A Journey to Accessible Rich Components
Achievers Tech
 
PDF
My sql explain cheat sheet
Achievers Tech
 
PPTX
Agile - The Xtreme Labs Way
Achievers Tech
 
PPTX
Optimizing MySQL Queries
Achievers Tech
 
PPTX
Your Web Application Is Most Likely Insecure
Achievers Tech
 
PPTX
Profiling and Tuning a Web Application - The Dirty Details
Achievers Tech
 
PPTX
Scaling High Traffic Web Applications
Achievers Tech
 
Accessibility: A Journey to Accessible Rich Components
Achievers Tech
 
My sql explain cheat sheet
Achievers Tech
 
Agile - The Xtreme Labs Way
Achievers Tech
 
Optimizing MySQL Queries
Achievers Tech
 
Your Web Application Is Most Likely Insecure
Achievers Tech
 
Profiling and Tuning a Web Application - The Dirty Details
Achievers Tech
 
Scaling High Traffic Web Applications
Achievers Tech
 

Recently uploaded (20)

PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
PPTX
Comunidade Salesforce SĂŁo Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira JĂşnior
 
PDF
Software Development Company | KodekX
KodekX
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
Comunidade Salesforce SĂŁo Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira JĂşnior
 
Software Development Company | KodekX
KodekX
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 

PHP Framework Battle

  • 2. • Slides and code will be posted on the meetup group • Video will be posted on: achievers.com/tech • Tell your friends!
  • 3. About Me • Dev Team Lead @ Achievers • Professional Web Framework Experience: – J2EE with Spring, Hibernate – PHP with CodeIgniter – Ruby on Rails • Not an expert in Zend Framework, CakePHP or Symfony
  • 6. Goal 1. Give you “flavor” of a few frameworks 2. Share some scientific and subjective comparisons 3. Make you better equipped to compare and choose the right framework
  • 7. What I’m not doing… • In-depth framework code walkthrough of all features and functions • Handing you a silver bullet
  • 8. Agenda 1. Overview of frameworks 2. Review basic concepts – MVC, ORMs 3. The application – requirements, db schema 4. Code walkthrough 5. Performance and other comparisons 6. Final thoughts
  • 10. Big Sites CakePHP Zend Framework Symfony CodeIgniter askmen.com legaldownload.net cfl.ca dictionary.com usafootball.com onewishlist.net flash-wars.com codeguru.com gamestous.com manageme.in ted.com expressionengine.com Sources: http://book.cakephp.org/1.2/view/510/Sites-in-the-wild http://framework.zend.com/wiki/pages/viewpage.action?pageId=14134 http://trac.symfony-project.org/wiki/ApplicationsDevelopedWithSymfony
  • 11. “You can write shitty code in any language, any framework”
  • 12. Review - MVC Source: http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller • Most web frameworks are MVC these days • Lots of inconsistencies with the “model” layer HTTP Request HTML Business Logic & DB Access
  • 13. Review - ORM • Object Relational Mapping • Maps database records to objects • 1-to-1 table to object class – E.g. job table -> job class • Layer of abstraction to: – Make code more maintainable – Enable stronger OO programming class TechTalk{ } table: tech_talk O R M
  • 15. The Application • A basic job board where people can: – Add jobs – View a listing of jobs – Look at a post in more detail • So simple, you could probably code it in your sleep
  • 17. Setup 1. Download framework * 2. Configure your app with your db 3. Point your web server to the directory (i.e. vhost in apache) 4. Start coding
  • 19. Zend Code Summary • Nice command line tools -> less typing • Hard object instantiations play nice with IDE • Good, OO separation of layers, including db access, business logic, and forms • Cons: We’ll discuss later ;)
  • 21. CI Code Summary • Super lightweight • Very few conventions or “magic” – Doesn’t force things on you – Very explicit • Lots of well documented tools and libraries
  • 23. CAKE Summary • Rails-like convention over configuration • Very powerful, with convenient tools like scaffolding and strong relational mapping • Lots of “magic” that you need to be aware of
  • 25. Documentation • Zend: – Complete, but fragmented – hard to follow. • CI – Great • CAKE – Outstanding
  • 26. Other Comparisons Zend CI CAKE i18n Y Y Y unit testing Y N * Y templating Y Y * Y security utils Y Y Y authentication Y N Y caching Y Y Y
  • 30. System Load Average in 1 Minute 1.65 5.1 10.02 1.44 0 2 4 6 8 10 12 CodeIgniter 2.1 CakePHP 2.0.4 Zend 1.11.11 Symfony 2.0.6
  • 31. Avg. Response Time (Milliseconds) 7.24 14.73 20.22 12.79 0 5 10 15 20 25 CodeIgniter 2.1 CakePHP 2.0.4 Zend 1.11.11 Symfony 2.0.6
  • 32. Number of Function Calls 491 834 1789 792 0 200 400 600 800 1000 1200 1400 1600 1800 2000 CodeIgniter 2.1 CakePHP 2.0.4 Zend 1.11.11 Symfony 2.0.6
  • 33. Number of Included Files 0 10 20 30 40 50 60 70 CodeIgniter 2.1 CakePHP 2.0.4 Zend 1.11.11 Symfony 2.0.6
  • 35. My Two Cents • Too much abstraction is bad • Understand the tradeoffs • You will need to break out of the framework • Stay curious

Editor's Notes

  • #5: -PHP Developers? -Experience with Zend, Cake, CodeIgniter, RoR, J2EE frameworks?-Had to choose a web framework for your company
  • #6: Choosing a web frameworkis a lot like this. Claims to be:More enjoyable to useBetter securityBetter layers of separation
  • #10: ZendRun by Zend technologiesCakeStarted in 2005Modeled on RoRIn 2009, some members left to start the Lithium framework
  • #11: All frameworks “work” and have their benefitsThe reality is that
  • #15: Poll audience -&gt; what things do you look for
  • #17: MySQLUsually would use singular labels for table nameInts, varchars, and datetime
  • #19: Zend topics to cover:Zend command line utilities (zf)zf create project jobs_zendModel layerDifference between model and db_tablezf create model xzf create db-table job jobs (or create test)db tabledb table objects have built in functions and are 1-to-1 to tables (but not necessarily an orm). Simple DAOs. Override variables that define table, primary, and other options.Can write custom “queries” in db table objectsModelsMeant to encapsulate business logicDon’t extend anythingStrong object declaration makes for good IDE experienceIntroduce skinny controller, fat model ControllerIndex Contoller is defaultNaming conventions -&gt; xAction, and url patterns -&gt; not that cleanViewsBasic manipulation of dataSide notes:-good separation of staging, production, etc. out of the box
  • #27: Go to wikipedia framework comparisons if you want more
  • #36: AbstractionJavascript and html abstraction can lead to problems, working around framework to get what you wantQuery abstraction from ORM should be used with cautionTradeoffsRAD frameworks with lots of magic have their benefits, but also abstract devs from underlying performance issuesLite frameworks offer great performance, but you need to develop your own standards, especially for your own teamsBreakout-For almost any serious application, you’ll need to change or modify something about the framework-At Achievers, we needed to modify CI routing, logging, application loading, security filtering, etc. Understand the extendability of your applicationStay curiousLook under the covers always, and don’t be scaredUnderstand what’s happening behind the scenesUltimately, it’s the developer, not the framework