Download the PHP package luracast/restler without Composer

On this page you can find all versions of the php package luracast/restler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package restler

Luracast Restler

Gitter Latest Stable Version Total Downloads Latest Unstable Version License

Version 5

upgraded from version 3 RC6 for latest PHP support

Restler is a simple and effective multi-format Web API Server written in PHP.

Just deal with your business logic in php, restler will take care of the REST!

Restler - Better APIs by Design

Features

Git Repository and the Branches

  1. Most stable and recent version is at the master branch, previous versions are in the version branches such as v4, v3, v2, and v1.

  2. Version branch with the current version such as v5 is used for building up the next release. It's documentation may not be updated frequently and thus reserved for the daring ones.

  3. Feature branches such as features/html and features/router are purely for experimentation purpose to try out a feature. They may be merged when ready.

Test Drive

Install this repository to try out the examples.

Make sure PHP 5.4 or above is available on your server. We recommended using the latest version for better performance.

1. Install Composer

Restler uses Composer to manage its dependencies. First, download a copy of composer.phar. It can be kept in your project folder or ideally in usr/local/bin to use it globally for all your projects. If you are on Windows, you can use the composer windows installer instead.

2. Install Restler

Option 1. Using composer create-project

You may install Restler by running the create project command in your terminal. Replace {projectName} with your actual project name. It will create a folder with that name and install Restler.

Note:-

  1. If you do not want the additional formats and BDD tools you can include --no-dev to enforce exclusion of dev packages.

  2. If you want to try the bleading edge v3 branch or any of the feature branches include 3.x-dev or dev-features/html in the above command

Option 2. Downloading from GitHub

After installing Composer, download the [latest version]() of the Restler framework and extract its contents into a directory on your server. Next, in the root of your Restler project, run the php composer.phar install (or composer install) command to install all the framework's dependencies. This process requires Git to be installed on the server to successfully complete the installation.

If you want to update the Restler framework, you may issue the php composer.phar update command.

Note:- If you are not allowed to install composer and git on your server, you can install and run them on your development machine. The resulting files and folders can be uploaded and used on the server.

3. Configure

Ideally public folder should be mapped as your web root, It is optional, but recommended avoiding exposing unneeded files and folders.

4. Try it out

Try the live examples in your localhost.

You may launch the PHP's built-in server with composer serve command.

5. Run some test

Update the base_url specified in behat.yml and then try the following command

alternatively you can run composer test

This will test the examples against the behaviors expected, for example

All set, Happy RESTling! :)

Quick Start Guide

We have two options to create your own restler api server

  1. Most convenient option is using application templates such as Restler Application which has integrations with many packages to help us with the business logic as well. If you choose this option, select a branch in that repository and proceed with the instructions available there.

  2. Create a project from scratch so that you have full control over every aspect of your application. If you choose this option, follow along with the steps below.
    • create a folder to hold your project and open it in the terminal.
    • run composer init and follow along to create composer.json
    • when it is asking for dependencies, type restler/framework and ^5 for the version constraint.
    • alternatively, you can leave it blank and create the composer.json first and then run composer require restler/framework:^5

we are using restler/framework instead of luracast/restler to reduce the space required for the package. It is coming from https://github.com/Luracast/Restler-Framework it contains only the contents of src folder here.

Even when you are building from scratch, checking out the application templates will help with folder structure decisions and finding other useful packages.

1. Write API

Create your API classes with all needed public and protected methods

2. Open the Gateway

Create the gateway (public/index.php) as follows

3. Prettify URLs

Enable URL Rewriting

Make sure all the requests go to index.php by enabling URL Rewriting for your website

For example:-

If you are on Apache, you can use an .htaccess file such as

Note:- This requires AllowOverride to be set to All instead of None in the httpd.conf file, and might require some tweaking on some server configurations. Refer to mod_rewrite documentation for more info.

If you are on Nginx, you have to make sure you set the server_name and pass the PHP scripts to fast cgi (PHP-FPM) listening on 127.0.0.1:9000

Note:- This requires PHP, PHP-FPM to be properly installed and configured. Refer to PHP FastCGI example for more info.

4. Customise

Fine tune to suit your needs

Explore the api and try it out by openings explorer/index.html from the web root on your browser

Happy Exploring! :)

Note:- Using eAccelerator can make restler to fail as it removes the comments. More info can be found here

5. Annotate

Restler supports annotations in the form of PHPDoc comments for API fine tuning

They are documented in detail under Annotations

6. Authorize

In order to protect your api, authenticate and allow valid users

7. Start Production

By default Restler runs in debug mode more fine tuned for API developer, by showing detailed error messages and prettifying the api result to human readbale form

By turning on production mode you will gain some performance boost as it will cache the routes (comment parsing happens only once instead of every api call), few other files and avoid giving out debug information

Note:- When production mode is set to true it always uses the cache and does not detect changes and new routes if any. Your continuous integration pipeline or your git hook should delete this file during the deployment process. Alternatively you can pass second parameter to restler constructor to refresh the cache when changes need to be applied.

Change Log

Restler 5

Restler 3.0 RC6

What's new

Improvements


All versions of restler with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package luracast/restler contains the following files

Loading the files please wait ....