1
0
Fork 0

Implemented new Configuration handling

Dieser Commit ist enthalten in:
DSB 2012-08-04 10:40:48 +00:00
Ursprung 6cfb97b401
Commit edc44e2f30
22 geänderte Dateien mit 730 neuen und 107 gelöschten Zeilen

Datei anzeigen

@ -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;
}
}

Datei anzeigen

@ -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"

Datei anzeigen

@ -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"

Datei anzeigen

@ -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();

Datei anzeigen

@ -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());

Datei anzeigen

@ -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();

Datei anzeigen

@ -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();

Datei anzeigen

@ -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';
?>
<script type="text/javascript">
function changeLang(lang)