A libraty to control route for HTTP request., (*1)
Installation
Composer (https://getcomposer.org/) and (https://packagist.org/), (*2)
composer require helionogueir/routing
Usage
helionogueir\routing\route\Factory
Load route.json file and construct a "helionogueir\routing\Route" object, (*3)
use helionogueir\routing\route\Factory;
$namespace = "path/to/request";
$directory = "./routing/tests";
$route = Factory::byFile($namespace, $directory);
helionogueir\routing\server\Autoload
Define a new role for spl_autoload_register, (*4)
use helionogueir\routing\server\Autoload;
(new Autoload())->registerRoot("./routing/core");
helionogueir\routing\Route
Construct a new "helionogueir\routing\Route" object, (*5)
use helionogueir\routing\Route;
$request = "route";
$className = "helionogueir\\routing\\server\\Autoload";
$method = "registerRoot";
$route = new Route($request, $className, $method);
$className = $route->getClassName();
(new $className())->{$route->getMethod()}("./routing/core");
TDD (Test Driven Development)
PHPUnit (https://phpunit.de/), (*6)
phpunit -c ./routing/tests/unit.xml