Exemplo n.º 1
0
 /**
  * @param Database $database
  * @param String $table
  */
 private function getTableStatement($database, $table)
 {
     $data = $database->query("SHOW CREATE TABLE " . $table['name'])->fetch();
     return $data['Create Table'];
 }
Exemplo n.º 2
0
 private function connectDatabases($sourceName, $targetName)
 {
     // Connection to the Source-Database
     $sourceDB = new Database();
     $sourceConfig = $this->storageDatabases[$sourceName];
     $sourceDB->connect($sourceConfig['engine'], $sourceConfig['host'], $sourceConfig['name'], $sourceConfig['user'], $sourceConfig['password']);
     $this->sourceDB = $sourceDB;
     Core::showMessage(" > SourceDB connected", 'green');
     // Connection to the Target-Database
     $targetDB = new Database();
     $targetConfig = $this->storageDatabases[$targetName];
     $targetDB->connect($targetConfig['engine'], $targetConfig['host'], $targetConfig['name'], $targetConfig['user'], $targetConfig['password']);
     $this->targetDB = $targetDB;
     Core::showMessage(" > TargetDB connected", 'green');
     if ($this->sourceDB->pdo !== false and $this->targetDB->pdo !== false) {
         return true;
     }
     return false;
 }