mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 12:03:14 +00:00

Conflicts: lib/Alchemy/Phrasea/Controller/Admin/Publications.php lib/Alchemy/Phrasea/Controller/Admin/TaskManager.php lib/Alchemy/Phrasea/Controller/Api/V1.php lib/Alchemy/Phrasea/Controller/Lightbox.php lib/Alchemy/Phrasea/Controller/Permalink.php lib/Alchemy/Phrasea/Controller/Prod/Feed.php lib/Alchemy/Phrasea/Controller/Prod/Order.php lib/Alchemy/Phrasea/Controller/Prod/Push.php lib/Alchemy/Phrasea/Controller/Prod/Share.php lib/Alchemy/Phrasea/Controller/Root/Login.php lib/Alchemy/Phrasea/Controller/Root/RSSFeeds.php lib/Alchemy/Phrasea/Controller/Root/Session.php lib/Alchemy/Phrasea/Controller/Setup.php lib/Alchemy/Phrasea/Core/CLIProvider/LessBuilderServiceProvider.php lib/Alchemy/Phrasea/Core/Provider/ORMServiceProvider.php lib/Alchemy/Phrasea/Core/Provider/TaskManagerServiceProvider.php lib/classes/Feed/Entry/Item.php lib/classes/record/adapter.php lib/classes/task/Scheduler.php lib/classes/task/manager.php lib/classes/task/period/RecordMover.php lib/classes/task/period/archive.php lib/classes/task/period/cindexer.php lib/classes/task/period/ftp.php lib/classes/task/period/ftpPull.php lib/classes/task/period/subdef.php lib/classes/task/period/writemeta.php tests/Alchemy/Tests/Phrasea/Border/ManagerTest.php tests/Alchemy/Tests/Phrasea/Controller/Root/RSSFeedTest.php tests/classes/Feed/Entry/Feed_Entry_ItemTest.php tests/classes/PhraseanetPHPUnitAbstract.php
59 lines
2.0 KiB
PHP
59 lines
2.0 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Phraseanet
|
|
*
|
|
* (c) 2005-2013 Alchemy
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Alchemy\Phrasea\Core\Provider;
|
|
|
|
use Alchemy\Phrasea\Core\Configuration\Configuration;
|
|
use Alchemy\Phrasea\Core\Configuration\Compiler;
|
|
use Silex\Application as SilexApplication;
|
|
use Silex\ServiceProviderInterface;
|
|
use Symfony\Component\Yaml\Yaml;
|
|
use Alchemy\Phrasea\Core\Event\Subscriber\TrustedProxySubscriber;
|
|
|
|
class ConfigurationServiceProvider implements ServiceProviderInterface
|
|
{
|
|
public function register(SilexApplication $app)
|
|
{
|
|
$app['phraseanet.configuration.yaml-parser'] = $app->share(function (SilexApplication $app) {
|
|
return new Yaml();
|
|
});
|
|
$app['phraseanet.configuration.compiler'] = $app->share(function (SilexApplication $app) {
|
|
return new Compiler();
|
|
});
|
|
$app['phraseanet.configuration.config-path'] = $app['root.path'] . '/config/configuration.yml';
|
|
$app['phraseanet.configuration.config-compiled-path'] = $app['root.path'] . '/tmp/configuration-compiled.php';
|
|
|
|
$app['phraseanet.configuration'] = $app->share(function (SilexApplication $app) {
|
|
return new Configuration(
|
|
$app['phraseanet.configuration.yaml-parser'],
|
|
$app['phraseanet.configuration.compiler'],
|
|
$app['phraseanet.configuration.config-path'],
|
|
$app['phraseanet.configuration.config-compiled-path'],
|
|
$app['debug']
|
|
);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
public function boot(SilexApplication $app)
|
|
{
|
|
$app['dispatcher'] = $app->share(
|
|
$app->extend('dispatcher', function ($dispatcher, SilexApplication $app) {
|
|
$dispatcher->addSubscriber(new TrustedProxySubscriber($app['phraseanet.configuration']));
|
|
|
|
return $dispatcher;
|
|
})
|
|
);
|
|
}
|
|
}
|