mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Update service provider
This commit is contained in:
@@ -22,18 +22,17 @@ class BorderManagerServiceProvider implements ServiceProviderInterface
|
|||||||
{
|
{
|
||||||
$app['border-manager'] = $app->share(function(Application $app) {
|
$app['border-manager'] = $app->share(function(Application $app) {
|
||||||
|
|
||||||
$configuration = $app['phraseanet.configuration']
|
$configuration = $app['phraseanet.configuration']
|
||||||
->getService($app['phraseanet.configuration']
|
->getService($app['phraseanet.configuration']
|
||||||
->getBorder());
|
->getBorder());
|
||||||
|
|
||||||
$service = Builder::create($app, $configuration);
|
$service = Builder::create($app, $configuration);
|
||||||
|
|
||||||
return $service->getDriver();
|
return $service->getDriver();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function boot(Application $app)
|
public function boot(Application $app)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -20,12 +20,11 @@ class BrowserServiceProvider implements ServiceProviderInterface
|
|||||||
public function register(Application $app)
|
public function register(Application $app)
|
||||||
{
|
{
|
||||||
$app['browser'] = $app->share(function($app) {
|
$app['browser'] = $app->share(function($app) {
|
||||||
return new \Browser();
|
return new \Browser();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function boot(Application $app)
|
public function boot(Application $app)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -20,33 +20,28 @@ class CacheServiceProvider implements ServiceProviderInterface
|
|||||||
|
|
||||||
public function register(Application $app)
|
public function register(Application $app)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$app['phraseanet.cache-service'] = $app->share(function(Application $app) {
|
$app['phraseanet.cache-service'] = $app->share(function(Application $app) {
|
||||||
if ( ! file_exists(__DIR__ . '/../../../../../tmp/cache_registry.yml')) {
|
if ( ! file_exists(__DIR__ . '/../../../../../tmp/cache_registry.yml')) {
|
||||||
touch(__DIR__ . '/../../../../../tmp/cache_registry.yml');
|
touch(__DIR__ . '/../../../../../tmp/cache_registry.yml');
|
||||||
}
|
}
|
||||||
|
|
||||||
return new CacheManager($app, new \SplFileInfo(__DIR__ . '/../../../../../tmp/cache_registry.yml'));
|
return new CacheManager($app, new \SplFileInfo(__DIR__ . '/../../../../../tmp/cache_registry.yml'));
|
||||||
});
|
});
|
||||||
|
|
||||||
$app['cache'] = $app->share(function(Application $app) {
|
$app['cache'] = $app->share(function(Application $app) {
|
||||||
|
return $app['phraseanet.cache-service']
|
||||||
return $app['phraseanet.cache-service']
|
->get('MainCache', $app['phraseanet.configuration']->getCache())
|
||||||
->get('MainCache', $app['phraseanet.configuration']->getCache())
|
->getDriver();
|
||||||
->getDriver();
|
});
|
||||||
});
|
|
||||||
|
|
||||||
$app['opcode-cache'] = $app->share(function(Application $app) {
|
$app['opcode-cache'] = $app->share(function(Application $app) {
|
||||||
|
return $app['phraseanet.cache-service']
|
||||||
return $app['phraseanet.cache-service']
|
->get('OpcodeCache', $app['phraseanet.configuration']->getOpcodeCache())
|
||||||
->get('OpcodeCache', $app['phraseanet.configuration']->getOpcodeCache())
|
->getDriver();
|
||||||
->getDriver();
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function boot(Application $app)
|
public function boot(Application $app)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,6 @@ class ConfigurationServiceProvider implements ServiceProviderInterface
|
|||||||
public function register(SilexApplication $app)
|
public function register(SilexApplication $app)
|
||||||
{
|
{
|
||||||
$app['phraseanet.configuration'] = $app->share(function(Application $app) {
|
$app['phraseanet.configuration'] = $app->share(function(Application $app) {
|
||||||
|
|
||||||
return Configuration::build(null, $app->getEnvironment());
|
return Configuration::build(null, $app->getEnvironment());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -21,17 +21,15 @@ class ORMServiceProvider implements ServiceProviderInterface
|
|||||||
public function register(Application $app)
|
public function register(Application $app)
|
||||||
{
|
{
|
||||||
$app['EM'] = $app->share(function(Application $app) {
|
$app['EM'] = $app->share(function(Application $app) {
|
||||||
|
return Builder::create(
|
||||||
return Builder::create(
|
$app, $app['phraseanet.configuration']
|
||||||
$app, $app['phraseanet.configuration']
|
->getService($app['phraseanet.configuration']
|
||||||
->getService($app['phraseanet.configuration']
|
->getOrm())
|
||||||
->getOrm())
|
)->getDriver();
|
||||||
)->getDriver();
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function boot(Application $app)
|
public function boot(Application $app)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user