intro to micro-frameworks
DESCRIPTION
Do you find yourself using full stack frameworks for small sites, but think it's overkill. Micro-frameworks could be your solution. Sinatra (Ruby) has popularized micro-frameworks, and we have many options in PHP. Jake Smith will introduce you to the current micro-frameworks in PHP and where they are best utilized.TRANSCRIPT
![Page 1: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/1.jpg)
Intro to Micro-frameworksJake SmithDallas PHP - 4/12/2011
Thursday, April 14, 2011
![Page 2: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/2.jpg)
Who is Jake?
• PHP 5.3 ZCE
• Co-Organizer of DallasPHP
• Co-Organizer of Lone Star PHP
• Your tour on this magical journey called Micro-frameworks
Thursday, April 14, 2011
![Page 3: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/3.jpg)
Introducing the first annualPHP Conference in North Texas
Join us for this day-long event and hear the best local speakers from the Lone Star State.
Register Now
$60 http://lonestarphp.com
Thursday, April 14, 2011
![Page 4: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/4.jpg)
What is a Micro-framework?
• Simple, no full stack bloat
• Single Page (usually)
Thursday, April 14, 2011
![Page 5: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/5.jpg)
What to expect
• Routing
• HTTP Request/Response
• RESTful
• Template Engine or choice of none
• Helpers and extensions
Thursday, April 14, 2011
![Page 6: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/6.jpg)
Why should I use it?
Thursday, April 14, 2011
![Page 7: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/7.jpg)
Fishing with dynamite?
• Simple site built using ZF/Symfony/Cake
Thursday, April 14, 2011
![Page 8: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/8.jpg)
Small Sites
• Landing Page
• Micro Site
• Quiz/Campaign
• API
• Prototyping/Proof of Concept
Thursday, April 14, 2011
![Page 9: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/9.jpg)
Legacy of Sinatra
Thursday, April 14, 2011
![Page 10: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/10.jpg)
No...This Sinatra
require 'sinatra'get '/hi' do "Hello World!"end
Thursday, April 14, 2011
![Page 11: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/11.jpg)
Sinatra Background
• Minimalist
• Extensible
• Sinatra is not Rails
Thursday, April 14, 2011
![Page 12: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/12.jpg)
PHP Micro-frameworks
Thursday, April 14, 2011
![Page 13: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/13.jpg)
Minimum
Thursday, April 14, 2011
![Page 14: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/14.jpg)
Minimum Profile
• http://jamalsa.tumblr.com/post/1521361137/lithify-it-like-sinatra
• PHP: 5.3.x
• Proof of Concept
Thursday, April 14, 2011
![Page 15: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/15.jpg)
Minimum App
Thursday, April 14, 2011
![Page 16: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/16.jpg)
Minimum Pros
• Built using lithium
• Simple to get started
• Filters
Thursday, April 14, 2011
![Page 17: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/17.jpg)
Minimum Cons
• More of a Proof of Concept
• No documentation, besides that of Lithium
• Limited feature set
Thursday, April 14, 2011
![Page 18: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/18.jpg)
Silex
Thursday, April 14, 2011
![Page 19: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/19.jpg)
Silex Profile
• http://silex-project.org/
• PHP: 5.3.x
Thursday, April 14, 2011
![Page 20: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/20.jpg)
Silex App
Thursday, April 14, 2011
![Page 21: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/21.jpg)
Silex Pros
• Great Documentation (just recently released)
• Easy to get started (PHAR)
• Unit Test Integration
• Built using Symfony2 libraries
• Easily extendable
Thursday, April 14, 2011
![Page 22: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/22.jpg)
Silex Cons
• Utilizing Service Container can be good, but gets complex quick
• Built using Symfony2 libraries
Thursday, April 14, 2011
![Page 23: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/23.jpg)
Limonade
Thursday, April 14, 2011
![Page 24: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/24.jpg)
Limonade Profile
• http://www.limonade-php.net/
• PHP: 5.1.x
Thursday, April 14, 2011
![Page 25: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/25.jpg)
Limonade App
Thursday, April 14, 2011
![Page 26: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/26.jpg)
Limonade Pros
• Longevity
• Isn’t PHP 5.3 only
• Actively updated
• Plenty of helper functions
• txt, html, json, etc.
Thursday, April 14, 2011
![Page 27: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/27.jpg)
Limonade Cons
• Not OOP
• Syntax is not as clean
• Not using PHPUnit for Unit Testing
Thursday, April 14, 2011
![Page 28: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/28.jpg)
Slim
Thursday, April 14, 2011
![Page 29: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/29.jpg)
Slim Profile
• http://www.slimframework.com/
• PHP 5.1.x
• Uses Closures if 5.3.x
Thursday, April 14, 2011
![Page 30: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/30.jpg)
Slim App
Thursday, April 14, 2011
![Page 31: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/31.jpg)
Slim Pros
• Amazing Documentation, but all on Github Pages
• Very active development, can talk with creator almost any time
• Works in 5.1.X, but utilizes closures
• Easy/Extensive template engine support
• Twig, Haanga, Smarty, Mustache, etc.
Thursday, April 14, 2011
![Page 32: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/32.jpg)
Slim Cons
• Requires mcrypt for signed sessions
• Needs more exception handling, unwritable logs directory
Thursday, April 14, 2011
![Page 33: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/33.jpg)
Questions? Concerns?
Thursday, April 14, 2011
![Page 34: Intro to Micro-frameworks](https://reader033.vdocuments.mx/reader033/viewer/2022051014/54bc01a04a7959f0138b457a/html5/thumbnails/34.jpg)
Thanks for listeningContact Information[t]: @jakefolio[e]: [email protected][w]: http://www.jakefolio.com[irc]: #dallasphp
Thursday, April 14, 2011