19 require_once(BASE.
"wcmf/application/controller/class.BatchController.php");
20 require_once(BASE.
"wcmf/lib/util/class.InifileParser.php");
61 if(strlen($this->_request->getValue(
'backupName')) == 0 && !$session->exist($this->BACKUP_NAME_VARNAME))
63 $this->
setErrorMsg(
"No 'backupName' given in data.");
66 if(strlen($this->_request->getValue(
'sourceDir')) == 0 && !$session->exist($this->SOURCE_DIR_VARNAME))
68 $this->
setErrorMsg(
"No 'sourceDir' given in data.");
78 parent::initialize($request, $response);
81 if ($request->getAction() !=
'continue')
86 $this->_request->setValue(
'backupName', preg_replace(
"/[^a-zA-Z0-9\-_\.]+/",
"_", $this->_request->getValue(
'backupName')));
88 $session->set($this->BACKUP_NAME_VARNAME, $this->_request->getValue(
'backupName'));
89 $session->set($this->SOURCE_DIR_VARNAME, $this->_request->getValue(
'sourceDir'));
99 if ($this->_request->getAction() ==
'makebackup')
100 return array(
'name' =>
'backup files',
'size' => 1,
'oids' => array(1),
'callback' =>
'backupFiles');
101 else if ($this->_request->getAction() ==
'restorebackup')
102 return array(
'name' =>
'restore files',
'size' => 1,
'oids' => array(1),
'callback' =>
'restoreFiles');
126 $sourceDir = $session->get($this->SOURCE_DIR_VARNAME);
137 $sourceDir = $session->get($this->SOURCE_DIR_VARNAME);
160 $backupName = $session->get($this->BACKUP_NAME_VARNAME);
163 if (($backupDir = $parser->getValue(
'backupDir',
'cms')) ===
false)
165 if (strrpos($backupDir,
'/') != strlen($backupDir)-1)
167 return $backupDir.$backupName.
'/';
get($message, $parameters=null, $domain='', $lang='')
This Controller creates a backup (action 'makebackup') from a directory and restores (action 'restore...
throwEx($message, $file='', $line='')
getAdditionalWorkPackage($number, $action)
copyRecDir($source, $dest)
initialize(&$request, &$response)
BatchController allows to define work packages that will be processed in a sequence. It simplifies the usage of LongTaskController functionality for splitting different bigger tasks into many smaller (similar) tasks where the whole number of tasks isn't known at designtime.