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
PPTX
PHP framework difference
PPTX
Introduction to MVC Web Framework with CodeIgniter
PPTX
PHP Frameworks & Introduction to CodeIgniter
PDF
Best PHP Frameworks
PDF
CodeIgniter - PHP MVC Framework by silicongulf.com
PPT
Codeigniter
PPTX
Modular PHP Development using CodeIgniter Bonfire
Php Frameworks
PHP framework difference
Introduction to MVC Web Framework with CodeIgniter
PHP Frameworks & Introduction to CodeIgniter
Best PHP Frameworks
CodeIgniter - PHP MVC Framework by silicongulf.com
Codeigniter
Modular PHP Development using CodeIgniter Bonfire

What's hot (20)

PPT
Zend framework 01 - introduction
PPT
Top 10 web application development frameworks 2016
PPTX
Yii2 by Peter Jack Kambey
PPTX
PPTX
Panada: An Introduction by Iskandar Soesman
PPTX
Comparing web frameworks
PDF
PHP Indonesia Meetup - What's New in Yii2 and PHP5.5
PPT
ColdFusion framework comparison
PPT
My cool new Slideshow!
PPTX
Feature and Future of ASP.NET
PPTX
Mainframe, the fast PHP framework
PDF
Scaling Yii2 Application
PPTX
Web application framework
PPTX
MVC4 framework
PPTX
Basic concepts for python web development
PPTX
A site in 15 minutes with yii
PPT
A Microsoft primer for PHP devs
DOCX
Entity framework (EF) 7
PDF
Codeigniter
PPTX
Asp.net mvc 4
Zend framework 01 - introduction
Top 10 web application development frameworks 2016
Yii2 by Peter Jack Kambey
Panada: An Introduction by Iskandar Soesman
Comparing web frameworks
PHP Indonesia Meetup - What's New in Yii2 and PHP5.5
ColdFusion framework comparison
My cool new Slideshow!
Feature and Future of ASP.NET
Mainframe, the fast PHP framework
Scaling Yii2 Application
Web application framework
MVC4 framework
Basic concepts for python web development
A site in 15 minutes with yii
A Microsoft primer for PHP devs
Entity framework (EF) 7
Codeigniter
Asp.net mvc 4
Ad

Similar to PHP Framework Battle (20)

PPTX
What's the "right" PHP Framework?
PPTX
Can I learn PHP course in 3 months..pptx
PPTX
MVC & CodeIgniter
PPTX
SD PHP Zend Framework
PPTX
MVC Frameworks for building PHP Web Applications
PPTX
Zend MVC pattern based Framework – Best for Enterprise web applications
PDF
PHP Frameworks Review - Mar 19 2015
PPTX
Outsourcing php india
PDF
Framework and Application Benchmarking
PPTX
PHP Web Frameworks Introduction
PDF
Create Your Own Framework by Fabien Potencier
PDF
Symfony2 San Francisco Meetup 2009
PDF
Top 6 leading PHP frameworks for web development
ODP
Libraries Frameworks And Cms
PPT
PHP Frameworks and CodeIgniter
PDF
Symfony 2.0 on PHP 5.3
PPTX
Php Web Frameworks
PDF
PHP Frameworks That Will Woo-Trick Your Web Application Development in 2019
PDF
How To Choose A PHP Web Development Framework In 2022
What's the "right" PHP Framework?
Can I learn PHP course in 3 months..pptx
MVC & CodeIgniter
SD PHP Zend Framework
MVC Frameworks for building PHP Web Applications
Zend MVC pattern based Framework – Best for Enterprise web applications
PHP Frameworks Review - Mar 19 2015
Outsourcing php india
Framework and Application Benchmarking
PHP Web Frameworks Introduction
Create Your Own Framework by Fabien Potencier
Symfony2 San Francisco Meetup 2009
Top 6 leading PHP frameworks for web development
Libraries Frameworks And Cms
PHP Frameworks and CodeIgniter
Symfony 2.0 on PHP 5.3
Php Web Frameworks
PHP Frameworks That Will Woo-Trick Your Web Application Development in 2019
How To Choose A PHP Web Development Framework In 2022
Ad

More from Achievers Tech (7)

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

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
KodekX | Application Modernization Development
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
GamePlan Trading System Review: Professional Trader's Honest Take
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Big Data Technologies - Introduction.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Review of recent advances in non-invasive hemoglobin estimation
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Spectral efficient network and resource selection model in 5G networks
Dropbox Q2 2025 Financial Results & Investor Presentation
KodekX | Application Modernization Development
Advanced methodologies resolving dimensionality complications for autism neur...
“AI and Expert System Decision Support & Business Intelligence Systems”
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
20250228 LYD VKU AI Blended-Learning.pptx
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

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