Top Banner
Intro to Micro-frameworks Jake Smith Dallas PHP - 4/12/2011 Thursday, April 14, 2011
34

Intro to Micro-frameworks

Jan 19, 2015

Download

Technology

jsmith92

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.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Intro to Micro-frameworks

Intro to Micro-frameworksJake SmithDallas PHP - 4/12/2011

Thursday, April 14, 2011

Page 2: Intro to Micro-frameworks

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

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

What is a Micro-framework?

• Simple, no full stack bloat

• Single Page (usually)

Thursday, April 14, 2011

Page 5: Intro to Micro-frameworks

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

Why should I use it?

Thursday, April 14, 2011

Page 7: Intro to Micro-frameworks

Fishing with dynamite?

• Simple site built using ZF/Symfony/Cake

Thursday, April 14, 2011

Page 8: Intro to Micro-frameworks

Small Sites

• Landing Page

• Micro Site

• Quiz/Campaign

• API

• Prototyping/Proof of Concept

Thursday, April 14, 2011

Page 9: Intro to Micro-frameworks

Legacy of Sinatra

Thursday, April 14, 2011

Page 10: Intro to Micro-frameworks

No...This Sinatra

require 'sinatra'get '/hi' do "Hello World!"end

Thursday, April 14, 2011

Page 11: Intro to Micro-frameworks

Sinatra Background

• Minimalist

• Extensible

• Sinatra is not Rails

Thursday, April 14, 2011

Page 12: Intro to Micro-frameworks

PHP Micro-frameworks

Thursday, April 14, 2011

Page 13: Intro to Micro-frameworks

Minimum

Thursday, April 14, 2011

Page 15: Intro to Micro-frameworks

Minimum App

Thursday, April 14, 2011

Page 16: Intro to Micro-frameworks

Minimum Pros

• Built using lithium

• Simple to get started

• Filters

Thursday, April 14, 2011

Page 17: Intro to Micro-frameworks

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

Silex

Thursday, April 14, 2011

Page 19: Intro to Micro-frameworks

Silex Profile

• http://silex-project.org/

• PHP: 5.3.x

Thursday, April 14, 2011

Page 20: Intro to Micro-frameworks

Silex App

Thursday, April 14, 2011

Page 21: Intro to Micro-frameworks

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

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

Limonade

Thursday, April 14, 2011

Page 24: Intro to Micro-frameworks

Limonade Profile

• http://www.limonade-php.net/

• PHP: 5.1.x

Thursday, April 14, 2011

Page 25: Intro to Micro-frameworks

Limonade App

Thursday, April 14, 2011

Page 26: Intro to Micro-frameworks

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

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

Slim

Thursday, April 14, 2011

Page 29: Intro to Micro-frameworks

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

Slim App

Thursday, April 14, 2011

Page 31: Intro to Micro-frameworks

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

Slim Cons

• Requires mcrypt for signed sessions

• Needs more exception handling, unwritable logs directory

Thursday, April 14, 2011

Page 33: Intro to Micro-frameworks

Questions? Concerns?

Thursday, April 14, 2011

Page 34: Intro to Micro-frameworks

Thanks for listeningContact Information[t]: @jakefolio[e]: [email protected][w]: http://www.jakefolio.com[irc]: #dallasphp

Thursday, April 14, 2011