Download the PHP package hiraq/drapi without Composer

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

drapi

A framework to create and manage API (REST) services

Build Status Coverage Status Latest Stable Version Total Downloads project status

usage

Put this codes in your index.php file.

<?php
require_once 'vendor/autoload.php';

use Drapi\Router;
use Drapi\Request as DrapiRequest;
use Drapi\Response as DrapiResponse;
use Drapi\Handler;
use Drapi\Compiler;

try {

    $router = new Router;
    $request = new DrapiRequest;
    $response = new DrapiResponse;
    $handler = new Handler;

    $compiler = new Compiler($router,$request,$response);
    $compiler->setHandlerNameSpace('Drapi\\Handler\\');
    $compiler->setHandler($handler);
    $compiler->compile();

} catch (Exception $e) {
    echo $e->getMessage();
}

Then try to open your browser, and go to

  1. http://localhost/myapi/test or http://localhost/myapi/test/get
  2. http://localhost/myapi/testing for failed data response example
  3. http://php.drapi/test/test_param?key1=val1&key2=val2 for GET parameters example

Drapi doesn't need any rewrite rules!

handler

A handler is class to manage and return a data from your datasource (MySQL,Postgre,Mongodb,etc).
Create a handler class inside Drapi/Handler, such as Users.php. Everytime your server get a API request based on: '/users/get', then your handler (Users.php) will be loaded and will use method get inside Users class. See Test.php inside Drapi/Handler for example.

plugin

A plugin is an extension for your handler class, create a class such as Mongo.php in Drapi/Handler/Plugin and load this class inside your handler class (autoload).

response

All Drapi response is a data formatted in json. If any request that fail to call a handler or maybe there are no valid data available, then Drapi will automatically give an error status and message.

license

Drapi is released under the BSD 3-Clause License. See LICENSE.txt file for details.


All versions of drapi with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
zendframework/zend-json Version >=2.2
zendframework/zend-uri Version >=2.2
zendframework/zend-http Version >=2.2
zendframework/zend-validator Version >=2.2
league/phpunit-coverage-listener Version ~1.0
monolog/monolog Version >=1.5.0
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 hiraq/drapi contains the following files

Loading the files please wait ....