2017 © Pedro Peláez
 

library raframework

A RESTful API framework

image

raframework/raframework

A RESTful API framework

  • Wednesday, April 4, 2018
  • by raframework
  • Repository
  • 3 Watchers
  • 5 Stars
  • 28 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

raframework

A RESTful API framework for the PHP language., (*1)

Getting Started

  1. Create a raframework project name raproj, (*2)

    $ mkdir raproj && cd raproj
    
  2. Create a composer.json file with the following contents:, (*3)

    {
      "require": {
        "raframework/raframework": "0.0.10"
      },
      "autoload": {
        "psr-4": {
          "App\\": "App/"
        }
      }
    }
    
  3. Install the raframework by Composer, (*4)

    $ composer install
    
  4. Make the resource classes directory, (*5)

    $ mkdir -p App/Resource
    
  5. Create an App/Resource/Users.php file with the following contents:, (*6)

    <?php
    
    namespace App\Resource;
    
    
    use Ra\Http\Request;
    use Ra\Http\Response;
    
    // Define resource's class.
    class Users
    {
        // Define the resource's action.
        public function lis(Request $request, Response $response)
        {
            $data = 'List users...';
            $response->withStatus(200)->write($data);
        }
    }
    
  6. Create an index.php file with the following contents:, (*7)

    <?php
    
    require 'vendor/autoload.php';
    
    // Define the routes.
    $uriPatterns = [
        '/users' => ['GET'], // uri pattern => supported methods
    ];
    
    // Create a raframework app with the routes given.
    $app = new Ra\App($uriPatterns);
    
    // Match the route, and set the resource's action correctly.
    $app->matchUriPattern()
    
    // Call the resource's action.
    // You should call matchUriPattern() before this.
    ->callResourceAction()
    
    // Send the response to the client.
    ->respond();
    
  7. You may quickly test this using the built-in PHP server:, (*8)

    $ php -S localhost:8800
    

    Going to http://localhost:8800/users will now display "List users..."., (*9)

The Versions

04/04 2018

dev-master

9999999-dev

A RESTful API framework

  Sources   Download

The Requires

  • php >=5.4.0

 

04/04 2018

v0.0.13

0.0.13.0

A RESTful API framework

  Sources   Download

The Requires

  • php >=5.4.0

 

04/04 2018

v0.0.12

0.0.12.0

A RESTful API framework

  Sources   Download

The Requires

  • php >=5.4.0

 

01/03 2017

v0.0.11

0.0.11.0

A RESTful API framework

  Sources   Download

The Requires

  • php >=5.4.0

 

28/02 2017

v0.0.10

0.0.10.0

A RESTful API framework

  Sources   Download

The Requires

  • php >=5.4.0

 

28/02 2017

v0.0.9

0.0.9.0

A RESTful API framework

  Sources   Download

The Requires

  • php >=5.4.0

 

25/02 2017

v0.0.8

0.0.8.0

A RESTful API framework

  Sources   Download

The Requires

  • php >=5.4.0

 

22/01 2017

v0.0.7

0.0.7.0

A RESTful API framework

  Sources   Download

The Requires

  • php >=5.4.0

 

08/12 2016

v0.0.6

0.0.6.0

A RESTful API framework

  Sources   Download

The Requires

  • php >=5.3.0

 

07/11 2016

v0.0.5

0.0.5.0

A RESTful API framework

  Sources   Download

The Requires

  • php >=5.3.0

 

31/10 2016

v0.0.4

0.0.4.0

A RESTful API framework

  Sources   Download

The Requires

  • php >=5.3.0

 

20/10 2016

v0.0.3

0.0.3.0

A RESTful API framework

  Sources   Download

The Requires

  • php >=5.3.0

 

05/05 2016

v0.0.2

0.0.2.0

A RESTful API framework

  Sources   Download

The Requires

  • php >=5.3.0

 

12/01 2016

v0.0.1

0.0.1.0

A RESTful API framework

  Sources   Download

The Requires

  • php >=5.3.0