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) {
|
||||
|
||||
$configuration = $app['phraseanet.configuration']
|
||||
->getService($app['phraseanet.configuration']
|
||||
->getBorder());
|
||||
$configuration = $app['phraseanet.configuration']
|
||||
->getService($app['phraseanet.configuration']
|
||||
->getBorder());
|
||||
|
||||
$service = Builder::create($app, $configuration);
|
||||
$service = Builder::create($app, $configuration);
|
||||
|
||||
return $service->getDriver();
|
||||
});
|
||||
return $service->getDriver();
|
||||
});
|
||||
}
|
||||
|
||||
public function boot(Application $app)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -20,12 +20,11 @@ class BrowserServiceProvider implements ServiceProviderInterface
|
||||
public function register(Application $app)
|
||||
{
|
||||
$app['browser'] = $app->share(function($app) {
|
||||
return new \Browser();
|
||||
});
|
||||
return new \Browser();
|
||||
});
|
||||
}
|
||||
|
||||
public function boot(Application $app)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -20,33 +20,28 @@ class CacheServiceProvider implements ServiceProviderInterface
|
||||
|
||||
public function register(Application $app)
|
||||
{
|
||||
|
||||
|
||||
$app['phraseanet.cache-service'] = $app->share(function(Application $app) {
|
||||
if ( ! file_exists(__DIR__ . '/../../../../../tmp/cache_registry.yml')) {
|
||||
touch(__DIR__ . '/../../../../../tmp/cache_registry.yml');
|
||||
}
|
||||
if ( ! file_exists(__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) {
|
||||
|
||||
return $app['phraseanet.cache-service']
|
||||
->get('MainCache', $app['phraseanet.configuration']->getCache())
|
||||
->getDriver();
|
||||
});
|
||||
return $app['phraseanet.cache-service']
|
||||
->get('MainCache', $app['phraseanet.configuration']->getCache())
|
||||
->getDriver();
|
||||
});
|
||||
|
||||
$app['opcode-cache'] = $app->share(function(Application $app) {
|
||||
|
||||
return $app['phraseanet.cache-service']
|
||||
->get('OpcodeCache', $app['phraseanet.configuration']->getOpcodeCache())
|
||||
->getDriver();
|
||||
});
|
||||
return $app['phraseanet.cache-service']
|
||||
->get('OpcodeCache', $app['phraseanet.configuration']->getOpcodeCache())
|
||||
->getDriver();
|
||||
});
|
||||
}
|
||||
|
||||
public function boot(Application $app)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -22,7 +22,6 @@ class ConfigurationServiceProvider implements ServiceProviderInterface
|
||||
public function register(SilexApplication $app)
|
||||
{
|
||||
$app['phraseanet.configuration'] = $app->share(function(Application $app) {
|
||||
|
||||
return Configuration::build(null, $app->getEnvironment());
|
||||
});
|
||||
}
|
||||
|
@@ -21,17 +21,15 @@ class ORMServiceProvider implements ServiceProviderInterface
|
||||
public function register(Application $app)
|
||||
{
|
||||
$app['EM'] = $app->share(function(Application $app) {
|
||||
|
||||
return Builder::create(
|
||||
$app, $app['phraseanet.configuration']
|
||||
->getService($app['phraseanet.configuration']
|
||||
->getOrm())
|
||||
)->getDriver();
|
||||
});
|
||||
return Builder::create(
|
||||
$app, $app['phraseanet.configuration']
|
||||
->getService($app['phraseanet.configuration']
|
||||
->getOrm())
|
||||
)->getDriver();
|
||||
});
|
||||
}
|
||||
|
||||
public function boot(Application $app)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user