Short List of RESTful API Frameworks for PHP

Short List of RESTful API Frameworks for PHP

Kin Lane, September 23rd, 2011

Having a web API is an essential part of doing business online today.  We wanted to help get you started. So we took some time to pull together a list of the RESTful or RESTish (however you choose to view it) API frameworks, that can help you deploy your API faster.

Today we are going to take a look at seven RESTful API frameworks for PHP:

Dave - DAVE is a minimalist, multi-node, transactional API framework written in PHP. which contains an end-to-end API test suite for TDD, a Task model, an Active Database Model, and a stand-alone development server to get you started.  DAVE is an acronym that stands for Delete, Add, Edit, and View. These 4 methods make up the core functionality of many transactional web applications. The DAVE API aims to simplify and abstract may of the common tasks that these types of APIs require.

Epiphany – A micro PHP framework that’s fast, easy, clean and RESTful. The framework does not do a lot of magic under the hood. It is, by design, very simple and very powerful. The documentation provides a few conventions that will lead to well better code, but you’re free to use any style you’d like.  According to Epiphany,  the framework never dictates how you should write or structure your application.

FRAPI - FRAPI is a  high-level API framework that powers web apps, mobiles services and legacy systems, enabling a focus on business logic and not the presentation layer.  FRAPI handles multiple media types, response codes and generating API documentation. FRAPI was originally built by echolibre to support the needs of their client’s web apps, and now it’s been open-sourced.

Recess - Recess is a RESTful PHP framework that can be used by both beginner and seasoned developers. Recess is fast, light-weight, and has a very small footprint—ideal for LAMP development and drag-and-drop deployment to shared hosts. Recess is a modern framework that uses a loosely-coupled Model-View-Controller architecture designed and optimized specifically for PHP 5.

Slim - What began as a weekend project became a simple yet powerful PHP 5 framework to create RESTful web applications. The Slim micro framework is everything you need and nothing you don’t. Slim lets you build a complete PHP web service with only a single PHP file. Features include: RESTful routing, Named routes, Route passing, Route redirects, Route halting, Custom views, HTTP caching, Signed cookies, Custom 404 page, Custom 500 page, Error handling and Logging.

TonicTonic is an open source less is more, RESTful Web application development PHP library, where everything useful is a resource, not a file, not a CGI script, a resource, an abstract concept of something useful that the client wants to grab hold of.  Resources are located by URLs, URLs are cheap and form the universal addressing system of the Web.  Tonic helps you develop Web applications that embrace the way the Web really works, enabling your applications to scale, extend and work with other systems easily.

Zend FrameworkZend_Rest_Server is intended as a fully-featured REST server.  To call a Zend_Rest_Server service, you must supply a GET and POST methods, with a value that is the method you wish to call. You can then follow that up with any number of arguments using either the name of the argument or using arg following by the numeric position of the argument. When returning values, you can return a custom status, you may return an array with each status.

There are a number of Web and MVC frameworks out there that will also deliver a RESTful API, but the above frameworks focus more towards just delivering a RESTful API.

If you know of any RESTful API framework written in PHP that you’d recommend, please let us know.

Comments [0]

10 Tools to Protect Computer from Infected USB Flash Drives

Media_httpmedia02hong_lunca

If the USB flash drive is infected with virus, not only you may lose the data in the storage, you are also affecting the security of every computer once it’s plugged in. The following post features a list of 10 tools to protect your computer against any infected USD flash drives.

Comments [0]

Plugin Cross-Domain-Ajax - Extends the Ajax Abilities of jQuery with the YQL Technique

Chris Heilmann recently posted on how to use YQL to make cross-domain requests, which would usually be prohibited due to the same-domain-policy. I already knew about YQL, but I had no idea that it allowed retrieval of HTML from other sites, via JSON, returned as a single string!

Instead of asking for JSON format, ask for XML, but also add a callback parameter to your query. Voila!

So, in short, YQL allows us to make cross-domain GET requests!

Chris also posted a demo!

With a bit of hacking, we can make jQuery work with YQL for all cross-domain GET requests. UPDATE: I’ve decided to put this in my “jQuery Plugins” repo at Github:

Cross-Domain Ajax mod @ Github

With this mod, any GET request made via jQuery.ajax to another domain will work!

$('#container').load('http://google.com'); // SERIOUSLY!
 
$.ajax({
    url: 'http://news.bbc.co.uk',
    type: 'GET',
    success: function(res) {
        var headline = $(res.responseText).find('a.tsh').text();
        alert(headline);
    }
});
 
// Works with $.get too!

Have fun!

Comments are closed for this post.

Comments [0]

Swiffy tries to convert Flash SWF files to HTML5 (Google Labs)

Swiffy allows you to reuse Flash content on devices without a Flash player (such as iPhones and iPads). But not every ActionScript method is supported.

Comments [0]

Microjs: Fantastic Micro-Frameworks and Micro-Libraries for Fun and Profit!

Fantastic Micro-Frameworks and
Micro-Libraries for Fun and Profit!

How much library code do you really need — 50K? 100K? 150K? More? How much of that do you really use?

Sure, we all love our favorite monolithic frameworks, and sometimes we even use them fully. But how often do we reach for the ride-on John Deere tractor with air conditioning and six-speaker sound system, when a judiciously applied pocketknife would do the trick better, faster, slicker?

Micro-frameworks are definitely the pocketknives of the JavaScript library world: short, sweet, to the point. And at 5k and under, micro-frameworks are very very portable. A micro-framework does one thing and one thing only — and does it well. No cruft, no featuritis, no feature creep, no excess anywhere.

Microjs.com helps you discover the most compact-but-powerful microframeworks, and makes it easy for you to pick one that’ll work for you.

Want to add your own? Fork this site on GitHub, add your framework to data.js and submit a pull request.

Can't get enough?

140byt.es provides tweet-sized JavaScript goodness!

Comments [1]

Full Drupal-based Conference or Event Site with COD | Conference Organizing Distribution

Media_httpusecodcomsi_bumzd

Create a full Drupal-based conference or event site with COD in much less time than it would take to build from scratch.

Comments [0]