background preloader

PHP Restful Frameworks

Facebook Twitter

Limonade - PHP micro-framework. Examples and tutorials · sofadesign/limonade Wiki. A RESTful Chinchilla website. Ijoey/Chinchilla. Apify. Building a RESTful Web API with PHP and Apify. Apify is a small and powerful open source library that delivers new levels of developer productivity by simplifying the creation of RESTful architectures.

Building a RESTful Web API with PHP and Apify

You can see it in action here. Web services are a great way to extend your web application, however, adding a web API to an existing web application can be a tedious and time-consuming task. Apify takes certain common patterns found in most web services and abstracts them so that you can quickly write web APIs without having to write too much code. Apify exposes similar APIs as the Zend Framework, so if you are familiar with the Zend Framework, then you already know how to use Apify. Take a look at the UsersController class. Building a RESTful Web API In Apify, Controllers handle incoming HTTP requests, interact with the model to get data, and direct domain data to the response object for display.

Creating a RESTful Web API with Apify is easy. The response object describes the status code and any headers that are sent. Request. REST implementation for CodeIgniter. I have seen 1 or 2 RESTful implementations for CodeIgniter but the syntax and methodology for each of them left me feeling like it could be done better.

REST implementation for CodeIgniter

Firstly, REST is not something that can be put into a library. It is not a "thing" and cannot be treated as such. Secondly, REST calls should not be mixed in with your normal controllers. It should be kept separate from your normal controllers as they are not the same. The default behavior should be slightly different as REST calls are not simple GET -> output.

Thirdly, REST controllers need to remain flexible. Finally, REST controllers should be able to output the response in many number of formats. Via the $_SERVER['HTTP_ACCEPT'] variable. Working with RESTful Services in CodeIgniter. CodeIgniter is becoming well known for its power as a PHP based web application framework, but it's not often that we see examples of it being used for anything else.

Working with RESTful Services in CodeIgniter

Today we'll learn how we can use CodeIgniter to create a RESTful API for your existing web applications, and demonstrate how to interact with your own API or other RESTful web-services, such as Facebook and Twitter. Program: CodeIgniter, CodeIgniter REST server and CodeIgniter REST client Difficulty: MediumEstimated Completion Time: 30 minutes If you have been following the CodeIgniter From Scratch series you will know by now that it is relatively quick and easy to put together simple web applications, such as blogs, CMS systems, brochure sites, etc. One thing you may not have thought about is using CodeIgniter to create an interactive API.

This tutorial is broken down into two parts. Firstly you need to download the codeigniter-restserver code from GitHub and extract it and move the code to your server. Philsturgeon/codeigniter-restserver. Philsturgeon/codeigniter-restclient. Konstrukt. FRAPI: The Developers Handbook. Recess PHP Framework. The Book of Recess. Recess/recess. Starting a New Application: Hello World.

Today's post is a quick, simple tutorial for kicking off a new Recess Application.

Starting a New Application: Hello World

We'll start with the automated New App Wizard in Recess Tools, and then we’ll walk through step-by-step what this wizard has done to set up a new application. The New App Wizard in Recess Tools To stay true to programming pedagogy let’s create a dynamic “Hello World!” Application. Lets open up Recess Tools in a browser by navigating to the directory you installed recess to, /recess. The wizard kicks off by asking us for two names, first a human readable name. Next we’ll select a URL prefix for the application.

At this point the wizard will generate a directory structure and some files that form the skeleton of an application. Open your recess-conf.php file and find the RecessConf::$applications array. After saving the recess-conf.php file we have finished installing our ‘Hello World’ application. When viewing an application in Recess Tools we can see the Models, Controllers, Views, and Routes. Jacwright/RestServer. Missinglink/Insomnia. Epiphany/docs/Route.markdown at master · jmathai/epiphany. Crear servicios RESTFul con Epiphany Framework y PHP. Comparte este artículo!

Crear servicios RESTFul con Epiphany Framework y PHP

