mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 14:33:14 +00:00
@@ -105,6 +105,8 @@ use Alchemy\Phrasea\Twig\JSUniqueID;
|
||||
use Alchemy\Phrasea\Twig\Camelize;
|
||||
use Alchemy\Phrasea\Twig\BytesConverter;
|
||||
use FFMpeg\FFMpegServiceProvider;
|
||||
use Monolog\Logger;
|
||||
use Monolog\Processor\IntrospectionProcessor;
|
||||
use Neutron\Silex\Provider\ImagineServiceProvider;
|
||||
use MediaVorus\MediaVorusServiceProvider;
|
||||
use MediaVorus\Utils\RawImageMimeTypeGuesser;
|
||||
@@ -250,6 +252,11 @@ class Application extends SilexApplication
|
||||
$this['monolog.handler'] = $this->share(function () {
|
||||
return new NullHandler();
|
||||
});
|
||||
$this['monolog'] = $this->share($this->extend('monolog', function (Logger $monolog) {
|
||||
$monolog->pushProcessor(new IntrospectionProcessor());
|
||||
|
||||
return $monolog;
|
||||
}));
|
||||
$this->register(new MP4BoxServiceProvider());
|
||||
$this->register(new NotificationDelivererServiceProvider());
|
||||
$this->register(new ORMServiceProvider());
|
||||
|
@@ -19,6 +19,8 @@ use Alchemy\Phrasea\Core\Event\ApiLoadEndEvent;
|
||||
use Alchemy\Phrasea\Core\Event\ApiLoadStartEvent;
|
||||
use Alchemy\Phrasea\Core\Event\Subscriber\ApiOauth2ErrorsSubscriber;
|
||||
use Alchemy\Phrasea\Core\Event\Subscriber\ApiExceptionHandlerSubscriber;
|
||||
use Monolog\Logger;
|
||||
use Monolog\Processor\WebProcessor;
|
||||
use Silex\Application as SilexApplication;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
@@ -30,6 +32,11 @@ return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) {
|
||||
$app['exception_handler'] = $app->share(function ($app) {
|
||||
return new ApiExceptionHandlerSubscriber($app);
|
||||
});
|
||||
$app['monolog'] = $app->share($app->extend('monolog', function (Logger $monolog) {
|
||||
$monolog->pushProcessor(new WebProcessor());
|
||||
|
||||
return $monolog;
|
||||
}));
|
||||
|
||||
$app->register(new \API_V1_Timer());
|
||||
$app['dispatcher']->dispatch(PhraseaEvents::API_LOAD_START, new ApiLoadStartEvent());
|
||||
|
@@ -17,6 +17,8 @@ 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 Monolog\Logger;
|
||||
use Monolog\Processor\WebProcessor;
|
||||
use Silex\Provider\WebProfilerServiceProvider;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
@@ -28,6 +30,11 @@ return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) {
|
||||
$app['exception_handler'] = $app->share(function ($app) {
|
||||
return new PhraseaExceptionHandlerSubscriber($app['phraseanet.exception_handler']);
|
||||
});
|
||||
$app['monolog'] = $app->share($app->extend('monolog', function (Logger $monolog) {
|
||||
$monolog->pushProcessor(new WebProcessor());
|
||||
|
||||
return $monolog;
|
||||
}));
|
||||
|
||||
$app->before(function (Request $request) use ($app) {
|
||||
if (0 === strpos($request->getPathInfo(), '/setup')) {
|
||||
|
@@ -33,7 +33,7 @@ class Datafiles extends AbstractDelivery
|
||||
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
if (!$app['authentication']->isAuthenticated()) {
|
||||
$app->abort(403, 'You are not autorized to see this');
|
||||
$app->abort(403, sprintf('You are not authorized to access %s', $request->getRequestUri()));
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user