Intro to Micro-frameworks

Post on 19-Jan-2015

3.614 views 4 download

Tags:

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 of Intro to Micro-frameworks

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

Thursday, April 14, 2011

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

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

What is a Micro-framework?

• Simple, no full stack bloat

• Single Page (usually)

Thursday, April 14, 2011

What to expect

• Routing

• HTTP Request/Response

• RESTful

• Template Engine or choice of none

• Helpers and extensions

Thursday, April 14, 2011

Why should I use it?

Thursday, April 14, 2011

Fishing with dynamite?

• Simple site built using ZF/Symfony/Cake

Thursday, April 14, 2011

Small Sites

• Landing Page

• Micro Site

• Quiz/Campaign

• API

• Prototyping/Proof of Concept

Thursday, April 14, 2011

Legacy of Sinatra

Thursday, April 14, 2011

No...This Sinatra

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

Thursday, April 14, 2011

Sinatra Background

• Minimalist

• Extensible

• Sinatra is not Rails

Thursday, April 14, 2011

PHP Micro-frameworks

Thursday, April 14, 2011

Minimum

Thursday, April 14, 2011

Minimum App

Thursday, April 14, 2011

Minimum Pros

• Built using lithium

• Simple to get started

• Filters

Thursday, April 14, 2011

Minimum Cons

• More of a Proof of Concept

• No documentation, besides that of Lithium

• Limited feature set

Thursday, April 14, 2011

Silex

Thursday, April 14, 2011

Silex Profile

• http://silex-project.org/

• PHP: 5.3.x

Thursday, April 14, 2011

Silex App

Thursday, April 14, 2011

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

Silex Cons

• Utilizing Service Container can be good, but gets complex quick

• Built using Symfony2 libraries

Thursday, April 14, 2011

Limonade

Thursday, April 14, 2011

Limonade Profile

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

• PHP: 5.1.x

Thursday, April 14, 2011

Limonade App

Thursday, April 14, 2011

Limonade Pros

• Longevity

• Isn’t PHP 5.3 only

• Actively updated

• Plenty of helper functions

• txt, html, json, etc.

Thursday, April 14, 2011

Limonade Cons

• Not OOP

• Syntax is not as clean

• Not using PHPUnit for Unit Testing

Thursday, April 14, 2011

Slim

Thursday, April 14, 2011

Slim Profile

• http://www.slimframework.com/

• PHP 5.1.x

• Uses Closures if 5.3.x

Thursday, April 14, 2011

Slim App

Thursday, April 14, 2011

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

Slim Cons

• Requires mcrypt for signed sessions

• Needs more exception handling, unwritable logs directory

Thursday, April 14, 2011

Questions? Concerns?

Thursday, April 14, 2011

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

Thursday, April 14, 2011