Skip to content

Instantly share code, notes, and snippets.

@tjamps
tjamps / README.md
Last active February 29, 2024 14:57
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

@harikt
harikt / composer.json
Last active April 27, 2016 11:38 — forked from nikic/routing_bench.php
Fast router benchmark with aura and symfony
{
"require": {
"aura/router":"2.0.*@dev",
"symfony/routing": "3.0.*@dev",
"nikic/fast-route": "dev-master"
}
}
@nikic
nikic / routing_bench.php
Created February 17, 2014 11:46
Microbenchmark between Pux and FastRoute
<?php
error_reporting(E_ALL);
require __DIR__ . '/FastRoute/src/bootstrap.php';
spl_autoload_register(function ($class) {
require __DIR__ . '/Pux/src/' . strtr($class, '\\', '/') . '.php';
});