mirror of
https://gitnet.fr/deblan/gist.git
synced 2021-08-14 08:30:49 +02:00
51d736cb1a
"GistService" renamed as "Gist" Authentication
27 lines
674 B
PHP
27 lines
674 B
PHP
<?php
|
|
|
|
use Symfony\Component\Routing\Loader\YamlFileLoader;
|
|
use Gist\ControllerResolver;
|
|
|
|
$app['routing.file'] = 'routing.yml';
|
|
|
|
$app['routing.loader'] = $app->share(function ($app) {
|
|
return new YamlFileLoader($app['config.locator']);
|
|
});
|
|
|
|
$app['routes'] = $app->extend('routes', function ($routes, $app) {
|
|
$routes->addCollection($app['routing.loader']->load($app['routing.file']));
|
|
|
|
return $routes;
|
|
});
|
|
|
|
$app['resolver'] = $app->share(function () use ($app) {
|
|
if (isset($app['logger'])){
|
|
$logger = $app['logger'];
|
|
} else{
|
|
$logger = null;
|
|
}
|
|
|
|
return new ControllerResolver($app, isset($app['logger']) ? $app['logger'] : null);
|
|
});
|