diff --git a/lib/Alchemy/Phrasea/Application.php b/lib/Alchemy/Phrasea/Application.php index e2efff71a5..15f539b83a 100644 --- a/lib/Alchemy/Phrasea/Application.php +++ b/lib/Alchemy/Phrasea/Application.php @@ -18,7 +18,6 @@ use Alchemy\Phrasea\Application\Helper\AclAware; use Alchemy\Phrasea\Application\Helper\ApplicationBoxAware; use Alchemy\Phrasea\Application\Helper\AuthenticatorAware; use Alchemy\Phrasea\Authorization\AuthorizationServiceProvider; -use Alchemy\Phrasea\Cache\Manager; use Alchemy\Phrasea\Core\Event\Subscriber\BasketSubscriber; use Alchemy\Phrasea\Core\Event\Subscriber\BridgeSubscriber; use Alchemy\Phrasea\Core\Event\Subscriber\ExportSubscriber; @@ -84,7 +83,6 @@ use Alchemy\Phrasea\Twig\Fit; use Alchemy\Phrasea\Twig\JSUniqueID; use Alchemy\Phrasea\Twig\PhraseanetExtension; use Alchemy\Phrasea\Utilities\CachedTranslator; -use Dflydev\Silex\Provider\DoctrineOrm\DoctrineOrmServiceProvider; use Doctrine\Common\EventManager; use Doctrine\DBAL\Event\ConnectionEventArgs; use Doctrine\DBAL\Events; diff --git a/lib/Alchemy/Phrasea/Application/Root.php b/lib/Alchemy/Phrasea/Application/Root.php index 64181dc9c6..72800b678b 100644 --- a/lib/Alchemy/Phrasea/Application/Root.php +++ b/lib/Alchemy/Phrasea/Application/Root.php @@ -18,6 +18,7 @@ use Alchemy\Phrasea\Core\Event\Subscriber\BridgeExceptionSubscriber; use Alchemy\Phrasea\Core\Event\Subscriber\FirewallSubscriber; use Alchemy\Phrasea\Core\Event\Subscriber\JsonRequestSubscriber; use Alchemy\Phrasea\Core\Event\Subscriber\DebuggerSubscriber; +use Alchemy\Phrasea\Core\Provider\WebProfilerServiceProvider as PhraseaWebProfilerServiceProvider; use Monolog\Logger; use Monolog\Processor\WebProcessor; use Silex\Provider\WebProfilerServiceProvider; @@ -63,6 +64,9 @@ return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) { $app->register($p = new WebProfilerServiceProvider(), [ 'profiler.cache_dir' => $app['cache.path'].'/profiler', ]); + + $app->register(new PhraseaWebProfilerServiceProvider()); + $app->mount('/_profiler', $p); if ($app['phraseanet.configuration-tester']->isInstalled()) { diff --git a/lib/Alchemy/Phrasea/Core/Provider/WebProfilerServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/WebProfilerServiceProvider.php new file mode 100644 index 0000000000..d5c0521b3d --- /dev/null +++ b/lib/Alchemy/Phrasea/Core/Provider/WebProfilerServiceProvider.php @@ -0,0 +1,48 @@ +extend('data_collector.templates', function (array $templates) { + $templates[] = array('ajax', '@WebProfiler/Collector/ajax.html.twig'); + + return $templates; + }); + + $app['data_collectors'] = $app->extend('data_collectors', function ($collectors) { + $collectors['ajax'] = function () { + return new AjaxDataCollector(); + }; + + return $collectors; + }); + } + } + + /** + * Bootstraps the application. + * + * This method is called after all services are registered + * and should be used for "dynamic" configuration (whenever + * a service must be requested). + */ + public function boot(Application $app) + { + // TODO: Implement boot() method. + } +}