sintonia/legacy/application/Bootstrap.php
Jonas L 729a7b99e0
feat(legacy): consolidate constants (#1558)
* remove unused file

* fix paths leading slash

* remove useless imports

* refactor(legacy): use constants everywhere

* fix path leading slash

* remove useless import

* consolidate legacy contants

* format code

* reuse LIBRETIME_CONFIG_DIR

* fix test config path

* remove ci legacy log dir creation

* some logs improvements
2022-02-04 12:00:41 +02:00

71 lines
2 KiB
PHP

<?php
require_once 'preload.php';
$CC_CONFIG = Config::getConfig();
require_once CONFIG_PATH . '/ACL.php';
// Since we initialize the database during the configuration check,
// check the $configRun global to avoid reinitializing unnecessarily
if (!isset($configRun) || !$configRun) {
Propel::init(PROPEL_CONFIG_FILEPATH);
}
Logging::setLogPath(LIBRETIME_LOG_FILEPATH);
Zend_Session::setOptions(['strict' => true]);
Config::setAirtimeVersion();
require_once CONFIG_PATH . '/navigation.php';
Zend_Validate::setDefaultNamespaces('Zend');
$front = Zend_Controller_Front::getInstance();
$front->registerPlugin(new RabbitMqPlugin());
$front->throwExceptions(false);
/* The bootstrap class should only be used to initialize actions that return a view.
Actions that return JSON will not use the bootstrap class! */
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initDoctype()
{
$this->bootstrap('view');
$view = $this->getResource('view');
$view->doctype('XHTML1_STRICT');
}
/**
* initialize front controller.
*
* This is call ZFrontController to ensure it is executed last in the bootstrap process.
*/
protected function _initZFrontController()
{
Zend_Controller_Front::getInstance()->throwExceptions(false);
}
protected function _initRouter()
{
$front = Zend_Controller_Front::getInstance();
$router = $front->getRouter();
$front->setBaseUrl(Application_Common_OsPath::getBaseDir());
$router->addRoute(
'password-change',
new Zend_Controller_Router_Route('password-change/:user_id/:token', [
'module' => 'default',
'controller' => 'login',
'action' => 'password-change',
])
);
}
public function _initPlugins()
{
$front = Zend_Controller_Front::getInstance();
$front->registerPlugin(new Zend_Controller_Plugin_Maintenance());
$front->registerPlugin(new PageLayoutInitPlugin($this));
}
}