Epiphany es un “micro” framework rápido, claro y de fácil uso para crear servicios RESTful usando PHP. Es muy simple pero muy poderoso a la vez, permite a los desarrolladores crear servicios REST en muy poco tiempo.Epiphany es un proyecto open source que podemos descargar desde GitHub, para comenzar a usarlo debemos obviamente tener instalado PHP5+ y mod_rewrite en nuestro servidor Apache. Comenzar con Epiphany es realmente fácil, primero instalamos el framework descomprimiendo el archivo que descargamos previamente en una carpeta (por ejemplo: /testepiphany ) en nuestro servidor y con eso estaríamos en condiciones de comenzar a trabajar y probarlo. En el sitio contamos con muy buena documentación y ejemplos, así que veamos uno completo y funcional, para eso debemos crear un archivo index.php Además, debemos agregar en nuestro directorio de trabajo un archivo .htaccess que redirecciona todos los request hacia nuestro index.php.

Tonic: A RESTful Web App Development PHP Library. Tonic is an open source less is more, RESTful Web application development PHP library designed to do things "the right way", where resources are king and the library gets out of the way and leaves the developer to get on with it.

Tonic: A RESTful Web App Development PHP Library

To understand Tonic, you need to get the Web, so forget everything you know for a minute and think about how the Web really works, it's not about HTML pages, it's about resources: 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. Clients can issue a standard number of HTTP methods upon an infinite number of resources and receive something useful in return. Introducing the RMR Web Architecture. I talk a lot to people about REST, but with the acronym having become a commonplace among Web folk, I often find myself having to explain that what they have read about as REST or think of as REST is actually POX, HTTP-RPC or whatever you want to call it.

Introducing the RMR Web Architecture

I'm also an advocate of the idea that REST isn't just about "Web services" but is also a good model for building fast sustainable Web applications. As such, in my quest to educate the ideas of REST, today I want to outline a different way to build Web apps, a RESTful way, an alternative to the popular MVC model, a model I call RMR, or Resource-Method-Representation. Model-View-Controller The current popular way of building Web applications is using the MVC pattern. This pattern separates the application into three parts: The Model models your business objects, the "things" in your application, wrapping up data handling and logic. It just doesn't model resources, the fundamental element of the Web is totally ignored. Resource Method. MVC Obscures the Mechanics of the Web. 24 September 2007 by Ian Davis I dug up some links on the mismatch between MVC and the Web: It’s hard to explain in simple terms why MVC is such a poor pattern for web development.

MVC Obscures the Mechanics of the Web

I don’t claim any particular success in converting people away from the lure of GUI patterns but in my experience the hardest task is resetting people’s internal model of a web “application”. MVC works pretty well in the traditional GUI where you might have an item (e.g. a document) that you wrap with a model and expose with different views (as an icon and label in a treeview, a larger icon in a window, an editable word processing view, a print preview with different font metrics, a thumbnail presented when the mouse hovers over the icon).

But the Web isn’t so complex. Restler: Expose your business objects as REST end-points in JSON,XML,PLIST... for mobile/web/desktop app. Questions containing 'php restler' Luracast/Restler. Questions containing 'php slim' Say Hello World with Slim - Slim Framework for PHP 5. This tutorial demonstrates the typical process for writing a Slim Framework for PHP 5 web application.

Say Hello World with Slim - Slim Framework for PHP 5

The Slim Framework for PHP 5 uses the front controller pattern to send all HTTP requests through a single file — usually index.php. By default, Slim comes with a .htaccess file for use with the Apache web server. In the index.php file you require the Slim library file, define routes, and run the Slim application. Using The Slim PHP Framework for Developing REST APIs. There’s a neat little framework for Ruby called Sinatra that makes it simple to configure REST-style API endpoints with just a smidgen of glue code.

Using The Slim PHP Framework for Developing REST APIs

But why, asked PHP developer Josh Lockhart, should Ruby devs have all the fun? Josh has been busy these past few months creating his own PHP-based REST DSL (Domain-Specific Language) called Slim. Slim has a minimal code footprint (hence its name), is easy to configure, and simple to use. With just a touch of additional code, you can wire up your existing PHP functions to return data in response to a URL request. In this post, I’ll demonstrate how to install and configure Slim, create an endpoint that performs a SELECT against an arbitrary MySQL table, and return the result in JSON format. Codeguy/Slim.