Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Blitz Agency Blog:
REST Service Routing with PHP and Apache
Nov 19, 2010 @ 18:12:55

New on the Blitz Agency blog Adam Venturella walks you through his process of creating a simple REST service routing system with the PHP and Apache combination that has the same concepts as Sinatra routing.

This is just a quickie. I had spent some time creating a routing system in PHP for services. The goal was to bypass .htaccess or a vhost configuration file. Basically, I wanted to map endpoints (HTTP methods + paths) to PHP methods. My goal at the time was something similar to Sinatra and/or MVC2 routes.

He shows examples from both the Sinatra documentation and a code example from a MVC2 project that uses the same ideas. His first show with PHP proved to not quite be the right way, so he opted for a combination of Apache mod_rewrite and some PHP to take the mapped values and execute. It also includes support fo rthe "X-HTTP-Method-Override" header if you happen to need it.

tagged: rest sinatra routing apache tutorial

Link:

Staw Dogs Blog:
PHP Sinatra Clones
Nov 01, 2010 @ 16:14:30

From the Straw Dogs blog there's a recent post looking at some of the PHP frameworks out there have the same kind of philosophy behind them as the Sinatra framework for Ruby - a small, light framework that's easy to use.

I’m currently looking for a good PHP framework to do a new project. I recently used Kohana 3 at on a project for a client but I needed something lighter and having used Sinatra and Padrino previously but needing it PHP based I did the next natural step - searched for PHP Sinatra clones.

There's four frameworks that made the list - all in varying states of development:

tagged: sinatra clone framework lightweight small

Link:

Linux Magazine:
Micro-Frameworks: Big Things in Small Packages
May 11, 2009 @ 15:26:12

Martin Streicher has written up a new article for the Linux Magazine website looking at microframeworks - one in Ruby and the other in PHP (Limonade).

Indeed, the quality of Rails, CakePHP, Django, and Catalyst notwithstanding, some developers have rebuffed the large frameworks, citing bulk and complexity, to create smaller and simpler alternatives. Dubbed micro-frameworks—think microcomputer versus mainframe—the tools shape incoming requests into something manageable and leave the rest up to you. Choose your design pattern, object-relational mapper (ORM), and rendering technology, and off you go. As you’ll see, a working Web application can be composed in less than ten lines of code in a single source file.

He covers the Ruby framework first (Sinatra) and Limonade next. The framework takes incoming requests and maps them into the developed code. It works like a basic MVC-formatted framework - the request comes in with an action and is sent to a method by the same name. You can use wildcards in the URI, regular expression matching, views, templates and it includes error handling support and configuration option support.

tagged: microframework sinatra limonade mvc small light

Link:


Trending Topics: