2017 © Pedro Peláez
 

library rest

Simple REST crud server.

image

gonzalo123/rest

Simple REST crud server.

  • Thursday, December 27, 2012
  • by gonzalo123
  • Repository
  • 1 Watchers
  • 2 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Simple REST crud server., (*1)

Build Status, (*2)

model objects will share the interface:, (*3)

<?php

namespace Rest;

use \Symfony\Component\HttpFoundation\Request;

interface Iface
{
    public function __construct($id, \PDO $pdo);

    public function get();

    public function delete();

    public function update(Request $request);

    public function create(Request $request);

    public static function getAll(Request $request);
}

initialize the server mapping the model to the real class names:, (*4)

<?php
// index.php
use Rest\App;

$app = App::create(new \PDO('sqlite::memory:'));

$app->register('dogs', '\App\Dogs');
$app->register('cats', '\App\Cats');

$app->getResponse()->send();

The server will handle GET request to get(), DELETE to delete(), POST to update() and CREATE to create()., (*5)

If we perform a GET request without id (null) then the static getAll is raised, (*6)

The Versions

27/12 2012

dev-master

9999999-dev https://github.com/gonzalo123/rest

Simple REST crud server.

  Sources   Download

MIT

The Requires

 

rest crud http