Skip to content

Commit 4be9301

Browse files
committed
minor fixes in mysql restore program
1 parent eeba26d commit 4be9301

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

storage/Mysql/cliRestore.php

+14-5
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ protected function _filterExt($action, $objName, $cmd=null)
244244
}
245245

246246
$cmd .= $this->_opts['database'] . " $action $objName";
247-
$output = $ret = null;
247+
$output = array();
248+
$ret = null;
248249
exec($cmd, $output, $ret);
249250
if ($output) {
250251
echo "Error output from external filter:".PHP_EOL.implode(PHP_EOL, $output);
@@ -269,8 +270,14 @@ public function getReturnCode()
269270
return self::RETCODE_OK;
270271
}
271272

273+
/**
274+
* Output information about backup data
275+
*
276+
* @return string
277+
*/
272278
public function getInfo()
273279
{
280+
return "backup";
274281
}
275282

276283
protected function _connectMysql()
@@ -356,7 +363,7 @@ public function cloneTo()
356363
}
357364

358365
if (1!==$this->_filterExt($subPath, $fn)) {
359-
$task = $this->_log->subtask()->log("$subPath: skip '$fn' because of external filter");
366+
$this->_log->subtask()->log("$subPath: skip '$fn' because of external filter");
360367
continue;
361368
}
362369

@@ -582,7 +589,7 @@ function importDataFromFolderToRemoteServer($path, $truncate=true)
582589

583590
function importDataFromFolderToLocalServer($subPath, $truncate=true)
584591
{
585-
return $this->importDataFromFolder(true, $path, $truncate);
592+
return $this->importDataFromFolder(true, $subPath, $truncate);
586593
}
587594

588595
function importDataFromFolder($isLocalHost, $subPath, $truncate=true)
@@ -593,7 +600,7 @@ function importDataFromFolder($isLocalHost, $subPath, $truncate=true)
593600
if ($fn!="." && $fn!="..") {
594601

595602
if (1!==$this->_filterExt($subPath, $fn)) {
596-
$task = $this->_log->subtask()->log("$subPath: skip '$fn' because of external filter");
603+
$this->_log->subtask()->log("$subPath: skip '$fn' because of external filter");
597604
continue;
598605
}
599606

@@ -627,6 +634,8 @@ function importDataFromFolder($isLocalHost, $subPath, $truncate=true)
627634
}
628635
closedir($handle);
629636
}
637+
638+
return true;
630639
}
631640

632641
function execSqlFromFolderTogether($path)
@@ -664,7 +673,7 @@ function execSqlFromFolder($subPath, $tryRepeat=false)
664673
$fullFn = $path.$fn;
665674

666675
if (1!==$this->_filterExt($subPath, $fn)) {
667-
$task = $this->_log->subtask()->log("skip '$fn' because of external filter");
676+
$this->_log->subtask()->log("skip '$fn' because of external filter");
668677
continue;
669678
}
670679

xtbackup.iml

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<module type="JAVA_MODULE" version="4">
3+
<component name="DBNavigator.Module.ConnectionManager">
4+
<connections />
5+
</component>
36
<component name="NewModuleRootManager" inherit-compiler-output="true">
47
<exclude-output />
58
<content url="file://$MODULE_DIR$">

0 commit comments

Comments
 (0)