Exemple #1
0
 public function run(SqlFile $file)
 {
     $statement = $this->pdo->prepare($file->getContents());
     try {
         $result = $statement->execute();
         if ($result === false) {
             throw new \Exception("Query Returned " . var_export($this->pdo->errorInfo(), true));
         }
     } catch (\Exception $e) {
         throw new MigrationException("Running SQL File " . $file->getFile()->getPathname() . " failed.", $e);
     } finally {
         $statement->closeCursor();
     }
 }