+ if(!is_null($where) && !$misc->isValidPath($where)) {
+ $this->output = JobError::MSG_ERROR_INVALID_WHERE_OPTION;
+ $this->error = JobError::ERROR_INVALID_WHERE_OPTION;
+ return;
+ }
+
+ if(!is_null($replace) && !$misc->isValidReplace($replace)) {
+ $this->output = JobError::MSG_ERROR_INVALID_REPLACE_OPTION;
+ $this->error = JobError::ERROR_INVALID_REPLACE_OPTION;
+ return;
+ }
+
+ $command = array('restore',
+ 'file="?' . $rfile . '"',
+ 'client="' . $client . '"'
+ );
+
+ if (is_string($replace)) {
+ $command[] = 'replace="' . $replace . '"';
+ }
+ if (is_int($priority)) {
+ $command[] = 'priority="' . $priority . '"';
+ }
+ if (is_string($restorejob)) {
+ $command[] = 'restorejob="' . $restorejob . '"';
+ }
+ if (is_string($strip_prefix)) {
+ $command[] = 'strip_prefix="' . $strip_prefix . '"';
+ }
+ if (is_string($add_prefix)) {
+ $command[] = 'add_prefix="' . $add_prefix . '"';
+ } elseif (is_string($where)) {
+ $command[] = 'where="' . $where . '"';
+ }
+ if (is_string($add_suffix)) {
+ $command[] = 'add_suffix="' . $add_suffix . '"';
+ }
+ if (is_string($regex_where)) {
+ $command[] = 'regexwhere="' . $regex_where . '"';
+ }
+ $command[] = 'yes';
+
+ $restore = $this->getModule('bconsole')->bconsoleCommand($this->director, $command, $this->user);
+ $this->removeTmpRestoreTable($rfile);
+ $this->output = $restore->output;
+ $this->error = (integer)$restore->exitcode;