19 require_once(BASE.
"wcmf/application/controller/admintool/class.BackupController.php");
52 if(strlen($this->_request->getValue(
'paramsSection')) == 0 && !$session->exist($this->PARAMS_SECTION_VARNAME))
54 $this->
setErrorMsg(
"No 'paramsSection' given in data.");
57 return parent::validate();
64 parent::initialize($request, $response);
67 if ($request->getAction() !=
'continue')
70 $session->set($this->PARAMS_SECTION_VARNAME, $this->_request->getValue(
'paramsSection'));
80 if ($this->_request->getAction() ==
'makebackup')
81 return array(
'name' =>
'make mysql backup',
'size' => 1,
'oids' => array(1),
'callback' =>
'backupMySQL');
82 else if ($this->_request->getAction() ==
'restorebackup')
83 return array(
'name' =>
'restore mysql backup',
'size' => 1,
'oids' => array(1),
'callback' =>
'restoreMySQL');
95 $command =
'C:\Programme\xampp\mysql\bin\mysqldump --opt '.$params[
'dbName'].
' --host='.$params[
'dbHostName'].
' --user='.$params[
'dbUserName'].
' --password='.$params[
'dbPassword'].
' > "'.dirname($_SERVER[
'SCRIPT_FILENAME']).
'/'.$this->
getBackupDir().
'database.sql"';
96 $result = shell_exec($command);
97 Log::debug(
"create mysql backup command: ".$command, __CLASS__);
106 $command =
'C:\Programme\xampp\mysql\bin\mysql '.$params[
'dbName'].
' --host='.$params[
'dbHostName'].
' --user='.$params[
'dbUserName'].
' --password='.$params[
'dbPassword'].
' < "'.dirname($_SERVER[
'SCRIPT_FILENAME']).
'/'.$this->
getBackupDir().
'database.sql"';
107 $result = shell_exec($command);
108 Log::debug(
"restore mysql backup command: ".$command, __CLASS__);
121 $paramSection = $session->get($this->PARAMS_SECTION_VARNAME);
124 if (($params = $parser->getSection($paramSection)) ===
false)
debug($message, $category)
This Controller creates a backup (action 'makebackup') from a directory and restores (action 'restore...
getAdditionalWorkPackage($number, $action)
getConnectionParameters()
throwEx($message, $file='', $line='')
initialize(&$request, &$response)
This Controller enhances the file backup defined by BackupController by a backup of a given MySQL dat...