resume/app/providers.php

60 lines
2.0 KiB
PHP

<?php
/*
* This file is part of Resume.PHP.
*
* (copyleft) R. Eric Wheeler <sikofitt@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Silex\Provider\CsrfServiceProvider;
use Silex\Provider\LocaleServiceProvider;
use Silex\Provider\TranslationServiceProvider;
use Silex\Provider\ValidatorServiceProvider;
$app->register(new \Sikofitt\Config\ConfigServiceProvider(), [
'config.path' => $app->getConfDirectory(),
]);
$app->setDebug();
if (null === $app->config('app.schema')) {
$app->config('app.schema', 'https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json');
}
$app->register(new \Silex\Provider\TwigServiceProvider(), [
'twig.path' => [
$app->getRootDirectory() . '/app/views',
],
]);
$app->register(new \Sikofitt\Json\JsonServiceProvider());
$app->register(new \Silex\Provider\AssetServiceProvider());
$app->register(new \Silex\Provider\MonologServiceProvider());
$app->register(new \Silex\Provider\SessionServiceProvider());
$app->register(new \Silex\Provider\HttpKernelServiceProvider());
$app->register(new \Silex\Provider\FormServiceProvider());
$app->register(new LocaleServiceProvider());
$app->register(new TranslationServiceProvider());
$app->register(new ValidatorServiceProvider());
$app->register(new CsrfServiceProvider());
$app->register(new \Silex\Provider\MonologServiceProvider(),
[
'monolog.logfile' => sprintf('%s/%s.log', $app->getLogDirectory(), $app['env']),
]
);
$app->register(new \Silex\Provider\RoutingServiceProvider());
$app->register(new \Silex\Provider\ServiceControllerServiceProvider());
$app->register(new \Silex\Provider\HttpFragmentServiceProvider());
if ($app['debug'] || 0 === strcasecmp($app['env'], 'dev')) {
$app->register(new \Silex\Provider\WebProfilerServiceProvider(), [
'profiler.cache_dir' => $app->getDataDirectory() . '/cache/profiler',
]);
$app->register(new \WhoopsSilex\WhoopsServiceProvider());
$app->register(new \Silex\Provider\VarDumperServiceProvider());
}