mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 13:33:14 +00:00
Cleanup application
This commit is contained in:
@@ -10,12 +10,12 @@ use Alchemy\Phrasea\Core\Provider\ConfigurationServiceProvider;
|
|||||||
use Alchemy\Phrasea\Core\Provider\GeonamesServiceProvider;
|
use Alchemy\Phrasea\Core\Provider\GeonamesServiceProvider;
|
||||||
use Alchemy\Phrasea\Core\Provider\ORMServiceProvider;
|
use Alchemy\Phrasea\Core\Provider\ORMServiceProvider;
|
||||||
use Alchemy\Phrasea\Core\Provider\TaskManagerServiceProvider;
|
use Alchemy\Phrasea\Core\Provider\TaskManagerServiceProvider;
|
||||||
use Alchemy\Phrasea\Security\Firewall;
|
|
||||||
use FFMpeg\FFMpegServiceProvider;
|
use FFMpeg\FFMpegServiceProvider;
|
||||||
use Grom\Silex\ImagineServiceProvider;
|
use Grom\Silex\ImagineServiceProvider;
|
||||||
use MediaVorus\MediaVorusServiceProvider;
|
use MediaVorus\MediaVorusServiceProvider;
|
||||||
use MediaAlchemyst\MediaAlchemystServiceProvider;
|
use MediaAlchemyst\MediaAlchemystServiceProvider;
|
||||||
use MediaAlchemyst\Driver\Imagine;
|
use MediaAlchemyst\Driver\Imagine;
|
||||||
|
use Monolog\Handler\NullHandler;
|
||||||
use MP4Box\MP4BoxServiceProvider;
|
use MP4Box\MP4BoxServiceProvider;
|
||||||
use Neutron\Silex\Provider\FilesystemServiceProvider;
|
use Neutron\Silex\Provider\FilesystemServiceProvider;
|
||||||
use PHPExiftool\PHPExiftoolServiceProvider;
|
use PHPExiftool\PHPExiftoolServiceProvider;
|
||||||
@@ -27,11 +27,12 @@ use Silex\Provider\UrlGeneratorServiceProvider;
|
|||||||
use Silex\Provider\ValidatorServiceProvider;
|
use Silex\Provider\ValidatorServiceProvider;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Unoconv\UnoconvServiceProvider;
|
use Unoconv\UnoconvServiceProvider;
|
||||||
|
use XPDF\PdfToText;
|
||||||
use XPDF\XPDFServiceProvider;
|
use XPDF\XPDFServiceProvider;
|
||||||
|
|
||||||
class Application extends SilexApplication
|
class Application extends SilexApplication
|
||||||
{
|
{
|
||||||
protected static $availableLanguages = array(
|
private static $availableLanguages = array(
|
||||||
'ar_SA' => 'العربية'
|
'ar_SA' => 'العربية'
|
||||||
, 'de_DE' => 'Deutsch'
|
, 'de_DE' => 'Deutsch'
|
||||||
, 'en_GB' => 'English'
|
, 'en_GB' => 'English'
|
||||||
@@ -51,14 +52,14 @@ class Application extends SilexApplication
|
|||||||
|
|
||||||
$this->environment = $environment;
|
$this->environment = $environment;
|
||||||
|
|
||||||
ini_set('output_buffering', '4096');
|
|
||||||
|
|
||||||
if ((int) ini_get('memory_limit') < 2048) {
|
if ((int) ini_get('memory_limit') < 2048) {
|
||||||
ini_set('memory_limit', '2048M');
|
ini_set('memory_limit', '2048M');
|
||||||
}
|
}
|
||||||
|
|
||||||
error_reporting(E_STRICT);
|
error_reporting(E_ALL | E_STRICT);
|
||||||
// ini_set('error_reporting', '6143');
|
|
||||||
|
ini_set('display_errors', 'on');
|
||||||
|
ini_set('output_buffering', '4096');
|
||||||
ini_set('default_charset', 'UTF-8');
|
ini_set('default_charset', 'UTF-8');
|
||||||
ini_set('session.use_cookies', '1');
|
ini_set('session.use_cookies', '1');
|
||||||
ini_set('session.use_only_cookies', '1');
|
ini_set('session.use_only_cookies', '1');
|
||||||
@@ -67,48 +68,57 @@ class Application extends SilexApplication
|
|||||||
ini_set('session.hash_bits_per_character', '6');
|
ini_set('session.hash_bits_per_character', '6');
|
||||||
ini_set('session.cache_limiter', '');
|
ini_set('session.cache_limiter', '');
|
||||||
ini_set('allow_url_fopen', 'on');
|
ini_set('allow_url_fopen', 'on');
|
||||||
|
mb_internal_encoding("UTF-8");
|
||||||
|
|
||||||
|
!defined('JETON_MAKE_SUBDEF') ? define('JETON_MAKE_SUBDEF', 0x01) : '';
|
||||||
|
!defined('JETON_WRITE_META_DOC') ? define('JETON_WRITE_META_DOC', 0x02) : '';
|
||||||
|
!defined('JETON_WRITE_META_SUBDEF') ? define('JETON_WRITE_META_SUBDEF', 0x04) : '';
|
||||||
|
!defined('JETON_WRITE_META') ? define('JETON_WRITE_META', 0x06) : '';
|
||||||
|
|
||||||
$this['charset'] = 'UTF-8';
|
$this['charset'] = 'UTF-8';
|
||||||
|
|
||||||
$this->register(new ConfigurationServiceProvider());
|
|
||||||
|
|
||||||
|
|
||||||
$this->register(new PhraseanetServiceProvider());
|
|
||||||
|
|
||||||
|
|
||||||
$this['debug'] = $this->share(function(Application $app) {
|
$this['debug'] = $this->share(function(Application $app) {
|
||||||
return $app->getEnvironment() !== 'prod';
|
return $app->getEnvironment() !== 'prod';
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->register(new BorderManagerServiceProvider());
|
|
||||||
$this->register(new CacheServiceProvider());
|
|
||||||
$this->register(new ORMServiceProvider());
|
|
||||||
$this->register(new ValidatorServiceProvider());
|
|
||||||
$this->register(new UrlGeneratorServiceProvider());
|
|
||||||
$this->register(new BrowserServiceProvider());
|
|
||||||
$this->register(new ImagineServiceProvider());
|
|
||||||
$this->register(new FFMpegServiceProvider());
|
|
||||||
$this->register(new PHPExiftoolServiceProvider());
|
|
||||||
$this->register(new UnoconvServiceProvider());
|
|
||||||
$this->register(new MediaVorusServiceProvider());
|
|
||||||
$this->register(new XPDFServiceProvider());
|
|
||||||
$this->register(new MonologServiceProvider());
|
|
||||||
$this->register(new MediaAlchemystServiceProvider());
|
|
||||||
$this->register(new SessionServiceProvider());
|
|
||||||
$this->register(new GeonamesServiceProvider);
|
|
||||||
$this->register(new TaskManagerServiceProvider());
|
|
||||||
$this->register(new MP4BoxServiceProvider());
|
|
||||||
|
|
||||||
$this['session.test'] = $this->share(function(Application $app) {
|
$this['session.test'] = $this->share(function(Application $app) {
|
||||||
return $app->getEnvironment() == 'test';
|
return $app->getEnvironment() == 'test';
|
||||||
});
|
});
|
||||||
|
|
||||||
$this['locale'] = $this->share(function(Application $app) {
|
if ($this['debug'] === true) {
|
||||||
if ($app['request']->cookies->has('locale')) {
|
ini_set('display_errors', 'on');
|
||||||
return $app['request']->cookies->get('locale');
|
ini_set('log_errors', 'on');
|
||||||
|
ini_set('error_log', __DIR__ . '/../../../logs/php_error.log');
|
||||||
|
} else {
|
||||||
|
ini_set('display_errors', 'off');
|
||||||
|
ini_set('log_errors', 'off');
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
$this->register(new BorderManagerServiceProvider());
|
||||||
|
$this->register(new BrowserServiceProvider());
|
||||||
|
$this->register(new ConfigurationServiceProvider());
|
||||||
|
$this->register(new CacheServiceProvider());
|
||||||
|
$this->register(new ImagineServiceProvider());
|
||||||
|
$this->register(new FFMpegServiceProvider());
|
||||||
|
$this->register(new FilesystemServiceProvider());
|
||||||
|
$this->register(new GeonamesServiceProvider);
|
||||||
|
$this->register(new MediaAlchemystServiceProvider());
|
||||||
|
$this->register(new MediaVorusServiceProvider());
|
||||||
|
$this->register(new MonologServiceProvider());
|
||||||
|
$this->register(new MP4BoxServiceProvider());
|
||||||
|
$this->register(new ORMServiceProvider());
|
||||||
|
$this->register(new PhraseanetServiceProvider());
|
||||||
|
$this->register(new PHPExiftoolServiceProvider());
|
||||||
|
$this->register(new SessionServiceProvider());
|
||||||
|
$this->register(new TaskManagerServiceProvider());
|
||||||
|
$this->register(new UnoconvServiceProvider());
|
||||||
|
$this->register(new UrlGeneratorServiceProvider());
|
||||||
|
$this->register(new ValidatorServiceProvider());
|
||||||
|
$this->register(new XPDFServiceProvider());
|
||||||
|
|
||||||
|
// $this->register(new \Silex\Provider\HttpCacheServiceProvider());
|
||||||
|
// $this->register(new \Silex\Provider\SecurityServiceProvider());
|
||||||
|
// $this->register(new \Silex\Provider\SwiftmailerServiceProvider());
|
||||||
|
|
||||||
$this['imagine.factory'] = $this->share(function(Application $app) {
|
$this['imagine.factory'] = $this->share(function(Application $app) {
|
||||||
if ($app['phraseanet.registry']->get('GV_imagine_driver') != '') {
|
if ($app['phraseanet.registry']->get('GV_imagine_driver') != '') {
|
||||||
@@ -128,13 +138,9 @@ class Application extends SilexApplication
|
|||||||
throw new \RuntimeException('No Imagine driver available');
|
throw new \RuntimeException('No Imagine driver available');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$this['monolog.name'] = 'Phraseanet logger';
|
||||||
$this['monolog.handler'] = $this->share(function () {
|
$this['monolog.handler'] = $this->share(function () {
|
||||||
return new \Monolog\Handler\NullHandler();
|
return new NullHandler();
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$this['phraseanet.registry'] = $this->share(function(Application $app) {
|
|
||||||
return new \registry($app);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$app = $this;
|
$app = $this;
|
||||||
@@ -158,117 +164,35 @@ class Application extends SilexApplication
|
|||||||
return new \phraseadate($app);
|
return new \phraseadate($app);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$this['xpdf.pdf2text'] = $this->share(
|
||||||
/**
|
$this->extend('xpdf.pdf2text', function(PdfToText $pdf2text, Application $app){
|
||||||
* Rajouter
|
if ($app['phraseanet.registry']->get('GV_pdfmaxpages')) {
|
||||||
if ($core->getRegistry()->get('GV_pdfmaxpages')) {
|
$pdf2text->setPageQuantity($app['phraseanet.registry']->get('GV_pdfmaxpages'));
|
||||||
$pdftotext->setPageQuantity($core->getRegistry()->get('GV_pdfmaxpages'));
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
/**
|
return $pdf2text;
|
||||||
* Rajouter log rooms
|
})
|
||||||
*/
|
);
|
||||||
|
|
||||||
$this->register(new TwigServiceProvider(), array(
|
$this->register(new TwigServiceProvider(), array(
|
||||||
'twig.options' => array(
|
'twig.options' => array(
|
||||||
'cache' => realpath(__DIR__ . '/../../../../../../tmp/cache_twig/'),
|
'cache' => realpath(__DIR__ . '/../../../../../../tmp/cache_twig/'),
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
$this['firewall'] = $this->share(function() use ($app) {
|
|
||||||
return new Firewall($app);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$this->setupTwig();
|
$this->setupTwig();
|
||||||
|
|
||||||
|
|
||||||
$this->register(new FilesystemServiceProvider());
|
|
||||||
|
|
||||||
$request = Request::createFromGlobals();
|
$request = Request::createFromGlobals();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dirty hack for flash uploader
|
||||||
|
*/
|
||||||
if (!!stripos($request->server->get('HTTP_USER_AGENT'), 'flash') && $request->getRequestUri() === '/prod/upload/') {
|
if (!!stripos($request->server->get('HTTP_USER_AGENT'), 'flash') && $request->getRequestUri() === '/prod/upload/') {
|
||||||
if (null !== $sessionId = $request->get('php_session_id')) {
|
if (null !== $sessionId = $request->get('php_session_id')) {
|
||||||
session_id($sessionId);
|
session_id($sessionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this['events-manager'] = $this->share(function(Application $app) {
|
|
||||||
$events = new \eventsmanager_broker($app);
|
|
||||||
$events->start();
|
|
||||||
|
|
||||||
return $events;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// $request = Request::createFromGlobals();
|
|
||||||
// $gatekeeper = \gatekeeper::getInstance($this);
|
|
||||||
// $gatekeeper->check_directory($request);
|
|
||||||
|
|
||||||
\phrasea::start($this['phraseanet.configuration']);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($this['phraseanet.registry']->is_set('GV_timezone')) {
|
|
||||||
date_default_timezone_set($this['phraseanet.registry']->get('GV_timezone'));
|
|
||||||
} else {
|
|
||||||
date_default_timezone_set('Europe/Berlin');
|
|
||||||
}
|
|
||||||
|
|
||||||
// if ($this['phraseanet.configuration']->isInstalled()) {
|
|
||||||
// if ($this['phraseanet.configuration']->isDisplayingErrors()) {
|
|
||||||
ini_set('display_errors', 'on');
|
|
||||||
error_reporting(E_ALL);
|
|
||||||
// } else {
|
|
||||||
// ini_set('display_errors', 'off');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$php_log = $this['phraseanet.registry']->get('GV_RootPath') . 'logs/php_error.log';
|
|
||||||
|
|
||||||
ini_set('error_log', $php_log);
|
|
||||||
|
|
||||||
if ($this['phraseanet.registry']->get('GV_log_errors')) {
|
|
||||||
ini_set('log_errors', 'on');
|
|
||||||
} else {
|
|
||||||
ini_set('log_errors', 'off');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO NEUTRON add content nego
|
|
||||||
*/
|
|
||||||
$request->setDefaultLocale(
|
|
||||||
$this['phraseanet.registry']->get('GV_default_lng', 'en_GB')
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
$cookies = $request->cookies;
|
|
||||||
|
|
||||||
if (isset(static::$availableLanguages[$cookies->get('locale')])) {
|
|
||||||
$request->setLocale($cookies->get('locale'));
|
|
||||||
}
|
|
||||||
|
|
||||||
$app['locale'] = $request->getLocale();
|
|
||||||
$data = explode('_', $app['locale']);
|
|
||||||
$app['locale.I18n'] = $data[0];
|
|
||||||
$app['locale.l10n'] = $data[1];
|
|
||||||
|
|
||||||
mb_internal_encoding("UTF-8");
|
|
||||||
\phrasea::use_i18n($request->getLocale());
|
|
||||||
|
|
||||||
|
|
||||||
!defined('JETON_MAKE_SUBDEF') ? define('JETON_MAKE_SUBDEF', 0x01) : '';
|
|
||||||
!defined('JETON_WRITE_META_DOC') ? define('JETON_WRITE_META_DOC', 0x02) : '';
|
|
||||||
!defined('JETON_WRITE_META_SUBDEF') ? define('JETON_WRITE_META_SUBDEF', 0x04) : '';
|
|
||||||
!defined('JETON_WRITE_META') ? define('JETON_WRITE_META', 0x06) : '';
|
|
||||||
|
|
||||||
|
|
||||||
$this->before(function(Request $request) {
|
$this->before(function(Request $request) {
|
||||||
$contentTypes = $request->getAcceptableContentTypes();
|
$contentTypes = $request->getAcceptableContentTypes();
|
||||||
$request->setRequestFormat(
|
$request->setRequestFormat(
|
||||||
@@ -280,17 +204,39 @@ class Application extends SilexApplication
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// $this->register(new \Silex\Provider\HttpCacheServiceProvider());
|
$this['locale.I18n'] = $this->share(function(Application $app){
|
||||||
// $this->register(new \Silex\Provider\MonologServiceProvider());
|
$data = explode('_', $app['locale']);
|
||||||
// $this->register(new \Silex\Provider\SecurityServiceProvider());
|
|
||||||
// $this->register(new \Silex\Provider\SwiftmailerServiceProvider());
|
return $data[0];
|
||||||
// $this->register(new \Silex\Provider\UrlGeneratorServiceProvider());
|
});
|
||||||
|
$this['locale.l10n'] = $this->share(function(Application $app){
|
||||||
|
$data = explode('_', $app['locale']);
|
||||||
|
|
||||||
|
return $data[1];
|
||||||
|
});
|
||||||
|
|
||||||
|
$this['locale'] = $this->share(function(Application $app) {
|
||||||
|
if ($app['request']->cookies->has('locale')
|
||||||
|
&& isset(static::$availableLanguages[$app['request']->cookies->get('locale')])) {
|
||||||
|
$app['request']->setLocale($app['request']->cookies->get('locale'));
|
||||||
|
|
||||||
|
return $app['request']->getLocale();
|
||||||
|
}
|
||||||
|
|
||||||
|
$app['request']->setDefaultLocale(
|
||||||
|
$app['phraseanet.registry']->get('GV_default_lng', 'en_GB')
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
$this->before(function(Request $request) use ($app) {
|
||||||
|
\phrasea::use_i18n($app['locale']);
|
||||||
|
});
|
||||||
|
|
||||||
|
\phrasea::start($this['phraseanet.configuration']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setupTwig()
|
public function setupTwig()
|
||||||
{
|
{
|
||||||
|
|
||||||
$app = $this;
|
|
||||||
$this['twig'] = $this->share(
|
$this['twig'] = $this->share(
|
||||||
$this->extend('twig', function ($twig, $app) {
|
$this->extend('twig', function ($twig, $app) {
|
||||||
|
|
||||||
@@ -351,25 +297,12 @@ class Application extends SilexApplication
|
|||||||
$twig->addFilter('AppName', new \Twig_Filter_Function('Alchemy\Phrasea\Controller\Admin\ConnectedUsers::appName'));
|
$twig->addFilter('AppName', new \Twig_Filter_Function('Alchemy\Phrasea\Controller\Admin\ConnectedUsers::appName'));
|
||||||
|
|
||||||
return $twig;
|
return $twig;
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
// public function run(Request $request = null)
|
|
||||||
// {
|
|
||||||
// $app = $this;
|
|
||||||
//
|
|
||||||
// $this->error(function($e) use ($app) {
|
|
||||||
//
|
|
||||||
// if ($app['debug']) {
|
|
||||||
// return new Response($e->getMessage(), 500);
|
|
||||||
// } else {
|
|
||||||
// return new Response(_('An error occured'), 500);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// parent::run($request);
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tell if current seession is authenticated
|
* Tell if current a session is open
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
@@ -379,15 +312,12 @@ class Application extends SilexApplication
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return available language for phraseanet
|
* Open user session
|
||||||
*
|
*
|
||||||
* @return Array
|
* @param \Session_Authentication_Interface $auth
|
||||||
|
* @param integer $ses_id use previous phrasea session id
|
||||||
|
* @throws \Exception_InternalServerError
|
||||||
*/
|
*/
|
||||||
public static function getAvailableLanguages()
|
|
||||||
{
|
|
||||||
return static::$availableLanguages;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function openAccount(\Session_Authentication_Interface $auth, $ses_id = null)
|
public function openAccount(\Session_Authentication_Interface $auth, $ses_id = null)
|
||||||
{
|
{
|
||||||
$user = $auth->get_user();
|
$user = $auth->get_user();
|
||||||
@@ -423,6 +353,9 @@ class Application extends SilexApplication
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Closes user session
|
||||||
|
*/
|
||||||
public function closeAccount()
|
public function closeAccount()
|
||||||
{
|
{
|
||||||
if ($this['session']->has('phrasea_session_id')) {
|
if ($this['session']->has('phrasea_session_id')) {
|
||||||
@@ -430,6 +363,18 @@ class Application extends SilexApplication
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this['session']->clear();
|
$this['session']->clear();
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return available language for phraseanet
|
||||||
|
*
|
||||||
|
* @return Array
|
||||||
|
*/
|
||||||
|
public static function getAvailableLanguages()
|
||||||
|
{
|
||||||
|
return static::$availableLanguages;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
namespace Alchemy\Phrasea;
|
namespace Alchemy\Phrasea;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Core\Version;
|
use Alchemy\Phrasea\Core\Version;
|
||||||
|
use Alchemy\Phrasea\Security\Firewall;
|
||||||
use Silex\Application as SilexApplication;
|
use Silex\Application as SilexApplication;
|
||||||
use Silex\ServiceProviderInterface;
|
use Silex\ServiceProviderInterface;
|
||||||
|
|
||||||
@@ -11,17 +12,31 @@ class PhraseanetServiceProvider implements ServiceProviderInterface
|
|||||||
|
|
||||||
public function register(SilexApplication $app)
|
public function register(SilexApplication $app)
|
||||||
{
|
{
|
||||||
$app['phraseanet.appbox'] = $app->share(function($app) {
|
$app['phraseanet.appbox'] = $app->share(function(SilexApplication $app) {
|
||||||
return new \appbox($app);
|
return new \appbox($app);
|
||||||
});
|
});
|
||||||
|
|
||||||
$app['phraseanet.version'] = $app->share(function($app) {
|
$app['phraseanet.version'] = $app->share(function(SilexApplication $app) {
|
||||||
return new Version();
|
return new Version();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$app['phraseanet.registry'] = $app->share(function(SilexApplication $app) {
|
||||||
|
return new \registry($app);
|
||||||
|
});
|
||||||
|
|
||||||
|
$app['firewall'] = $app->share(function(SilexApplication $app) {
|
||||||
|
return new Firewall($app);
|
||||||
|
});
|
||||||
|
|
||||||
|
$app['events-manager'] = $app->share(function(SilexApplication $app) {
|
||||||
|
$events = new \eventsmanager_broker($app);
|
||||||
|
$events->start();
|
||||||
|
|
||||||
|
return $events;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function boot(SilexApplication $app)
|
public function boot(SilexApplication $app)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -330,7 +330,7 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
'description' => $registry->get('GV_metaDescription'),
|
'description' => $registry->get('GV_metaDescription'),
|
||||||
'httpServer' => array(
|
'httpServer' => array(
|
||||||
'logErrors' => $registry->get('GV_log_errors'),
|
'logErrors' => $registry->get('GV_log_errors'),
|
||||||
'phpTimezone' => $registry->get('GV_timezone'),
|
'phpTimezone' => ini_get('date.timezone'),
|
||||||
'siteId' => $registry->get('GV_sit'),
|
'siteId' => $registry->get('GV_sit'),
|
||||||
'staticUrl' => $registry->get('GV_STATIC_URL'),
|
'staticUrl' => $registry->get('GV_STATIC_URL'),
|
||||||
'defaultLanguage' => $registry->get('id_GV_default_lng'),
|
'defaultLanguage' => $registry->get('id_GV_default_lng'),
|
||||||
|
@@ -150,11 +150,6 @@ class setup
|
|||||||
{
|
{
|
||||||
require(__DIR__ . "/../../lib/conf.d/_GV_template.inc");
|
require(__DIR__ . "/../../lib/conf.d/_GV_template.inc");
|
||||||
|
|
||||||
if ($app['phraseanet.registry']->is_set('GV_timezone'))
|
|
||||||
date_default_timezone_set($app['phraseanet.registry']->get('GV_timezone'));
|
|
||||||
else
|
|
||||||
date_default_timezone_set('Europe/Berlin');
|
|
||||||
|
|
||||||
$debug = $log_errors = false;
|
$debug = $log_errors = false;
|
||||||
$vars = array();
|
$vars = array();
|
||||||
|
|
||||||
@@ -528,6 +523,11 @@ class setup
|
|||||||
$constraints[] = new Setup_Constraint($conf, true, sprintf('%s = `%s` => OK', $conf, $value), true);
|
$constraints[] = new Setup_Constraint($conf, true, sprintf('%s = `%s` => OK', $conf, $value), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ini_get('date.timezone')) {
|
||||||
|
$constraints[] = new Setup_Constraint('date.timezone', false, _('You must configure date.timezone'), true);
|
||||||
|
}
|
||||||
|
|
||||||
foreach (self::$PHP_CONF as $conf => $value) {
|
foreach (self::$PHP_CONF as $conf => $value) {
|
||||||
if ($conf == 'memory_limit') {
|
if ($conf == 'memory_limit') {
|
||||||
$memoryFound = self::test_php_conf($conf, $value);
|
$memoryFound = self::test_php_conf($conf, $value);
|
||||||
|
@@ -80,13 +80,6 @@ $GV = array(
|
|||||||
array(
|
array(
|
||||||
'section' => _('GV::section:: Serveur HTTP'),
|
'section' => _('GV::section:: Serveur HTTP'),
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
array(
|
|
||||||
'type' => 'timezone',
|
|
||||||
'name' => 'GV_timezone',
|
|
||||||
'comment' => _('reglages:: Timezone de l\'installation'),
|
|
||||||
'default' => 'Europe/Paris',
|
|
||||||
'required' => true
|
|
||||||
),
|
|
||||||
array(
|
array(
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'name' => 'GV_sit',
|
'name' => 'GV_sit',
|
||||||
|
Reference in New Issue
Block a user