3

I want to start using Restler to develop a Rest api but, I couldn't find any detail information on how to install it, besides, it seems to run on a nginx server.

Is there a way to run this framework on apache? Are there other alternatives for building high quality APIS? Is there a detail documentation about installing this framework?

I must be able to run this framework on apache and using php5.3

Thanks

danielrvt
  • 10,177
  • 20
  • 80
  • 121

3 Answers3

2

I'm running restler (somewhat modified) for an API (api.hostingxs.nl). It works fine on apache with PHP 5.3. Just clone the repository from github (git clone https://github.com/Luracast/Restler.git <yourdirectory>) and start including classes that use it (read the manual).

If you need more directions I can post some sample code, but the basic functionality is really easy if you understand Object Oriented PHP.

First off, redirect all requests to your restler domain, folder to the index.php and create that file with something like this:

require_once( "restler.php" ); # or whatever you need to link to
$r = new Restler;
$r -> handle();
# above is the basic functionality without any of your own things

Click on the classes in the following link to read more about setting up your own classes; help.luracast.com/restler/examples/_002_minimal/readme.html

Luceos
  • 6,629
  • 1
  • 35
  • 65
  • Thanks man! If it isn't to much trouble it would great if you could post some sample code :) – danielrvt Aug 22 '12 at 14:28
  • 2
    I've been trying to test the examples Restler comes with, but I always get a URL not found error, even for the hello world example... – danielrvt Aug 22 '12 at 14:35
2

you have to enable apache mod_rewrite

2

If you're wanting to create a RESTful API, then I created a lightweight framework for exactly that: https://github.com/martinbean/api-framework

Martin Bean
  • 38,379
  • 25
  • 128
  • 201