2011-06-10 21:55:32 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* This file is part of MySQLDumper released under the GNU/GPL 2 license
|
|
|
|
* http://www.mysqldumper.net
|
|
|
|
*
|
2012-08-08 22:36:28 +00:00
|
|
|
* @package MySQLDumper
|
|
|
|
* @version SVN: $Rev$
|
|
|
|
* @author $Author$
|
2011-06-10 21:55:32 +00:00
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* Bootstrap class
|
|
|
|
*
|
2012-08-08 22:36:28 +00:00
|
|
|
* @package MySQLDumper
|
2011-06-10 21:55:32 +00:00
|
|
|
*/
|
|
|
|
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|
|
|
{
|
|
|
|
public function _initActionHelpers()
|
|
|
|
{
|
|
|
|
Zend_Controller_Action_HelperBroker::addHelper(
|
|
|
|
new Msd_Action_Helper_AssignConfigAndLanguage()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Start session
|
|
|
|
*
|
2012-08-08 22:36:28 +00:00
|
|
|
* Anything else is set in configs/application.ini
|
2011-06-10 21:55:32 +00:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function _initApplication()
|
|
|
|
{
|
|
|
|
Zend_Session::setOptions(array('strict' => true));
|
|
|
|
Zend_Session::start();
|
2012-08-05 17:05:08 +00:00
|
|
|
|
|
|
|
// check if server has magic quotes enabled and normalize params
|
2012-08-08 22:36:28 +00:00
|
|
|
if ((function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() == 1)) {
|
|
|
|
$_POST = Bootstrap::stripSlashesDeep($_POST);
|
2012-08-05 17:05:08 +00:00
|
|
|
}
|
|
|
|
|
2011-06-10 21:55:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-08-04 10:40:48 +00:00
|
|
|
* Initialize configuration.
|
2011-06-10 21:55:32 +00:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2012-08-04 10:40:48 +00:00
|
|
|
public function _initConfiguration()
|
|
|
|
{
|
2012-08-21 20:22:56 +00:00
|
|
|
$dynamicConfig = Msd_Registry::getDynamicConfig();
|
|
|
|
if ($dynamicConfig === null) {
|
|
|
|
$dynamicConfig = new Msd_Config_Dynamic();
|
|
|
|
}
|
|
|
|
$configFile = $dynamicConfig->getParam('configFile', 'defaultConfig.ini');
|
2012-08-08 22:36:28 +00:00
|
|
|
Msd_Registry::setConfigFilename($configFile);
|
2012-08-21 20:22:56 +00:00
|
|
|
$config = new Msd_Config(
|
2012-08-05 17:05:08 +00:00
|
|
|
'Default',
|
2012-08-21 20:22:56 +00:00
|
|
|
array('directories' => array(
|
|
|
|
realpath(APPLICATION_PATH . '/../work/config'),
|
|
|
|
realpath(APPLICATION_PATH . '/configs')
|
|
|
|
)
|
|
|
|
)
|
2012-08-05 17:05:08 +00:00
|
|
|
);
|
|
|
|
$config->load($configFile);
|
2012-08-04 17:09:48 +00:00
|
|
|
Msd_Registry::setConfig($config);
|
2012-08-05 17:05:08 +00:00
|
|
|
Msd_Registry::setDynamicConfig($dynamicConfig);
|
2012-08-04 10:40:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Un-quote a string or array
|
|
|
|
*
|
|
|
|
* @param string|array $value The value to strip
|
|
|
|
*
|
|
|
|
* @return string|array
|
|
|
|
*/
|
2012-08-08 22:36:28 +00:00
|
|
|
public static function stripSlashesDeep($value)
|
2011-06-10 21:55:32 +00:00
|
|
|
{
|
2012-08-08 22:36:28 +00:00
|
|
|
$value = is_array($value) ? array_map(array('Bootstrap', 'stripSlashesDeep'), $value) : stripslashes($value);
|
2012-08-04 10:40:48 +00:00
|
|
|
return $value;
|
2011-06-10 21:55:32 +00:00
|
|
|
}
|
2012-08-04 10:40:48 +00:00
|
|
|
|
2011-06-10 21:55:32 +00:00
|
|
|
}
|