Download the PHP package c9s/roller without Composer

On this page you can find all versions of the php package c9s/roller. 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 roller

Roller

PHP Roller is a simple/fast router for PHP.

Roller compiles your routes into a simple array to store routes, therefore it's fast.

Beyond that, Roller provides an extension to improve more performance for you.

Build Status

FEATURES

Benchmark

ROUTE CONSOLE DUMPER

INSTALL

Install from Composer:

Install through PEAR:

pear channel-discover pear.corneltek.com
pear install corneltek/Roller

Or clone this repository:

pear install -f package.xml

Use thie library as a git submodule: clone this repository, pick up a PSR-0 classloader, and add src/ to class path.

To use console dumper, you need ezc/ConsoleTools, please use PEAR installer to install:

pear channel-discover components.ez.no
pear install -a ezc/ConsoleTools

SYNOPSIS

Roller router provides a simple DSL for you to declare sinatra-like routes:

More usage:

Initialize a router:

Add a new route with simple callback

Add a new route with class callback

Add a new route with class/action callback string:

To add a new route with requirement:

To add a new route with requirement and closure:

Or by any:

An alias for GET method:

An alias for POST method:

META ATTRIBUTE

Roller currently supports: method, default, requirement, post, get attributes.

To add a new route with requirement and default value:

To add a new route with request method (like POST method):

RouteSet

RouteSet is a route collection class, you can mount a route set to another route set.

To use RouteSet is very easy:

Mount paths

To mount route set:

Dispatch

To dispatch path:

To evalulate response content:

Customize Route Class

Use Annotation Reader for controllers

Cache

To enable apc cache:

To enable file cache:

RESTful interface

Roller Router has a built-in RESTful route generator, it's pretty easy to define a bunch of RESTful routes, Roller Router also provides a simple RESTful route generator, which is pretty easy to customize your own RESTful routes.

First, initalize a RESTful plugin object:

Add RESTful plugin to your router manager:

To support RESTful, you have two solutions:

To use ResourceHandler, register your resource id to router with your resource handler class name, each resource id is mapping to an resource handler:

Define your resource handler, here is a simple blog example that defines how RESTful CRUD works:

For the status code, see the list below:

Before you dispatch URLs, router object calls the expand method of ResourceHandler class, which generates RESTful routes into the routeset of router object. And below is the generated URLs:

GET /restful/blog        - get blog list
GET /restful/blog/:id    - get one blog record
POST /restful/blog       - create one blog record
PUT /restful/blog/:id    - update one blog record
DELETE /restful/blog/:id - delete one blog record

You can override the expand method to define your own style RESTful URLs.

Now you should be able to dispatch RESTful urls:

Customize Resource Handler

Here is how RESTful route generator works:

To define your own RESTful Resource Handler (Generator), you can simply inherit class from Roller\Plugin\RESTful\ResourceHandler:

.htaccess File for Apache

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ your_router.php/$1 [NC,L]

Install Extension

$ cd extension
$ phpize 
$ ./configure 
$ make && make install

Add config to your php.ini:

Hacking

Run Composer Install:

composer install --dev

Install ConsoleTools:

pear channel-discover components.ez.no
pear install -a ezc/ConsoleTools

Get Onion and install it:

$ curl -s http://install.onionphp.org/ | bash

Run onion to install depedencies:

$ onion install

Now you should be able to run phpunit =)

$ phpunit tests

TODO


All versions of roller with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
doctrine/common Version ~2.3
corneltek/serializerkit Version ~1
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 c9s/roller contains the following files

Loading the files please wait ....