mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 21:13:26 +00:00
Fixup Service Instantiation and enforce application booting.
This commit is contained in:
@@ -87,14 +87,6 @@ class PluginServiceProvider implements ServiceProviderInterface
|
|||||||
// Add a new controller provider can be added as follows
|
// Add a new controller provider can be added as follows
|
||||||
// $app['plugin.controller_providers'][] = array('/prefix', 'controller_provider_service_key');
|
// $app['plugin.controller_providers'][] = array('/prefix', 'controller_provider_service_key');
|
||||||
$app['plugin.controller_providers.api'] = new ArrayObject();
|
$app['plugin.controller_providers.api'] = new ArrayObject();
|
||||||
}
|
|
||||||
|
|
||||||
public function boot(Application $app)
|
|
||||||
{
|
|
||||||
foreach ($app['plugin.locale.textdomains'] as $textdomain => $dir) {
|
|
||||||
bind_textdomain_codeset($textdomain, 'UTF-8');
|
|
||||||
bindtextdomain($textdomain, $dir);
|
|
||||||
}
|
|
||||||
|
|
||||||
$app['twig'] = $app->share(
|
$app['twig'] = $app->share(
|
||||||
$app->extend('twig', function (Twig_Environment $twig) {
|
$app->extend('twig', function (Twig_Environment $twig) {
|
||||||
@@ -105,4 +97,12 @@ class PluginServiceProvider implements ServiceProviderInterface
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function boot(Application $app)
|
||||||
|
{
|
||||||
|
foreach ($app['plugin.locale.textdomains'] as $textdomain => $dir) {
|
||||||
|
bind_textdomain_codeset($textdomain, 'UTF-8');
|
||||||
|
bindtextdomain($textdomain, $dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,6 +14,8 @@ class module_console_systemTemplateGeneratorTest extends \PhraseanetTestCase
|
|||||||
{
|
{
|
||||||
$application = new CLI('test', null, 'test');
|
$application = new CLI('test', null, 'test');
|
||||||
$application->command(new module_console_systemTemplateGenerator('system:templateGenerator'));
|
$application->command(new module_console_systemTemplateGenerator('system:templateGenerator'));
|
||||||
|
// Application should be booted before executing commands
|
||||||
|
$application->boot();
|
||||||
|
|
||||||
$command = $application['console']->find('system:templateGenerator');
|
$command = $application['console']->find('system:templateGenerator');
|
||||||
$commandTester = new CommandTester($command);
|
$commandTester = new CommandTester($command);
|
||||||
|
Reference in New Issue
Block a user