Ejemplo n.º 1
0
 /**
  * Import a sql file into mysql by copying a temp file through SSH then importing it with mysql and deleting the
  * dump afterward
  * @param \Cogeco\Build\Entity\File $dumpFile
  * @param \Cogeco\Build\Entity\Database $db
  * @param $dbName
  * @throws \Cogeco\Build\Exception
  */
 public static function mysqlImport(File $dumpFile, Database $db, $dbName)
 {
     self::log("- Importing {$dumpFile->name} into {$dbName}\n");
     $command = "mysql -u {$db->account->username} -p{$db->account->password} {$dbName} < {$dumpFile->getPath()}";
     self::exec($db->getHost(), $command);
     self::log("\n");
 }