diff --git a/application/Bootstrap.php b/application/Bootstrap.php index 4aaf97e..4a0fc85 100644 --- a/application/Bootstrap.php +++ b/application/Bootstrap.php @@ -35,15 +35,36 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap } /** - * - * Set Firebug_logger in registry + * Initialize configuration. * * @return void */ - public function _initFirbugLogger() + public function _initConfiguration() { - $writer = new Zend_Log_Writer_Firebug(); - $logger = new Zend_Log($writer); - Zend_Registry::set('logger', $logger); + $dynamicConfig = new Msd_Config_Dynamic(); + $configFile = $dynamicConfig->getParam('configFile', 'defaultConfig.ini'); + $config = new Msd_Config( + 'Default', + array('directories' => APPLICATION_PATH . '/configs') + ); + $config->load($configFile); + Msd_Registry::setConfig($config); + + Msd_Registry::setDynamicConfig($dynamicConfig); } + + /** + * Un-quote a string or array + * + * @param string|array $value The value to strip + * + * @return string|array + */ + public static function stripslashes_deep($value) + { + $value = is_array($value) ? array_map('Bootstrap::stripslashes_deep', $value) : stripslashes($value); + return $value; + } + + } diff --git a/application/configs/application.ini b/application/configs/application.ini index eee54c9..3fe785b 100644 --- a/application/configs/application.ini +++ b/application/configs/application.ini @@ -5,19 +5,19 @@ phpSettings.error_reporting = E_ALL phpSettings.default_charset = "UTF-8" phpSettings.date.timezone = "Europe/Berlin" phpSettings.magic_quotes_runtime = 0 -includePaths.library = APPLICATION_PATH "" DS ".." DS "library" -bootstrap.path = APPLICATION_PATH "" DS "Bootstrap.php" +includePaths.library = APPLICATION_PATH "/../library" +bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" appnamespace = "Application" -resources.frontController.controllerDirectory = APPLICATION_PATH "" DS "controllers" -resources.frontController.moduleDirectory = APPLICATION_PATH "" DS "modules" +resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" +resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" resources.frontController.params.displayExceptions = 0 -resources.view.basePath = APPLICATION_PATH "" DS "views" -resources.layout.layoutPath = APPLICATION_PATH "" DS "views" DS "layouts" -resources.frontController.actionHelperPaths.Msd_Action_Helper = "Msd" DS "Action" DS "Helper" DS +resources.view.basePath = APPLICATION_PATH "/views" +resources.layout.layoutPath = APPLICATION_PATH "/views/layouts" +resources.frontController.actionHelperPaths.Msd_Action_Helper = "Msd/Action/Helper/" resources.view.encoding = "UTF-8" resources.view.helperPath.ZendX_JQuery_View_Helper = "ZendX/JQuery/View/Helper/" -resources.view.helperPath.Msd_View_Helper = APPLICATION_PATH "" DS "views" DS "helpers" +resources.view.helperPath.Msd_View_Helper = APPLICATION_PATH "/views/helpers" resources.view.doctype = XHTML1_STRICT ; setHelperPath plugin is no longer used, because the paths are set here. resources.frontController.plugins.loginCheck = "Application_Plugin_LoginCheck" diff --git a/application/configs/update.ini b/application/configs/update.ini index bb0702d..9306ee6 100644 --- a/application/configs/update.ini +++ b/application/configs/update.ini @@ -9,4 +9,4 @@ request.params.a = "get_language_file" request.params.v = ":version" request.params.l = ":language" request.sourceFileKey = "f" -targetBaseDir = APPLICATION_PATH "" DS "language" +targetBaseDir = APPLICATION_PATH "/language" diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php index aa455c0..b88b240 100644 --- a/application/controllers/IndexController.php +++ b/application/controllers/IndexController.php @@ -55,11 +55,10 @@ class IndexController extends Zend_Controller_Action 'badversion', 'install', 'default', - array( - 'message' => 'L_PHP_VERSION_TOO_OLD' - ) + array('message' => 'L_PHP_VERSION_TOO_OLD') ); } + try { $dbo = Msd_Db::getAdapter(); $data = Msd_File::getLatestBackupInfo(); diff --git a/application/controllers/InstallController.php b/application/controllers/InstallController.php index 93a0443..5e572c0 100644 --- a/application/controllers/InstallController.php +++ b/application/controllers/InstallController.php @@ -108,8 +108,7 @@ class InstallController extends Zend_Controller_Action $languagesStatus[$langId] = array( 'langName' => $langName, 'installed' => file_exists( - APPLICATION_PATH . DS . 'language' . - DS . $langId . DS . 'lang.php' + APPLICATION_PATH . '/language/' . $langId . '/lang.php' ) ); } @@ -197,9 +196,9 @@ class InstallController extends Zend_Controller_Action ->setToken($postData['pass']); if ($form->isValid($postData)) { $ini = new Msd_Ini(); - $ini->set('name', $postData['user'], '0'); - $ini->set('pass', md5($postData['pass']), '0'); - $ini->save(APPLICATION_PATH . DS . 'configs' . DS . 'users.ini'); + $ini->set('name', $postData['user'], 'user'); + $ini->set('pass', md5($postData['pass']), 'user'); + $ini->saveFile(APPLICATION_PATH . '/configs/users.ini'); $redirectUrl = $this->view->url(array('controller' => 'install', 'action' => 'step4'), null, true); $this->_response->setRedirect($redirectUrl); } @@ -288,8 +287,8 @@ class InstallController extends Zend_Controller_Action $lang = Msd_Language::getInstance(); $version = new Msd_Version(); $files = array( - 'lang' => ':language' . DS . 'lang.php', - 'flag' => ':language' . DS . 'flag.gif' + 'lang' => ':language/lang.php', + 'flag' => ':language/flag.gif' ); if ($language === null) { if (!isset($_SESSION['langlist'])) { @@ -305,8 +304,7 @@ class InstallController extends Zend_Controller_Action return; } $update = new Msd_Update( - APPLICATION_PATH . DS . 'configs' . - DS . 'update.ini' + APPLICATION_PATH . '/configs/update.ini' ); $update->setUpdateParam('language', $language); $update->setUpdateParam('version', $version->getMsdVersion()); diff --git a/application/views/helpers/GetIcon.php b/application/views/helpers/GetIcon.php index a326862..13b7c73 100644 --- a/application/views/helpers/GetIcon.php +++ b/application/views/helpers/GetIcon.php @@ -73,8 +73,8 @@ class Msd_View_Helper_GetIcon extends Zend_View_Helper_Abstract if (!$icons) { $config = Msd_Configuration::getInstance(); $file = realpath( - APPLICATION_PATH . DS . '..' . DS . 'public' - . DS . $config->get('paths.iconpath') . DS . 'icon.ini' + APPLICATION_PATH . '/../public/' + . $config->get('paths.iconpath') . '/icon.ini' ); $iconsIni = new Zend_Config_Ini($file, 'icons'); $icons = $iconsIni->toArray(); diff --git a/application/views/helpers/GetIconSrc.php b/application/views/helpers/GetIconSrc.php index bfb5d94..df90277 100644 --- a/application/views/helpers/GetIconSrc.php +++ b/application/views/helpers/GetIconSrc.php @@ -67,8 +67,8 @@ class Msd_View_Helper_GetIconSrc extends Zend_View_Helper_Abstract if (!$icons) { $config = Msd_Configuration::getInstance(); $file = realpath( - APPLICATION_PATH . DS . '..' . DS . 'public' - . DS . $config->get('paths.iconpath') . DS .'icon.ini' + APPLICATION_PATH . '/../public/' + . $config->get('paths.iconpath') . '/icon.ini' ); $iconsIni = new Zend_Config_Ini($file, 'icons'); $icons = $iconsIni->toArray(); diff --git a/application/views/scripts/install/index.phtml b/application/views/scripts/install/index.phtml index feeb908..119cf18 100644 --- a/application/views/scripts/install/index.phtml +++ b/application/views/scripts/install/index.phtml @@ -2,7 +2,7 @@ $currentLanguage = $this->language; $fallbackLanguage = $currentLanguage; $languages = $this->languages; -$baseLangFile = APPLICATION_PATH . DS . 'language' . DS . '%s' . DS . 'lang.php'; +$baseLangFile = APPLICATION_PATH . '/language/%s/lang.php'; ?>