Continued to switch the old configuration handling to the new one.
Dieser Commit ist enthalten in:
Ursprung
025b5c339d
Commit
ae87af916f
54 geänderte Dateien mit 501 neuen und 269 gelöschten Zeilen
|
@ -41,16 +41,22 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||
*/
|
||||
public function _initConfiguration()
|
||||
{
|
||||
$dynamicConfig = Msd_Registry::getDynamicConfig();
|
||||
if ($dynamicConfig === null) {
|
||||
$dynamicConfig = new Msd_Config_Dynamic();
|
||||
Msd_Registry::setDynamicConfig($dynamicConfig);
|
||||
}
|
||||
|
||||
$config = Msd_Registry::getConfig();
|
||||
if ($config === null) {
|
||||
$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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* @package MySQLDumper
|
||||
* @subpackage Controllers
|
||||
*/
|
||||
class ConfigController extends Zend_Controller_Action
|
||||
class ConfigController extends Msd_Controller_Action
|
||||
{
|
||||
/**
|
||||
* Active jQuery tab Id
|
||||
|
@ -61,7 +61,7 @@ class ConfigController extends Zend_Controller_Action
|
|||
$formGeneral = $this->_getSubformIni('general');
|
||||
$elementTitle = $formGeneral->getElement('title');
|
||||
$elementTitle->setValue(
|
||||
$this->view->config->get('config.general.title')
|
||||
$this->view->config->getParam('general.title')
|
||||
);
|
||||
|
||||
$form->addSubForm($formGeneral, 'general');
|
||||
|
@ -184,9 +184,9 @@ class ConfigController extends Zend_Controller_Action
|
|||
|
||||
// set dynamic actual database if it's changed in the panel
|
||||
if ($this->_request->isPost()) {
|
||||
$actualDb = $this->view->config->get('dynamic.dbActual');
|
||||
$actualDb = $this->view->dynamicConfig->getParam('dbActual');
|
||||
if (isset($_POST['defaultDb']) && ($_POST['defaultDb'] != $actualDb)) {
|
||||
$this->view->config->set('dynamic.dbActual', $_POST['defaultDb']);
|
||||
$this->view->dynamicConfig->setParam('dbActual', $_POST['defaultDb']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ class ConfigController extends Zend_Controller_Action
|
|||
*/
|
||||
public function addRecipientCcAction()
|
||||
{
|
||||
$recipientsCc = $this->view->config->get('config.email.RecipientCc');
|
||||
$recipientsCc = $this->view->config->Param('email.RecipientCc');
|
||||
if ($recipientsCc === null) {
|
||||
$recipientsCc = array();
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ class ConfigController extends Zend_Controller_Action
|
|||
$recipientsCc[$index]['Name'] = '';
|
||||
$recipientsCc[$index]['Address'] = '';
|
||||
$recipientsCc = array_values($recipientsCc);
|
||||
$this->view->config->set('config.email.RecipientCc', $recipientsCc);
|
||||
$this->view->config->setParam('email.RecipientCc', $recipientsCc);
|
||||
$this->_forward('index');
|
||||
}
|
||||
|
||||
|
@ -234,11 +234,11 @@ class ConfigController extends Zend_Controller_Action
|
|||
public function deleteRecipientCcAction()
|
||||
{
|
||||
$recipientToDelete = (int)$this->_request->getPost('param');
|
||||
$recipientsCc = $this->view->config->get('config.email.RecipientCc');
|
||||
$recipientsCc = $this->view->config->getParam('email.RecipientCc');
|
||||
if (isset($recipientsCc[$recipientToDelete])) {
|
||||
unset($recipientsCc[$recipientToDelete]);
|
||||
}
|
||||
$this->view->config->set('config.email.RecipientCc', $recipientsCc);
|
||||
$this->view->config->setParam('email.RecipientCc', $recipientsCc);
|
||||
$this->_forward('index');
|
||||
}
|
||||
|
||||
|
@ -249,18 +249,15 @@ class ConfigController extends Zend_Controller_Action
|
|||
*/
|
||||
public function addFtpConnectionAction()
|
||||
{
|
||||
$ftpConfig = $this->view->config->get('config.ftp');
|
||||
$ftpConfig = $this->view->config->getParam('ftp');
|
||||
$index = 0;
|
||||
if (!empty($ftpConfig)) {
|
||||
$index = max(array_keys($ftpConfig)) + 1;
|
||||
}
|
||||
$default = $this->view->config->loadConfiguration(
|
||||
'defaultConfig',
|
||||
false
|
||||
);
|
||||
$default = $this->view->config->load('defaultConfig');
|
||||
$default = $default->toArray();
|
||||
$ftpConfig[$index] = $default['ftp'][0];
|
||||
$this->view->config->set('config.ftp', $ftpConfig);
|
||||
$this->view->config->Param('ftp', $ftpConfig);
|
||||
$this->_forward('index');
|
||||
}
|
||||
|
||||
|
@ -272,13 +269,13 @@ class ConfigController extends Zend_Controller_Action
|
|||
public function deleteFtpConnectionAction()
|
||||
{
|
||||
$index = (int)$this->_request->getPost('param');
|
||||
$ftpConfig = $this->view->config->get('config.ftp');
|
||||
$ftpConfig = $this->view->config->getParam('ftp');
|
||||
if (count($ftpConfig) > 1) {
|
||||
if (isset($ftpConfig[$index])) {
|
||||
unset($ftpConfig[$index]);
|
||||
sort($ftpConfig);
|
||||
}
|
||||
$this->view->config->set('config.ftp', $ftpConfig);
|
||||
$this->view->config->setParam('ftp', $ftpConfig);
|
||||
}
|
||||
$this->_forward('index');
|
||||
}
|
||||
|
@ -403,7 +400,7 @@ class ConfigController extends Zend_Controller_Action
|
|||
foreach ($elements as $element) {
|
||||
$element = str_replace($group . '_', '', $element);
|
||||
$element = str_replace('_', '.', $element);
|
||||
$value = $this->view->config->get('config.' . $group . '.' . $element);
|
||||
$value = $this->view->config->getParam($group . '.' . $element);
|
||||
if ($value !== null) {
|
||||
$subForm->setDefault($element, $value);
|
||||
}
|
||||
|
@ -455,8 +452,7 @@ class ConfigController extends Zend_Controller_Action
|
|||
*/
|
||||
private function _addNonConfigurableConfigParams($configData)
|
||||
{
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$configData['systemDatabases'] = $config->get('config.systemDatabases');
|
||||
$configData['systemDatabases'] = $this->view->config->getParam('systemDatabases');
|
||||
return $configData;
|
||||
}
|
||||
|
||||
|
@ -479,7 +475,7 @@ class ConfigController extends Zend_Controller_Action
|
|||
$smtpConfig = $emailForm->getDisplayGroup('smtpConfig');
|
||||
$sendmailVisibility = false;
|
||||
$smtpVisibility = false;
|
||||
switch ($this->view->config->get('config.email.Program')) {
|
||||
switch ($this->view->config->getParam('email.Program')) {
|
||||
case 'sendmail':
|
||||
$sendmailVisibility = true;
|
||||
break;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* @package MySQLDumper
|
||||
* @subpackage Controllers
|
||||
*/
|
||||
class DumpController extends Zend_Controller_Action
|
||||
class DumpController extends Msd_Controller_Action
|
||||
{
|
||||
/**
|
||||
* Show dump page
|
||||
|
@ -46,7 +46,6 @@ class DumpController extends Zend_Controller_Action
|
|||
{
|
||||
$taskList = Msd_TaskManager::getInstance('backupTasks');
|
||||
$tasks = $taskList->getTasks();
|
||||
$this->view->config = Msd_Configuration::getInstance();
|
||||
$this->view->sessionId = Zend_Session::getId();
|
||||
}
|
||||
|
||||
|
@ -63,7 +62,7 @@ class DumpController extends Zend_Controller_Action
|
|||
$tasks = $taskList->getTasks();
|
||||
$ret = array(
|
||||
'backup_in_progress' => false,
|
||||
'config_file' => $this->view->config->get('dynamic.configFile')
|
||||
'config_file' => $this->view->dynamicConfig->getParam('configFile')
|
||||
|
||||
);
|
||||
echo json_encode($ret);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* @package MySQLDumper
|
||||
* @subpackage Controllers
|
||||
*/
|
||||
class FilesController extends Zend_Controller_Action
|
||||
class FilesController extends Msd_Controller_Action
|
||||
{
|
||||
|
||||
public function indexAction()
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* @package MySQLDumper
|
||||
* @subpackage Controllers
|
||||
*/
|
||||
class IndexController extends Zend_Controller_Action
|
||||
class IndexController extends Msd_Controller_Action
|
||||
{
|
||||
/**
|
||||
* Remember last controler
|
||||
|
@ -70,12 +70,11 @@ class IndexController extends Zend_Controller_Action
|
|||
}
|
||||
$data['mysqlServerVersion'] = $dbo->getServerInfo();
|
||||
$data['mysqlClientVersion'] = $dbo->getClientInfo();
|
||||
$data['serverMaxExecutionTime'] =
|
||||
(int)@get_cfg_var('max_execution_time');
|
||||
$data['serverMaxExecutionTime'] = (int)@get_cfg_var('max_execution_time');
|
||||
$this->view->assign($data);
|
||||
if ($this->view->config->get('dynamic.dbActual') == '') {
|
||||
if ($this->view->dynamicConfig->getParam('dbActual', '') == '') {
|
||||
$dbNames = $dbo->getDatabaseNames();
|
||||
$this->view->config->set('dynamic.dbActual', $dbNames[0]);
|
||||
$this->view->dynamicConfig->setParam('dbActual', $dbNames[0]);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$configNames = Msd_File::getConfigNames();
|
||||
|
@ -113,8 +112,8 @@ class IndexController extends Zend_Controller_Action
|
|||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
$request = $this->getRequest();
|
||||
$file = base64_decode($request->getParam('selectedConfig'));
|
||||
$this->view->config = Msd_Configuration::getInstance();
|
||||
$this->view->config->loadConfiguration($file);
|
||||
$this->_config->load($file);
|
||||
$this->view->config->load($file);
|
||||
if ($this->_lastAction != 'switchconfig') { //prevent endless loop
|
||||
$this->_forward($this->_lastAction, $this->_lastController);
|
||||
}
|
||||
|
@ -130,7 +129,7 @@ class IndexController extends Zend_Controller_Action
|
|||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
$request = $this->getRequest();
|
||||
$selectedDb = base64_decode($request->getParam('selectedDb'));
|
||||
$this->view->config->set('dynamic.dbActual', $selectedDb);
|
||||
$this->view->dynamicConfig->setParam('dbActual', $selectedDb);
|
||||
if ($this->_lastAction != 'selectdb') { //prevent endless loop
|
||||
$redirectUrl = $this->view->url(
|
||||
array(
|
||||
|
@ -154,11 +153,11 @@ class IndexController extends Zend_Controller_Action
|
|||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
$dbo = Msd_Db::getAdapter();
|
||||
$databases = $dbo->getDatabaseNames();
|
||||
$this->view->config->set('dynamic.databases', $databases);
|
||||
$actualDb = $this->view->config->get('dynamic.dbActual');
|
||||
$this->view->dynamicConfig->setParam('databases', $databases);
|
||||
$actualDb = $this->view->dynamicConfig->getParam('dbActual');
|
||||
if ($dbo->selectDb($actualDb) !== true) {
|
||||
//actual db is no longer available -> switch to first one
|
||||
$this->view->config->set('dynamic.dbActual', $databases[0]);
|
||||
$this->view->dynamicConfig->setParam('dbActual', $databases[0]);
|
||||
}
|
||||
if ($this->_lastAction != 'refreshdb') { //prevent endless loop
|
||||
$redirectUrl = $this->view->url(
|
||||
|
@ -248,16 +247,12 @@ class IndexController extends Zend_Controller_Action
|
|||
// user is not listed in users.ini
|
||||
break;
|
||||
case Msd_User::SUCCESS:
|
||||
$defaultDb = $this->view->config->get(
|
||||
'config.dbuser.defaultDb'
|
||||
$defaultDb = $this->view->config->getParam('dbuser.defaultDb'
|
||||
);
|
||||
|
||||
// set actualDb to defaultDb
|
||||
if ($defaultDb != '') {
|
||||
$this->view->config->set(
|
||||
'dynamic.dbActual',
|
||||
$defaultDb
|
||||
);
|
||||
$this->view->dynamicConfig->setParam('dbActual', $defaultDb);
|
||||
}
|
||||
$this->_doRedirect(
|
||||
array(
|
||||
|
|
|
@ -143,7 +143,7 @@ class InstallController extends Zend_Controller_Action
|
|||
'config' => $config->get('paths.config'),
|
||||
'log' => $config->get('paths.log'),
|
||||
'backup' => $config->get('paths.backup'),
|
||||
'iconpath' => $config->get('paths.iconpath')
|
||||
'iconpath' => $config->get('paths.iconPath')
|
||||
);
|
||||
|
||||
foreach ($checkDirs as $checkDir) {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* @package MySQLDumper
|
||||
* @subpackage Controllers
|
||||
*/
|
||||
class LogController extends Zend_Controller_Action
|
||||
class LogController extends Msd_Controller_Action
|
||||
{
|
||||
/**
|
||||
* Delete a log file
|
||||
|
@ -78,7 +78,7 @@ class LogController extends Zend_Controller_Action
|
|||
$reverse = $this->_getParam('reverse', 0);
|
||||
$page = $this->_getParam('offset', 1);
|
||||
$entriesPerPage =
|
||||
$this->view->config->get('config.interface.recordsPerPage');
|
||||
$this->view->config->getParam('interface.recordsPerPage');
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$logger = Msd_Log::getInstance();
|
||||
$lines = $logger->read($logType, $reverse);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* @package MySQLDumper
|
||||
* @subpackage Controllers
|
||||
*/
|
||||
class RestoreController extends Zend_Controller_Action
|
||||
class RestoreController extends Msd_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* @package MySQLDumper
|
||||
* @subpackage Controllers
|
||||
*/
|
||||
class SqlController extends Zend_Controller_Action
|
||||
class SqlController extends Msd_Controller_Action
|
||||
{
|
||||
/**
|
||||
* Db-handle
|
||||
|
@ -54,7 +54,7 @@ class SqlController extends Zend_Controller_Action
|
|||
$this->_helper->viewRenderer('databases/show-databases');
|
||||
$databases = $this->_db->getDatabases(true);
|
||||
$dbNames = $this->_db->getDatabaseNames();
|
||||
$dbActual = $this->view->config->get('dynamic.dbActual');
|
||||
$dbActual = $this->view->dynamicConfig->getParam('dbActual');
|
||||
//Fallback to first found db if actual db doesn't exist
|
||||
if (!in_array($dbActual, $dbNames)) {
|
||||
$dbActual = $dbNames[0];
|
||||
|
@ -72,13 +72,11 @@ class SqlController extends Zend_Controller_Action
|
|||
{
|
||||
$this->_helper->viewRenderer('tables/show-tables');
|
||||
$pageNum = $this->_getParam('offset', 1);
|
||||
$itemCountPerPage = $this->view->config->get(
|
||||
'config.interface.recordsPerPage'
|
||||
);
|
||||
$itemCountPerPage = $this->view->config->getParam('interface.recordsPerPage');
|
||||
|
||||
$dbActual = $this->_getParam(
|
||||
'database',
|
||||
$this->view->config->get('dynamic.dbActual')
|
||||
$this->view->dynamicConfig->getParam('dbActual')
|
||||
);
|
||||
if ($this->_getParam('dbName') !== null) {
|
||||
$dbActual = base64_decode($this->_getParam('dbName'));
|
||||
|
@ -106,11 +104,11 @@ class SqlController extends Zend_Controller_Action
|
|||
public function showTableDataAction()
|
||||
{
|
||||
$this->_getDynamicParams();
|
||||
$dbName = $this->view->config->get('dynamic.dbActual');
|
||||
$dbName = $this->view->dynamicConfig->getParam('dbActual');
|
||||
$offset = (int)$this->_getParam('offset', 0);
|
||||
$limit = $this->view->config->get('config.interface.recordsPerPage');
|
||||
$limit = $this->view->config->getParam('interface.recordsPerPage');
|
||||
$this->_db->selectDb($dbName);
|
||||
$tableName = $this->view->config->get('dynamic.tableActual');
|
||||
$tableName = $this->view->dynamicConfig->getParam('tableActual');
|
||||
try {
|
||||
$this->view->columns = $this->_db->getTableColumns($tableName);
|
||||
$tables = $this->_db->getTableStatus($tableName);
|
||||
|
@ -127,7 +125,7 @@ class SqlController extends Zend_Controller_Action
|
|||
$tableName = '';
|
||||
}
|
||||
}
|
||||
$this->view->config->set('dynamic.tableActual', $tableName);
|
||||
$this->view->dynamicConfig->setParam('tableActual', $tableName);
|
||||
if (!empty($tables)) {
|
||||
$query = sprintf(
|
||||
'SELECT SQL_CALC_FOUND_ROWS * FROM `%s` LIMIT %s, %s',
|
||||
|
@ -253,7 +251,7 @@ class SqlController extends Zend_Controller_Action
|
|||
$tables = $this->_request->getParam('tables', array());
|
||||
$optimizeResults = array();
|
||||
$this->view->action = $this->view->lang->L_OPTIMIZE;
|
||||
$database = $this->view->config->get('dynamic.dbActual');
|
||||
$database = $this->view->dynamicConfig->getParam('dbActual');
|
||||
$this->_db->selectDb($database);
|
||||
if ($this->_request->isPost() && !empty($tables)) {
|
||||
|
||||
|
@ -278,7 +276,7 @@ class SqlController extends Zend_Controller_Action
|
|||
$tables = $this->_request->getParam('tables', array());
|
||||
$analyzeResults = array();
|
||||
$this->view->action = $this->view->lang->L_ANALYZE;
|
||||
$database = $this->view->config->get('dynamic.dbActual');
|
||||
$database = $this->view->dynamicConfig->getParam('dbActual');
|
||||
$this->_db->selectDb($database);
|
||||
if ($this->_request->isPost() && !empty($tables)) {
|
||||
|
||||
|
@ -303,7 +301,7 @@ class SqlController extends Zend_Controller_Action
|
|||
$tables = $this->_request->getParam('tables', array());
|
||||
$analyzeResults = array();
|
||||
$this->view->action = $this->view->lang->L_ANALYZE;
|
||||
$database = $this->view->config->get('dynamic.dbActual');
|
||||
$database = $this->view->dynamicConfig->getParam('dbActual');
|
||||
$this->_db->selectDb($database);
|
||||
if ($this->_request->isPost() && !empty($tables)) {
|
||||
|
||||
|
@ -328,7 +326,7 @@ class SqlController extends Zend_Controller_Action
|
|||
$tables = $this->_request->getParam('tables', array());
|
||||
$analyzeResults = array();
|
||||
$this->view->action = $this->view->lang->L_ANALYZE;
|
||||
$database = $this->view->config->get('dynamic.dbActual');
|
||||
$database = $this->view->dynamicConfig->getParam('dbActual');
|
||||
$this->_db->selectDb($database);
|
||||
if ($this->_request->isPost() && !empty($tables)) {
|
||||
|
||||
|
@ -353,7 +351,7 @@ class SqlController extends Zend_Controller_Action
|
|||
$tables = $this->_request->getParam('tables', array());
|
||||
$truncateResults = array();
|
||||
$this->view->action = $this->view->lang->L_TRUNCATE;
|
||||
$database = $this->view->config->get('dynamic.dbActual');
|
||||
$database = $this->view->dynamicConfig->getParam('dbActual');
|
||||
$this->_db->selectDb($database);
|
||||
if ($this->_request->isPost() && !empty($tables)) {
|
||||
|
||||
|
@ -377,17 +375,17 @@ class SqlController extends Zend_Controller_Action
|
|||
$sqlboxModel = new Application_Model_Sqlbox();
|
||||
$this->view->tableSelectBox = $sqlboxModel->getTableSelectBox();
|
||||
$request = $this->getRequest();
|
||||
$config = $this->view->config;
|
||||
$dynamicConfig = $this->view->dynamicConfig;
|
||||
$query = '';
|
||||
if ($lastQuery = $config->get('dynamic.sqlboxQuery')) {
|
||||
if ($lastQuery = $dynamicConfig->getParam('sqlboxQuery')) {
|
||||
$query = $lastQuery;
|
||||
}
|
||||
if ($request->isPost()) {
|
||||
$query = $request->getParam('sqltextarea', '');
|
||||
$config->set('dynamic.sqlboxQuery', $query);
|
||||
$dynamicConfig->setParam('sqlboxQuery', $query);
|
||||
$query = trim($query);
|
||||
if ($query > '') {
|
||||
$this->_db->selectDb($config->get('dynamic.dbActual'));
|
||||
$this->_db->selectDb($dynamicConfig->getParam('dbActual'));
|
||||
$sqlObject = new Msd_Sql_Object($query);
|
||||
$parser = new Msd_Sql_Parser($sqlObject, true);
|
||||
$parser->parse();
|
||||
|
@ -430,7 +428,7 @@ class SqlController extends Zend_Controller_Action
|
|||
private function _refreshDbList()
|
||||
{
|
||||
$databases = $this->_db->getDatabaseNames();
|
||||
$this->view->config->set('dynamic.databases', $databases);
|
||||
$this->view->dynamicConfig->setParam('databases', $databases);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -444,10 +442,10 @@ class SqlController extends Zend_Controller_Action
|
|||
private function _setDynamicParams($dbActual = false, $tableActual = '')
|
||||
{
|
||||
if ($dbActual === false) {
|
||||
$dbActual = $this->view->config->get('dynamic.dbActual');
|
||||
$dbActual = $this->view->dynamicConfig->getParam('dbActual');
|
||||
}
|
||||
$this->view->config->set('dynamic.dbActual', $dbActual);
|
||||
$this->view->config->set('dynamic.tableActual', $tableActual);
|
||||
$this->view->dynamicConfig->setParam('dbActual', $dbActual);
|
||||
$this->view->dynamicConfig->setParam('tableActual', $tableActual);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -460,12 +458,12 @@ class SqlController extends Zend_Controller_Action
|
|||
$params = $this->_request->getParams();
|
||||
if (isset($params['dbName'])) {
|
||||
$dbName = base64_decode($params['dbName']);
|
||||
$this->view->config->set('dynamic.dbActual', $dbName);
|
||||
$this->view->dynamicConfig->setParam('dbActual', $dbName);
|
||||
}
|
||||
|
||||
if (isset($params['tableName'])) {
|
||||
$dbName = base64_decode($params['tableName']);
|
||||
$this->view->config->set('dynamic.tableActual', $dbName);
|
||||
$this->view->dynamicConfig->setParam('tableActual', $dbName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* @package MySQLDumper
|
||||
* @subpackage Controllers
|
||||
*/
|
||||
class SqlServerController extends Zend_Controller_Action
|
||||
class SqlServerController extends Msd_Controller_Action
|
||||
{
|
||||
/**
|
||||
* Init
|
||||
|
|
|
@ -36,7 +36,7 @@ class Application_Form_Config_Email extends Zend_Form_SubForm
|
|||
*/
|
||||
public function init()
|
||||
{
|
||||
$this->_config = Msd_Configuration::getInstance();
|
||||
$this->_config = Msd_Registry::getConfig();
|
||||
$this->_lang = Msd_Language::getInstance();
|
||||
$this->setDisableLoadDefaultDecorators(true);
|
||||
$this->setDecorators(array('SubForm'));
|
||||
|
@ -58,7 +58,7 @@ class Application_Form_Config_Email extends Zend_Form_SubForm
|
|||
|
||||
// add Recipients CC
|
||||
$ccElements = $this->_setRecipientCc(
|
||||
$this->_config->get('config.email.RecipientCc'),
|
||||
$this->_config->getParam('email.RecipientCc'),
|
||||
$activateValidator
|
||||
);
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class Application_Form_Config_Ftp extends Zend_Form_SubForm
|
|||
*/
|
||||
public function init()
|
||||
{
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$config = Msd_Registry::getConfig();
|
||||
$this->_lang = Msd_Language::getInstance();
|
||||
$this->setDisableLoadDefaultDecorators(true);
|
||||
$this->setDecorators(array('SubForm'));
|
||||
|
@ -40,7 +40,7 @@ class Application_Form_Config_Ftp extends Zend_Form_SubForm
|
|||
$this->setDisplayGroupDecorators(array('DisplayGroup'));
|
||||
$this->_addButtonFtpAdd();
|
||||
|
||||
$ftpConfig = $config->get('config.ftp');
|
||||
$ftpConfig = $config->getParam('ftp');
|
||||
$ftpKeys = array_keys($ftpConfig);
|
||||
$nrOfFtpProfiles = count($ftpKeys, 1);
|
||||
foreach ($ftpKeys as $ftpConnectionId) {
|
||||
|
|
|
@ -51,7 +51,7 @@ class Application_Model_Config_FormValidator
|
|||
public function validate(Zend_View $view)
|
||||
{
|
||||
$saveConfig = false;
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$config = $view->config;
|
||||
$translator = Msd_Language::getInstance()->getTranslator();
|
||||
$db = Msd_Db::getAdapter($this->_configData['dbuser']);
|
||||
try {
|
||||
|
@ -73,13 +73,13 @@ class Application_Model_Config_FormValidator
|
|||
|
||||
if ($saveConfig) {
|
||||
$config->save(
|
||||
$config->get('dynamic.configFile'),
|
||||
$view->dynamicConfig->getParam('configFile'),
|
||||
$this->_configData
|
||||
);
|
||||
$view->popUpMessage()->addMessage(
|
||||
'save-config',
|
||||
'L_NOTICE',
|
||||
array('L_SAVE_SUCCESS', $config->get('dynamic.configFile')),
|
||||
array('L_SAVE_SUCCESS', $view->dynamicConfig->getParam('configFile')),
|
||||
array(
|
||||
'modal' => true,
|
||||
'dialogClass' => 'notice'
|
||||
|
|
|
@ -21,8 +21,8 @@ class Application_Model_Sqlbox
|
|||
public function getTableSelectBox()
|
||||
{
|
||||
$this->_db = Msd_Db::getAdapter();
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$db = $config->get('dynamic.dbActual');
|
||||
$dynamicConfig = Msd_Registry::getDynamicConfig();
|
||||
$db = $dynamicConfig->getParam('dbActual');
|
||||
$tableNames = $this->_db->getTables($db);
|
||||
$options = array();
|
||||
foreach ($tableNames as $table) {
|
||||
|
|
|
@ -19,8 +19,6 @@ class Msd_View_Helper_GetConfigTitle extends Zend_View_Helper_Abstract
|
|||
{
|
||||
public function getConfigTitle($configName)
|
||||
{
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$configData = $config->loadConfiguration($configName, false);
|
||||
return $configData->general->title;
|
||||
return $this->view->config->getConfigTitle($configName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ class Msd_View_Helper_GetIcon extends Zend_View_Helper_Abstract
|
|||
*/
|
||||
public function getIcon($name, $title='', $size='')
|
||||
{
|
||||
//return true;
|
||||
static $baseUrl = false;
|
||||
if (!$baseUrl) {
|
||||
$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
|
||||
|
@ -38,13 +39,12 @@ class Msd_View_Helper_GetIcon extends Zend_View_Helper_Abstract
|
|||
'GetIcon: unknown icon \''.$name .'\' requested'
|
||||
);
|
||||
}
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$img = '<img src="'.$baseUrl.'/%s/%s" alt="%s" title="%s" />';
|
||||
if ($size>'') {
|
||||
$img = '<img src="'.$baseUrl.'/%s/%sx%s/%s" alt="%s" title="%s" />';
|
||||
$ret = sprintf(
|
||||
$img,
|
||||
$config->get('paths.iconpath'),
|
||||
$this->view->config->getParam('paths.iconPath'),
|
||||
$size,
|
||||
$size,
|
||||
$icons[$name],
|
||||
|
@ -53,7 +53,7 @@ class Msd_View_Helper_GetIcon extends Zend_View_Helper_Abstract
|
|||
} else {
|
||||
$ret = sprintf(
|
||||
$img,
|
||||
$config->get('paths.iconpath'),
|
||||
$this->view->config->getParam('paths.iconPath'),
|
||||
$icons[$name],
|
||||
$title,
|
||||
$title
|
||||
|
@ -71,10 +71,10 @@ class Msd_View_Helper_GetIcon extends Zend_View_Helper_Abstract
|
|||
{
|
||||
static $icons = false;
|
||||
if (!$icons) {
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$config = $this->view->config;
|
||||
$file = realpath(
|
||||
APPLICATION_PATH . '/../public/'
|
||||
. $config->get('paths.iconpath') . '/icon.ini'
|
||||
. $config->getParam('paths.iconPath') . '/icon.ini'
|
||||
);
|
||||
$iconsIni = new Zend_Config_Ini($file, 'icons');
|
||||
$icons = $iconsIni->toArray();
|
||||
|
|
|
@ -37,20 +37,20 @@ class Msd_View_Helper_GetIconSrc extends Zend_View_Helper_Abstract
|
|||
'GetIconSrc: unknown icon \''.$name . '\' requested'
|
||||
);
|
||||
}
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$config = Msd_Registry::getConfig();
|
||||
$img = $baseUrl.'/%s/%s';
|
||||
if ($size>'') {
|
||||
$img = $baseUrl.'/%s/%sx%s/%s';
|
||||
$ret = sprintf(
|
||||
$img,
|
||||
$config->get('paths.iconpath'),
|
||||
$config->getParam('paths.iconPath'),
|
||||
$size,
|
||||
$size,
|
||||
$icons[$name]
|
||||
);
|
||||
} else {
|
||||
$ret = sprintf(
|
||||
$img, $config->get('paths.iconpath'), $icons[$name]
|
||||
$img, $config->getParam('paths.iconPath'), $icons[$name]
|
||||
);
|
||||
}
|
||||
return $ret;
|
||||
|
@ -65,10 +65,10 @@ class Msd_View_Helper_GetIconSrc extends Zend_View_Helper_Abstract
|
|||
{
|
||||
static $icons = false;
|
||||
if (!$icons) {
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$config = Msd_Registry::getConfig();
|
||||
$file = realpath(
|
||||
APPLICATION_PATH . '/../public/'
|
||||
. $config->get('paths.iconpath') . '/icon.ini'
|
||||
. $config->getParam('paths.iconPath') . '/icon.ini'
|
||||
);
|
||||
$iconsIni = new Zend_Config_Ini($file, 'icons');
|
||||
$icons = $iconsIni->toArray();
|
||||
|
|
|
@ -53,15 +53,15 @@ class Msd_View_Helper_Menu extends Zend_View_Helper_Abstract
|
|||
*/
|
||||
private function _getDatabases()
|
||||
{
|
||||
$actualDb = $this->view->config->get('dynamic.dbActual');
|
||||
$databases = $this->view->config->get('dynamic.databases');
|
||||
$actualDb = $this->view->dynamicConfig->getParam('dbActual');
|
||||
$databases = $this->view->dynamicConfig->getParam('databases', array());
|
||||
$dbo = Msd_Db::getAdapter();
|
||||
if (empty($databases) || $dbo->selectDb($actualDb) !== true) {
|
||||
// couldn't connect to db - refresh db-list
|
||||
$databases = $dbo->getDatabaseNames();
|
||||
// if database was deleted or is not accessible by user
|
||||
// fallback to default db
|
||||
$defaultDb = $this->view->config->get('config.dbuser.defaultDb');
|
||||
$defaultDb = $this->view->config->getParam('dbuser.defaultDb');
|
||||
if ($defaultDb != '') {
|
||||
$actualDb = $defaultDb;
|
||||
if ($dbo->selectDb($actualDb) !== true) {
|
||||
|
@ -70,8 +70,8 @@ class Msd_View_Helper_Menu extends Zend_View_Helper_Abstract
|
|||
$dbo->selectDb($actualDb);
|
||||
}
|
||||
}
|
||||
$this->view->config->set('dynamic.dbActual', $actualDb);
|
||||
$this->view->config->set('dynamic.databases', $databases);
|
||||
$this->view->dynamicConfig->setParam('dbActual', $actualDb);
|
||||
$this->view->dynamicConfig->setParam('databases', $databases);
|
||||
}
|
||||
return $databases;
|
||||
}
|
||||
|
|
|
@ -167,8 +167,7 @@ class Msd_View_Helper_PopUpMessage extends Zend_View_Helper_Abstract
|
|||
*/
|
||||
private function _getDefaultPosition()
|
||||
{
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$position = $config->get('config.interface.notificationWindowPosition');
|
||||
$position = $this->view->config->getParam('interface.notificationWindowPosition');
|
||||
if (isset($this->_positions[$position])) {
|
||||
$position = $this->_positions[$position];
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
$version = new Msd_Version();
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$config = Msd_Registry::getConfig();
|
||||
$lang = Msd_Language::getInstance();
|
||||
$theme = $config->get('config.interface.theme');
|
||||
$language = $config->get('config.interface.language');
|
||||
$theme = $config->getParam('interface.theme');
|
||||
$language = $config->getParam('interface.language');
|
||||
$this->headMeta()->appendHttpEquiv('content-language', $language);
|
||||
$this->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=utf-8')
|
||||
->appendHttpEquiv('expires', 'Wed, 26 Feb 1997 08:21:57 GMT')
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
|
||||
<?php
|
||||
$version = new Msd_Version();
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$config = Msd_Registry::getConfig();
|
||||
$lang = Msd_Language::getInstance();
|
||||
$theme = $config->get('config.interface.theme'); //@todo why theme?
|
||||
$language = $config->get('config.interface.language');
|
||||
$theme = $config->getParam('interface.theme'); //@todo why theme?
|
||||
$language = $config->getParam('interface.language');
|
||||
$this->headMeta()->appendHttpEquiv('content-language', $language);
|
||||
$this->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=utf-8')
|
||||
->appendHttpEquiv('expires', 'Wed, 26 Feb 1997 08:21:57 GMT')
|
||||
|
|
|
@ -146,7 +146,7 @@ $t = Msd_Language::getInstance()->getTranslator();
|
|||
<?php
|
||||
foreach ($this->databases as $db) {
|
||||
echo '<option value="'.base64_encode($db).'"';
|
||||
if ($db == $this->config->get('dynamic.dbActual')) {
|
||||
if ($db == $this->dynamicConfig->getParam('dbActual')) {
|
||||
echo ' selected="selected"';
|
||||
}
|
||||
echo '>'.$db.'</option>';
|
||||
|
@ -173,7 +173,7 @@ $t = Msd_Language::getInstance()->getTranslator();
|
|||
$this->configFiles = Msd_File::getConfigNames();
|
||||
foreach ($this->configFiles as $file) {
|
||||
echo "\n" . '<option value="' . base64_encode($file) . '"';
|
||||
if ($this->config->get('dynamic.configFile') == $file) {
|
||||
if ($this->dynamicConfig->getParam('configFile') == $file) {
|
||||
echo ' selected="selected"';
|
||||
}
|
||||
echo '>'.$this->getConfigTitle($file).'</option>';
|
||||
|
|
|
@ -109,11 +109,11 @@
|
|||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$dbs = $this->config->get('config.databases');
|
||||
$dbs = $this->config->getParam('databases');
|
||||
echo $this->partial(
|
||||
'config/databases/listDbs.phtml',
|
||||
array('databases' => $dbs,
|
||||
'dbActual' => $this->config->get('dynamic.dbActual'),
|
||||
'dbActual' => $this->dynamicConfig->getParam('dbActual'),
|
||||
'parent' => $this,
|
||||
)
|
||||
);
|
||||
|
|
|
@ -189,8 +189,8 @@ $testFtpConnectionUrl = $this->url(
|
|||
</script>
|
||||
|
||||
<div id="content">
|
||||
<h2><?php echo $this->lang->L_CONFIG_HEADLINE;?>: <?php echo $this->config->get('dynamic.configFile');?>
|
||||
<span class="small">(<?php echo $this->lang->L_MSD_MODE;?>: <?php echo $this->config->get('config.general.mode');?>)</span></h2>
|
||||
<h2><?php echo $this->lang->L_CONFIG_HEADLINE;?>: <?php echo $this->dynamicConfig->getParam('configFile');?>
|
||||
<span class="small">(<?php echo $this->lang->L_MSD_MODE;?>: <?php echo $this->config->getParam('general.mode');?>)</span></h2>
|
||||
<form method="post" action="<?php
|
||||
echo $this->url(
|
||||
array(
|
||||
|
@ -254,7 +254,7 @@ echo $this->url(
|
|||
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
<?php if (count((array) $this->config->get('dynamic.databases')) == 0): ?>
|
||||
<?php if (count((array) $this->dynamicConfig->getParam('databases')) == 0): ?>
|
||||
mySlideDown('connection-params');
|
||||
<?php endif; ?>
|
||||
/*]]>*/
|
||||
|
|
|
@ -6,7 +6,7 @@ $this->lang = $this->parent->lang;
|
|||
<td class="small"><?php echo $this->lang->L_SEND_MAIL_FORM?>:</td>
|
||||
<td class="small right">
|
||||
<?php
|
||||
if ($this->config->get('config.email.sendMail') == 0) {
|
||||
if ($this->config->getParam('email.sendMail') == 0) {
|
||||
echo $this->lang->L_NO;
|
||||
} else {
|
||||
echo $this->lang->L_YES;
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
$this->config = $this->parent->config;
|
||||
$this->lang = $this->parent->lang;
|
||||
|
||||
if (count($this->config->get('config.ftp'))>0) {
|
||||
$ftpConfigurations = $this->config->getParam('ftp');
|
||||
if (count($ftpConfigurations) > 0) {
|
||||
$ftpNr = 1;
|
||||
foreach ($this->config->get('config.ftp') as $ftp) {
|
||||
foreach ($ftpConfigurations as $ftp) {
|
||||
if ($ftp['use'] == 'y') {
|
||||
?>
|
||||
<tr class="row-even">
|
||||
|
|
|
@ -54,7 +54,7 @@ $d = $this->dumpData;
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<?php if ($this->config->get('config.mode') > 0) { ?>
|
||||
<?php if ($this->config->getParam('mode', 0) > 0) { ?>
|
||||
<tr class="row-odd">
|
||||
<td><label for="backup_using_updates">Update (REPLACE Command):</label></td>
|
||||
<td><input type="checkbox" class="checkbox noleftmargin" name="backup_using_updates" id="backup_using_updates" value="1" /></td>
|
||||
|
@ -76,10 +76,14 @@ $d = $this->dumpData;
|
|||
</div>
|
||||
<br />
|
||||
<?php
|
||||
echo $this->partial('dump/settings.phtml',array('parent' => $this));
|
||||
echo $this->partial('dump/settings.phtml', array(
|
||||
'parent' => $this,
|
||||
'config' => $this->config,
|
||||
'dynamicConfig' => $this->dynamicConfig)
|
||||
);
|
||||
?>
|
||||
<div id="panel_perl" class="panel" style="display:none">
|
||||
<h3><?php echo $this->lang->L_DUMP?> PERL (<?php echo $this->lang->L_CONFIG_HEADLINE;?>: <?php echo $this->config->get('dynamic.configFile')?>)</h3>
|
||||
<h3><?php echo $this->lang->L_DUMP?> PERL (<?php echo $this->lang->L_CONFIG_HEADLINE;?>: <?php echo $this->dynamicConfig->getParam('configFile');?>)</h3>
|
||||
<button class="Formbutton" name="DoCronscript" onclick="show_perl_output('<?php echo $d->PERL_HTTP_CALL?>')"><?php echo $this->lang->L_DOCRONBUTTON?></button>
|
||||
<button class="Formbutton" name="DoSimpleTest" onclick="show_perl_output('<?php echo $d->PERL_TEST?>')"><?php echo $this->lang->L_DOSIMPLETEST?></button>
|
||||
<button class="Formbutton" name="DoPerlTest" onclick="show_perl_output('<?php echo PERL_MODULTEST?>')"><?php echo $this->lang->L_DOPERLTEST?></button>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
$this->config = $this->parent->config;
|
||||
$this->lang = $this->parent->lang;
|
||||
$d = $this->parent->dumpData;
|
||||
if ($this->config->get('config.general.multiPart') == 0) { ?>
|
||||
if ($this->config->getParam('general.multiPart') == 0) { ?>
|
||||
<tr class="row-odd">
|
||||
<td class="small"><?php echo $this->lang->L_MULTI_PART?>:</td>
|
||||
<td class="small right" colspan="2"><?php echo $this->lang->L_NO?></td>
|
||||
|
|
|
@ -9,7 +9,7 @@ $this->config = $this->parent->config;
|
|||
<table class="bdr floatLeft" summary="Dump settings">
|
||||
<tr class="row-even">
|
||||
<td class="small"><?php echo $this->lang->L_CONFIG_HEADLINE?></td>
|
||||
<td class="small right"><?php echo $this->config->get('dynamic.configFile')?></td>
|
||||
<td class="small right"><?php echo $this->dynamicConfig->getParam('configFile')?></td>
|
||||
</tr>
|
||||
<tr class="dbrow">
|
||||
<td class="small"><?php echo $this->lang->L_DBS?>:</td>
|
||||
|
@ -38,7 +38,7 @@ $this->config = $this->parent->config;
|
|||
|
||||
<tr class="dbrow">
|
||||
<td class="small nowrap"><?php echo $this->lang->L_GZIP?>:</td>
|
||||
<td class="small right"><?php echo $this->config->get('dynamic.compression') ? $this->lang->L_YES: $this->lang->L_NO; ?></td>
|
||||
<td class="small right"><?php echo $this->dynamicConfig->getParam('compression') ? $this->lang->L_YES: $this->lang->L_NO; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
|
|
@ -102,7 +102,7 @@ $(document).ready( function () {
|
|||
<td class="small"><?php echo $this->lang->L_CONFIG;?>:</td>
|
||||
<td class="small right">
|
||||
<span id="config_file">
|
||||
<?php echo $this->config->get('dynamic.configFile')?>
|
||||
<?php echo $this->dynamicConfig->getParam('configFile')?>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -12,7 +12,7 @@ $version = new Msd_Version();
|
|||
</head>
|
||||
<body>
|
||||
<?php
|
||||
if ($this->displayErrors == 1) {
|
||||
//if ($this->displayErrors == 1) {
|
||||
?>
|
||||
<h1>An error occurred</h1>
|
||||
<h2><?php echo $this->message ?></h2>
|
||||
|
@ -47,7 +47,7 @@ if ($this->displayErrors == 1) {
|
|||
<pre><?php echo var_export($this->request->getParams(), true) ?>
|
||||
</pre>
|
||||
<?php endif;
|
||||
}
|
||||
//}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
|
@ -5,7 +5,7 @@
|
|||
</a>
|
||||
<br />
|
||||
<h3><?php echo $this->lang->L_VERSIONSINFORMATIONEN;?></h3>
|
||||
<img src="<?php echo $this->baseUrl();?>/css/<?php echo $this->config->get('config.interface.theme');?>/pics/loveyourdata.gif"
|
||||
<img src="<?php echo $this->baseUrl();?>/css/<?php echo $this->config->getParam('interface.theme');?>/pics/loveyourdata.gif"
|
||||
style="float:right;padding-left:10px;" alt="love your data" title="love your data" />
|
||||
<table class="bdr" summary="Version information">
|
||||
<tr class="row-even">
|
||||
|
@ -28,7 +28,7 @@
|
|||
<td><?php echo $this->lang->L_MEMORY;?>:</td>
|
||||
<td>
|
||||
<strong>
|
||||
<?php echo $this->byteOutput($this->config->get('dynamic.phpRam')*1024*1024, 0);?>
|
||||
<?php echo $this->byteOutput($this->dynamicConfig->getParam('phpRam')*1024*1024, 0);?>
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -37,7 +37,7 @@
|
|||
<td>
|
||||
<strong><?php echo $this->serverMaxExecutionTime;?>
|
||||
<?php echo $this->lang->L_SECONDS;?>
|
||||
(<?php echo $this->config->get('dynamic.maxExecutionTime');?>
|
||||
(<?php echo $this->dynamicConfig->getParam('maxExecutionTime');?>
|
||||
<?php echo $this->lang->L_SECONDS;?>)
|
||||
</strong>
|
||||
</td>
|
||||
|
@ -49,9 +49,9 @@
|
|||
|
||||
<tr class="row-odd">
|
||||
<td><?php echo $this->lang->L_PHP_EXTENSIONS;?>:</td>
|
||||
<td class="small"><?php echo $this->config->get('dynamic.phpextensions');?>
|
||||
<td class="small"><?php echo $this->dynamicConfig->getParam('phpExtensions');?>
|
||||
<?php
|
||||
if (!$this->config->get('dynamic.compression')) { ?>
|
||||
if (!$this->dynamicConfig->getParam('compression')) { ?>
|
||||
<br /><span class="error"><?php echo $this->lang->L_NOGZPOSSIBLE;?></span>
|
||||
<?php }
|
||||
if (!extension_loaded('ftp')) { ?>
|
||||
|
@ -59,10 +59,10 @@
|
|||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ($this->config->get('dynamic.disabledPhpFunctions') > '') { ?>
|
||||
<?php if ($this->dynamicConfig->getParam('disabledPhpFunctions') > '') { ?>
|
||||
<tr class="row-even nowrap">
|
||||
<td><?php echo $this->lang->L_DISABLEDFUNCTIONS;?>:</td>
|
||||
<td class="small"><?php echo $this->config->get('dynamic.disabledPhpFunctions');?></td>
|
||||
<td class="small"><?php echo $this->dynamicConfig->getParam('disabledPhpFunctions');?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
|
@ -83,7 +83,7 @@
|
|||
</tr>
|
||||
<tr class="row-odd">
|
||||
<td><?php echo $this->lang->L_INFO_ACTDB;?>:</td>
|
||||
<td><strong><?php echo $this->config->get('dynamic.dbActual');?></strong></td>
|
||||
<td><strong><?php echo $this->dynamicConfig->getParam('dbActual');?></strong></td>
|
||||
</tr>
|
||||
<tr class="row-even">
|
||||
<td><?php echo $this->lang->L_FM_FREESPACE;?>:</td>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
$theme = $this->config->get('config.interface.theme');
|
||||
$theme = $this->config->getParam('interface.theme', 'msd');
|
||||
$request = Zend_Controller_Front::getInstance()->getRequest();
|
||||
$this->controller = $request->getControllerName();
|
||||
$this->action = $request->getActionName();
|
||||
|
@ -41,7 +41,7 @@ $('#fadeMenuIn').click(function() {
|
|||
return false;
|
||||
});
|
||||
<?php
|
||||
if ($this->config->get('config.interface.showTooltips') == 'y') { ?>
|
||||
if ($this->config->getParam('interface.showTooltips') == 'y') { ?>
|
||||
SetupTooltips();
|
||||
<?php }
|
||||
$this->jQuery()->onLoadCaptureEnd();
|
||||
|
@ -62,7 +62,7 @@ $this->jQuery()->onLoadCaptureEnd();
|
|||
alt="<?php echo $this->lang->L_MENU_HIDE;?>" title="<?php echo $this->lang->L_MENU_HIDE;?>" />
|
||||
</div>
|
||||
<span class="version-line">Version <?php echo $this->msdVersion;?></span>
|
||||
<?php if ($this->config->get('config.general.mode') == 'easy') {?>
|
||||
<?php if ($this->config->getParam('general.mode') == 'easy') {?>
|
||||
<img src="<?php echo $this->baseUrl(); ?>/css/<?php echo$theme?>/pics/navi_bg.jpg" alt="" />
|
||||
<?php } else { ?>
|
||||
<img src="<?php echo $this->baseUrl(); ?>/css/<?php echo$theme?>/pics/navi_bg_expert.jpg" alt="" />
|
||||
|
@ -143,7 +143,7 @@ $this->jQuery()->onLoadCaptureEnd();
|
|||
$this->databases = $dbAdapter->getDatabaseNames();
|
||||
foreach ($this->databases as $db) {
|
||||
echo '<option value="'.base64_encode($db).'"';
|
||||
if ($db == $this->config->get('dynamic.dbActual')) {
|
||||
if ($db == $this->dynamicConfig->getParam('dbActual')) {
|
||||
echo ' selected="selected"';
|
||||
}
|
||||
echo '>'.$db.'</option>';
|
||||
|
@ -165,16 +165,16 @@ $this->jQuery()->onLoadCaptureEnd();
|
|||
$this->configFiles = Msd_File::getConfigNames();
|
||||
foreach ($this->configFiles as $file) {
|
||||
echo "\n" . '<option value="' . base64_encode($file) . '"';
|
||||
if ($this->config->get('dynamic.configFile') == $file) {
|
||||
if ($this->dynamicConfig->getParam('configFile') == $file) {
|
||||
echo ' selected="selected"';
|
||||
}
|
||||
echo '>'.$this->getConfigTitle($file).'</option>';
|
||||
echo '>'. $this->config->getConfigTitle($file) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</fieldset>
|
||||
</form>
|
||||
<?php if (in_array($this->config->get('config.interface.language'), array('de', 'ch'))) {; ?>
|
||||
<?php if (in_array($this->config->getParam('interface.language'), array('de', 'ch'))) {; ?>
|
||||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
||||
<p style="text-align:center">
|
||||
<input type="image" src="<?php echo $this->baseUrl();?>/images/paypal-de.gif" name="submit" alt="Spende an MySQLDumper" />
|
||||
|
@ -198,7 +198,7 @@ $this->jQuery()->onLoadCaptureEnd();
|
|||
</div>
|
||||
|
||||
<?php
|
||||
if ($this->config->get('config.interface.showServerCaption') == "y") {
|
||||
if ($this->config->getParam('interface.showServerCaption') == "y") {
|
||||
?>
|
||||
<div id="server0">
|
||||
<?php echo$this->lang->L_SERVER;?>:
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
$systemDatabases = $this->config->get('config.systemDatabases');
|
||||
$systemDatabases = $this->config->getParam('systemDatabases');
|
||||
$formUrl = $this->url(array('controller'=>'sql','action'=>'index'));
|
||||
$cycleHelper = $this->getHelper('cycle')->cycle(array('row-even', 'row-odd'));
|
||||
?>
|
||||
<div id="content">
|
||||
<h2><?php echo $this->lang->L_DATABASES_OF_USER;?> '<?php echo $this->config->get('config.dbuser.user').'\'@\''.$this->config->get('config.dbuser.host');?>'</h2>
|
||||
<h2><?php echo $this->lang->L_DATABASES_OF_USER;?> '<?php echo $this->config->getParam('dbuser.user').'\'@\''.$this->config->getParam('dbuser.host');?>'</h2>
|
||||
<?php echo $this->sqlHeadNavi(); ?>
|
||||
<?php
|
||||
if (isset($this->actionResults)) {
|
||||
|
@ -100,7 +100,7 @@ if (isset($this->actionResults)) {
|
|||
?>
|
||||
<tr class="nowrap
|
||||
<?php
|
||||
if ($dbName == $this->config->get('dynamic.dbActual')) {
|
||||
if ($dbName == $this->dynamicConfig->getParam('dbActual')) {
|
||||
echo 'row-highlight';
|
||||
} else {
|
||||
echo $this->cycle(array('row-even', 'row-odd'))->next();
|
||||
|
|
|
@ -22,9 +22,9 @@ $this->jQuery()->javascriptCaptureStart(); ?>
|
|||
<a href="#">
|
||||
<?php
|
||||
echo $this->getIcon('Server', '', 16)
|
||||
. $this->config->get('config.dbuser.user') .'@'
|
||||
. $this->config->get('config.dbuser.host');
|
||||
$port = $this->config->get('config.dbuser.port');
|
||||
. $this->config->getParam('dbuser.user') .'@'
|
||||
. $this->config->getParam('dbuser.host');
|
||||
$port = $this->config->getParam('dbuser.port');
|
||||
if ($port > 0) {
|
||||
echo ':' . $port;
|
||||
}
|
||||
|
@ -34,11 +34,11 @@ $this->jQuery()->javascriptCaptureStart(); ?>
|
|||
<li>
|
||||
<a href="<?php echo $showDatabasesUrl;?>">
|
||||
<?php echo$this->getIcon('Database', '', 16);?>
|
||||
<?php echo $this->out($this->config->get('dynamic.dbActual'));?>
|
||||
<?php echo $this->out($this->dynamicConfig->getParam('dbActual'));?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
$actualTable = $this->config->get('dynamic.tableActual');
|
||||
$actualTable = $this->dynamicConfig->getParam('tableActual');
|
||||
if ($actualTable > '') {
|
||||
?>
|
||||
<li>
|
||||
|
|
|
@ -25,7 +25,7 @@ $('#sqltextarea').bind('keyup', function(e){
|
|||
<br class="clear" />
|
||||
</div>
|
||||
<div>
|
||||
<textarea style="height:<?php echo $this->config->get('config.interface.sqlboxHeight');?>px;" name="sqltextarea" id="sqltextarea" rows="4" cols="10"><?php echo $this->boxcontent;?></textarea>
|
||||
<textarea style="height:<?php echo $this->config->getParam('interface.sqlboxHeight');?>px;" name="sqltextarea" id="sqltextarea" rows="4" cols="10"><?php echo $this->boxcontent;?></textarea>
|
||||
<div class="sqlbox-warning small center"><?php echo $this->lang->L_SQL_WARNING;?></div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div id="content">
|
||||
<h2><?php echo $this->lang->L_SQL_TABLESOFDB;?> `<?php echo $this->config->get('dynamic.dbActual');?>`
|
||||
<h2><?php echo $this->lang->L_SQL_TABLESOFDB;?> `<?php echo $this->dynamicConfig->getParam('dbActual');?>`
|
||||
</h2>
|
||||
<?php
|
||||
echo $this->sqlHeadNavi();
|
||||
|
|
|
@ -16,8 +16,7 @@
|
|||
* @package MySQLDumper
|
||||
* @subpackage Action_Helper
|
||||
*/
|
||||
class Msd_Action_Helper_AssignConfigAndLanguage
|
||||
extends Zend_Controller_Action_Helper_Abstract
|
||||
class Msd_Action_Helper_AssignConfigAndLanguage extends Zend_Controller_Action_Helper_Abstract
|
||||
{
|
||||
/**
|
||||
* Actual Zend_View instance
|
||||
|
@ -37,7 +36,8 @@ class Msd_Action_Helper_AssignConfigAndLanguage
|
|||
return;
|
||||
}
|
||||
$view = $this->getView();
|
||||
$view->config = Msd_Configuration::getInstance();
|
||||
$view->config = Msd_Registry::getConfig();
|
||||
$view->dynamicConfig = Msd_Registry::getDynamicConfig();
|
||||
$view->lang = Msd_Language::getInstance();
|
||||
}
|
||||
|
||||
|
|
|
@ -79,6 +79,25 @@ class Msd_Config
|
|||
public function load($configFilename)
|
||||
{
|
||||
$this->_config = $this->_ioHandler->load($configFilename);
|
||||
$this->_setPaths();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add paths to config
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function _setPaths()
|
||||
{
|
||||
$workRoot = realpath(APPLICATION_PATH . '/..') . '/work/';
|
||||
$directories = array(
|
||||
'work' => $workRoot,
|
||||
'log' => $workRoot . 'log',
|
||||
'backup' => $workRoot . 'backup',
|
||||
'config' => $workRoot . 'config',
|
||||
'iconPath' => 'css/' . $this->getParam('interface.theme', 'msd') . '/icons'
|
||||
);
|
||||
$this->setParam('paths', $directories);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -95,13 +114,23 @@ class Msd_Config
|
|||
/**
|
||||
* Retrieves the value of a configuration parameter.
|
||||
*
|
||||
* @param string $paramName Name of the configuration parameter.
|
||||
* @param string $paramName Name of the configuration parameter. May be prefixed with section.
|
||||
* @param mixed $defaultValue Default value to return, if param isn't set.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getParam($paramName, $defaultValue = null)
|
||||
{
|
||||
// check for section e.g. interface.theme
|
||||
if (strpos($paramName, '.') !== false) {
|
||||
list($section, $paramName) = explode('.', $paramName);
|
||||
if (isset($this->_config[$section][$paramName])) {
|
||||
return $this->_config[$section][$paramName];
|
||||
} else {
|
||||
return $defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->_config[$paramName])) {
|
||||
return $this->_config[$paramName];
|
||||
}
|
||||
|
@ -120,7 +149,14 @@ class Msd_Config
|
|||
*/
|
||||
public function setParam($paramName, $paramValue)
|
||||
{
|
||||
if (strpos('paramName', '.') !== false) {
|
||||
list($section, $paramName) = explode('.', $paramName);
|
||||
$this->_config[$section][$paramName] = $paramValue;
|
||||
|
||||
} else {
|
||||
$this->_config[$paramName] = $paramValue;
|
||||
}
|
||||
|
||||
if ($this->_autosave) {
|
||||
$this->save();
|
||||
}
|
||||
|
@ -190,4 +226,18 @@ class Msd_Config
|
|||
{
|
||||
return $this->_autosave;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the title from a configuration file without aplying it.
|
||||
*
|
||||
* @param string $fileName The file name of the configuration
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getConfigTitle($fileName)
|
||||
{
|
||||
$configData = parse_ini_file($this->getParam('paths.config') . '/' . $fileName . '.ini', true);
|
||||
return $configData['general']['title'];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ class Msd_Config_Dynamic
|
|||
public function __construct($sessionNsName = 'Dynamic')
|
||||
{
|
||||
$this->_namespace = new Zend_Session_Namespace($sessionNsName);
|
||||
$this->getDynamicValues();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -64,4 +65,118 @@ class Msd_Config_Dynamic
|
|||
{
|
||||
$this->_namespace->$name = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read dynamic PHP config values
|
||||
*
|
||||
* @return Zend_Config
|
||||
*/
|
||||
public function getDynamicValues ()
|
||||
{
|
||||
$this->setParam('compression', self::_hasZlib());
|
||||
$this->setParam('phpExtensions', str_replace(',', ', ', implode(', ', get_loaded_extensions())));
|
||||
$phpRam = $this->_getPhpRam();
|
||||
$this->setParam('phpRam', $phpRam);
|
||||
$this->setParam('memoryLimit', round($phpRam * 1024 * 1024 * 0.9, 0));
|
||||
$this->setParam('sendmailCall', $this->_getConfigSetting('sendmail_path'));
|
||||
$this->setParam('safeMode', $this->_getConfigSetting('safe_mode', true));
|
||||
$this->setParam('magicQuotesGpc', get_magic_quotes_gpc());
|
||||
$disabledPhpFunctions = $this->_getConfigSetting('disable_functions');
|
||||
$this->setParam('disabledPhpFunctions', str_replace(',', ', ', $disabledPhpFunctions));
|
||||
$this->setParam('maxExecutionTime', $this->_getMaxExecutionTime());
|
||||
$this->setParam('uploadMaxFilesize', $this->_getUploadMaxFilesize());
|
||||
}
|
||||
|
||||
/**
|
||||
* Read PHP's max_execution_time
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
private function _getMaxExecutionTime()
|
||||
{
|
||||
$maxExecutionTime =
|
||||
$this->_getConfigSetting('max_execution_time', true);
|
||||
if ($maxExecutionTime <= 5) {
|
||||
// we didn't get the real value from the server - some deliver "-1"
|
||||
$maxExecutionTime = 30;
|
||||
} elseif ($maxExecutionTime > 30) {
|
||||
// we don't use more than 30 seconds to avoid brower timeouts
|
||||
$maxExecutionTime = 30;
|
||||
}
|
||||
return $maxExecutionTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get PHP's upload_max_filesize
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
private function _getUploadMaxFilesize()
|
||||
{
|
||||
$uploadMaxFilesize = $this->_getConfigSetting('upload_max_filesize');
|
||||
// Is value in Megabytes? If yes create output
|
||||
if (strpos($uploadMaxFilesize, 'M')) {
|
||||
$uploadMaxFilesize = str_replace('M', '', $uploadMaxFilesize);
|
||||
$uploadMaxFilesize = trim($uploadMaxFilesize);
|
||||
// re-calculate to Bytes
|
||||
$uploadMaxFilesize *= 1024 * 1024;
|
||||
}
|
||||
return (int) $uploadMaxFilesize;;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get PHP's ram size
|
||||
*
|
||||
* @return integer The memory limit in MB
|
||||
*/
|
||||
private function _getPhpRam()
|
||||
{
|
||||
$ram = $this->_getConfigSetting('memory_limit');
|
||||
// we don't trust the value delivered by server config if < 16
|
||||
if ($ram < 16) {
|
||||
$ram = 16;
|
||||
}
|
||||
return $ram;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect if zlib is installed
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
private function _hasZlib()
|
||||
{
|
||||
$zlib = false;
|
||||
$extensions = get_loaded_extensions();
|
||||
if (in_array('zlib', $extensions)) {
|
||||
$zlib = true;
|
||||
};
|
||||
return (boolean) $zlib;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a PHP-Setting from ini
|
||||
*
|
||||
* First try to read via ini_get(), then fall back to get_cfg_var()
|
||||
*
|
||||
* @param string $varName The name of the setting to read
|
||||
* @param bool $returnAsInt Whether to return value as integer
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
private function _getConfigSetting($varName, $returnAsInt = false)
|
||||
{
|
||||
$value = @ini_get($varName);
|
||||
|
||||
// fallback if ini_get doesn't work
|
||||
if ($value == '' || $value === null) {
|
||||
$value = @get_cfg_var($varName);
|
||||
}
|
||||
|
||||
if ($returnAsInt) {
|
||||
$value = (int) $value;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -117,7 +117,9 @@ class Msd_ConfigurationPhpValues
|
|||
* First try to read via ini_get(), then fall back to get_cfg_var()
|
||||
*
|
||||
* @param string $varName The name of the setting to read
|
||||
* @param boolean $returnAsInt Whether to return value as integer
|
||||
* @param bool $returnAsInt Whether to return value as integer
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
private function _getConfigSetting($varName, $returnAsInt = false)
|
||||
{
|
||||
|
|
66
library/Msd/Controller/Action.php
Normale Datei
66
library/Msd/Controller/Action.php
Normale Datei
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of MySQLDumper released under the GNU/GPL 2 license
|
||||
* http://www.mysqldumper.net
|
||||
*
|
||||
* @package MySQLDumper
|
||||
* @subpackage Controller
|
||||
* @version SVN: $Rev$
|
||||
* @author $Author$
|
||||
*/
|
||||
/**
|
||||
* General Controller Action class
|
||||
*
|
||||
* @package MySQLDumper
|
||||
* @subpackage Controller
|
||||
*/
|
||||
class Msd_Controller_Action extends Zend_Controller_Action
|
||||
{
|
||||
/**
|
||||
* @var Msd_Config
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
/**
|
||||
* @var Msd_Config_Dynamic
|
||||
*/
|
||||
protected $_dynamicConfig;
|
||||
|
||||
/**
|
||||
* Class constructor
|
||||
*
|
||||
* The request and response objects should be registered with the
|
||||
* controller, as should be any additional optional arguments; these will be
|
||||
* available via {@link getRequest()}, {@link getResponse()}, and
|
||||
* {@link getInvokeArgs()}, respectively.
|
||||
*
|
||||
* When overriding the constructor, please consider this usage as a best
|
||||
* practice and ensure that each is registered appropriately; the easiest
|
||||
* way to do so is to simply call parent::__construct($request, $response,
|
||||
* $invokeArgs).
|
||||
*
|
||||
* After the request, response, and invokeArgs are set, the
|
||||
* {@link $_helper helper broker} is initialized.
|
||||
*
|
||||
* Finally, {@link init()} is called as the final action of
|
||||
* instantiation, and may be safely overridden to perform initialization
|
||||
* tasks; as a general rule, override {@link init()} instead of the
|
||||
* constructor to customize an action controller's instantiation.
|
||||
*
|
||||
* @param Zend_Controller_Request_Abstract $request
|
||||
* @param Zend_Controller_Response_Abstract $response
|
||||
* @param array $invokeArgs Any additional invocation arguments
|
||||
*
|
||||
* @return Msd_Controller_Action
|
||||
*/
|
||||
public function __construct(
|
||||
Zend_Controller_Request_Abstract $request,
|
||||
Zend_Controller_Response_Abstract $response,
|
||||
array $invokeArgs = array()
|
||||
)
|
||||
{
|
||||
$this->_config = Msd_Registry::getConfig();
|
||||
$this->_dynamicConfig = Msd_Registry::getDynamicConfig();
|
||||
parent::__construct($request, $response, $invokeArgs);
|
||||
}
|
||||
}
|
|
@ -124,13 +124,13 @@ abstract class Msd_Db
|
|||
public static function getAdapter($options = null, $forceMysql = false)
|
||||
{
|
||||
if ($options === null) {
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$config = Msd_Registry::getConfig();
|
||||
$options = array(
|
||||
'host' => $config->get('config.dbuser.host'),
|
||||
'user' => $config->get('config.dbuser.user'),
|
||||
'pass' => $config->get('config.dbuser.pass'),
|
||||
'port' => (int) $config->get('config.dbuser.port'),
|
||||
'socket' => $config->get('config.dbuser.socket'),
|
||||
'host' => $config->getParam('dbuser.host'),
|
||||
'user' => $config->getParam('dbuser.user'),
|
||||
'pass' => $config->getParam('dbuser.pass'),
|
||||
'port' => (int) $config->getParam('dbuser.port'),
|
||||
'socket' => $config->getParam('dbuser.socket'),
|
||||
);
|
||||
}
|
||||
if (function_exists('mysqli_connect') && !$forceMysql) {
|
||||
|
|
|
@ -62,8 +62,8 @@ class Msd_Dump
|
|||
*/
|
||||
private function _getDbsToBackup()
|
||||
{
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$databases = $config->get('dynamic.databases');
|
||||
$dynamicConfig = Msd_Registry::getDynamicConfig();
|
||||
$databases = $dynamicConfig->getParam('dynamic.databases');
|
||||
// first check if any db is marked to be dumped
|
||||
$dbToDumpExists = false;
|
||||
if (!empty($databases)) {
|
||||
|
@ -77,7 +77,7 @@ class Msd_Dump
|
|||
}
|
||||
if (!$dbToDumpExists) {
|
||||
// no db selected for dump -> set actual db to be dumped
|
||||
$index = $config->get('dynamic.dbActual');
|
||||
$index = $dynamicConfig->getParam('dbActual');
|
||||
$this->dbsToBackup[$index] = array();
|
||||
$this->dbsToBackup[$index]['dump'] = 1;
|
||||
}
|
||||
|
|
|
@ -58,9 +58,9 @@ class Msd_File
|
|||
*/
|
||||
public static function getLatestBackupInfo()
|
||||
{
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$config = Msd_Registry::getConfig();
|
||||
$latestBackup = array();
|
||||
$dir = new DirectoryIterator($config->get('paths.backup'));
|
||||
$dir = new DirectoryIterator($config->getParam('paths.backup'));
|
||||
foreach ($dir as $file) {
|
||||
if ($file->isFile()) {
|
||||
$fileMtime = $file->getMTime();
|
||||
|
@ -84,11 +84,12 @@ class Msd_File
|
|||
*/
|
||||
public static function getConfigNames()
|
||||
{
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$configPath = $config->get('paths.config');
|
||||
$config = Msd_Registry::getConfig();
|
||||
$configPath = $config->getParam('paths.config');
|
||||
if (!is_readable($configPath)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$dir = new DirectoryIterator($configPath);
|
||||
$files = array();
|
||||
foreach ($dir as $file) {
|
||||
|
|
|
@ -28,8 +28,8 @@ class Msd_File_Dump extends Msd_File
|
|||
*/
|
||||
public static function getStatusline($filename)
|
||||
{
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$path = $config->get('paths.backup'). DS;
|
||||
$config = Msd_Registry::getConfig();
|
||||
$path = $config->getParam('paths.backup'). '/';
|
||||
if (strtolower(substr($filename, -3)) == '.gz') {
|
||||
$fileHandle = gzopen($path . $filename, "r");
|
||||
if ($fileHandle === false) {
|
||||
|
|
|
@ -21,7 +21,7 @@ class Msd_Language
|
|||
/**
|
||||
* Instance
|
||||
*
|
||||
* @var Msd_Configuration
|
||||
* @var Msd_Language
|
||||
*/
|
||||
private static $_instance = NULL;
|
||||
|
||||
|
@ -42,12 +42,12 @@ class Msd_Language
|
|||
/**
|
||||
* Constructor gets the configuration params
|
||||
*
|
||||
* @return array
|
||||
* @return Msd_Language
|
||||
*/
|
||||
private function __construct()
|
||||
{
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$language = $config->get('config.interface.language');
|
||||
$config = Msd_Registry::getConfig();
|
||||
$language = $config->getParam('interface.language', 'en');
|
||||
$this->loadLanguage($language);
|
||||
}
|
||||
|
||||
|
@ -77,9 +77,12 @@ class Msd_Language
|
|||
$this->setTranslator($translator);
|
||||
Zend_Registry::set('Zend_Translate', $translator);
|
||||
}
|
||||
|
||||
/**
|
||||
* No cloning for singleton
|
||||
*
|
||||
* @throws Msd_Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __clone()
|
||||
|
@ -90,19 +93,20 @@ class Msd_Language
|
|||
/**
|
||||
* Magic getter to keep syntax in rest of script short
|
||||
*
|
||||
* @param mixed $var
|
||||
* @param mixed $name Name of language var to translate
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function __get ($property)
|
||||
public function __get($name)
|
||||
{
|
||||
$translated = $this->getTranslator()->_($property);
|
||||
if ($translated == $property && substr($property, 0, 2) == 'L_') {
|
||||
$translated = $this->getTranslator()->_($name);
|
||||
if ($translated == $name && substr($name, 0, 2) == 'L_') {
|
||||
// no translation found -> remove prefix L_
|
||||
return substr($property, 2);
|
||||
return substr($name, 2);
|
||||
}
|
||||
return $translated;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the single instance
|
||||
*
|
||||
|
|
|
@ -29,7 +29,7 @@ class Msd_Log
|
|||
/**
|
||||
* Init file handles
|
||||
*
|
||||
* @return void
|
||||
* @return Msd_Log
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
@ -41,8 +41,8 @@ class Msd_Log
|
|||
$this->handle[self::ERROR] = false;
|
||||
|
||||
// get config
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$this->_paths = (object)$config->get('paths');
|
||||
$config = Msd_Registry::getConfig();
|
||||
$this->_paths = (object) $config->getParam('paths');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,7 +31,7 @@ class Msd_TaskManager
|
|||
/**
|
||||
* Instance
|
||||
*
|
||||
* @var Msd_Configuration
|
||||
* @var Msd_TaskManager
|
||||
*/
|
||||
private static $_instance = NULL;
|
||||
|
||||
|
@ -48,12 +48,10 @@ class Msd_TaskManager
|
|||
*
|
||||
* Get task list from session or init an empty list.
|
||||
*
|
||||
* @param string $taskType Task type to get or create.
|
||||
* Defaults to "backupTasks".
|
||||
* @param boolean Whether to create a new task list and delete all entries
|
||||
* or to get it from the session
|
||||
* @param string $taskType The name of the task type
|
||||
* @param boolean $clear Whether to clear all tasks
|
||||
*
|
||||
* @return void
|
||||
* @return Msd_TaskManager
|
||||
*/
|
||||
private function __construct($taskType, $clear = false)
|
||||
{
|
||||
|
@ -69,15 +67,12 @@ class Msd_TaskManager
|
|||
/**
|
||||
* Returns the task manager instance
|
||||
*
|
||||
* @param string $configname The name of the configuration file to load.
|
||||
* If not set we will load the config from
|
||||
* session if present.
|
||||
* @param boolean $forceLoading If set the config will be read from file.
|
||||
* @param string $taskType The name of the task type
|
||||
* @param boolean $clear Whether to clear all tasks
|
||||
*
|
||||
* @return Msd_Configuration
|
||||
* @return Msd_TaskManager
|
||||
*/
|
||||
public static function getInstance($taskType = 'backupTasks',
|
||||
$clear = false)
|
||||
public static function getInstance($taskType = 'backupTasks', $clear = false)
|
||||
{
|
||||
if (null == self::$_instance) {
|
||||
self::$_instance = new self($taskType, $clear);
|
||||
|
|
|
@ -246,6 +246,7 @@ class Msd_User
|
|||
$configFile = $files[0];
|
||||
}
|
||||
}
|
||||
Msd_Configuration::getInstance($configFile, true);
|
||||
$config = Msd_Registry::getConfig();
|
||||
$config->load($configFile . '.ini');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,6 +100,7 @@ class Zend_Config_Ini extends Zend_Config
|
|||
public function __construct($filename, $section = null, $options = false)
|
||||
{
|
||||
if (empty($filename)) {
|
||||
var_export(debug_backtrace());
|
||||
/**
|
||||
* @see Zend_Config_Exception
|
||||
*/
|
||||
|
|
BIN
tests/fixtures/sessions/sessionTester.txt
gevendort
BIN
tests/fixtures/sessions/sessionTester.txt
gevendort
Binäre Datei nicht angezeigt.
|
@ -11,8 +11,8 @@ class SqlboxTest extends ControllerTestCase
|
|||
public function testCanCreateTableSelectBox()
|
||||
{
|
||||
$model = new Application_Model_Sqlbox();
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$config->set('dynamic.dbActual', 'information_schema');
|
||||
$dynamicConfig = Msd_Registry::getDynamicConfig();
|
||||
$dynamicConfig->setParam('dbActual', 'information_schema');
|
||||
$selectBox = $model->getTableSelectBox();
|
||||
$tables = array('CHARACTER_SETS', 'COLLATIONS', 'COLLATION_CHARACTER_SET_APPLICABILITY',
|
||||
'COLUMNS', 'COLUMN_PRIVILEGES', 'ENGINES'
|
||||
|
|
|
@ -20,8 +20,8 @@ class MenuTest extends ControllerTestCase
|
|||
public function testCanRenderMenuWithInvalidActualDatabase()
|
||||
{
|
||||
$this->loginUser();
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$config->set('dynamic.dbActual', -1);
|
||||
$dynamicConfig = Msd_Registry::getDynamicConfig();
|
||||
$dynamicConfig->setParam('dbActual', -1);
|
||||
$this->dispatch('/');
|
||||
$this->assertQueryContentContains('#selectedDb', 'information_schema');
|
||||
}
|
||||
|
@ -29,9 +29,10 @@ class MenuTest extends ControllerTestCase
|
|||
public function testCanFallbackToDefaultDbIfActualDbIsInvalid()
|
||||
{
|
||||
$this->loginUser();
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$config->set('dynamic.dbActual', 'i_dont_exist');
|
||||
$config->set('config.dbuser.defaultDb', 'information_schema');
|
||||
$dynamicConfig = Msd_Registry::getDynamicConfig();
|
||||
$dynamicConfig->setParam('dbActual', 'i_dont_exist');
|
||||
$config = Msd_Registry::getConfig();
|
||||
$config->set('dbuser.defaultDb', 'information_schema');
|
||||
$this->dispatch('/');
|
||||
$this->assertQueryContentContains('#selectedDb', 'information_schema');
|
||||
}
|
||||
|
@ -39,9 +40,10 @@ class MenuTest extends ControllerTestCase
|
|||
public function testCanFallbackToFirstDbIfActualAndDefaultDbsAreInvalid()
|
||||
{
|
||||
$this->loginUser();
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$config->set('dynamic.dbActual', 'i_dont_exist');
|
||||
$config->set('config.dbuser.defaultDb', 'I_dont_exist');
|
||||
$dynamicConfig = Msd_Registry::getDynamicConfig();
|
||||
$dynamicConfig->setParam('dbActual', 'i_dont_exist');
|
||||
$config = Msd_Registry::getConfig();
|
||||
$config->setParam('dbuser.defaultDb', 'I_dont_exist');
|
||||
$this->dispatch('/');
|
||||
$this->assertQueryContentContains('#selectedDb', 'information_schema');
|
||||
}
|
||||
|
|
Laden …
In neuem Issue referenzieren