1
0
Fork 0
MySQLDumper/application/Bootstrap.php
DSB 0841d9a7a3 Continued to switch the old configuration handling to the new one.
The configuration now is saved again.
(Installer is still to do)

QA
2012-08-05 17:05:08 +00:00

74 Zeilen
1,9 KiB
PHP

<?php
/**
* This file is part of MySQLDumper released under the GNU/GPL 2 license
* http://www.mysqldumper.net
*
* @package MySQLDumper
* @version SVN: $Rev$
* @author $Author$
*/
/**
* Bootstrap class
*
* @package MySQLDumper
*/
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
public function _initActionHelpers()
{
Zend_Controller_Action_HelperBroker::addHelper(
new Msd_Action_Helper_AssignConfigAndLanguage()
);
}
/**
* Start session
*
* Anyhing else is set in configs/application.ini
*
* @return void
*/
public function _initApplication()
{
Zend_Session::setOptions(array('strict' => true));
Zend_Session::start();
// check if server has magic quotes enabled and normalize params
if ( (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() == 1)) {
$_POST = Bootstrap::stripslashes_deep($_POST);
}
}
/**
* Initialize configuration.
*
* @return void
*/
public function _initConfiguration()
{
$dynamicConfig = new Msd_Config_Dynamic();
$configFile = $dynamicConfig->getParam('configFile', 'mysqldumper.ini');
$config = new Msd_Config(
'Default',
array('directories' => realpath(APPLICATION_PATH . '/../work/config'))
);
$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;
}
}