コード例 #1
0
ファイル: FilePatch.php プロジェクト: zenmagick/zenmagick
 /**
  * Create new patch.
  *
  * @param string id Id of the patch.
  */
 public function __construct($id)
 {
     parent::__construct($id);
     clearstatcache();
 }
コード例 #2
0
ファイル: SQLPatch.php プロジェクト: zenmagick/zenmagick
 /**
  * Revert the patch.
  *
  * @return boolean <code>true</code> if patching was successful, <code>false</code> if not.
  */
 public function undo()
 {
     if ($this->isOpen()) {
         return true;
     }
     $sm = \ZMRuntime::getDatabase()->getSchemaManager();
     foreach ($this->getTables() as $table) {
         $sm->dropTable($table);
     }
     if (isset($this->sqlUndoFiles)) {
         $baseDir = $this->patchRoot;
         $status = true;
         foreach ($this->sqlUndoFiles as $file) {
             $sql = file($baseDir . $file);
             $status |= $this->runSQL($sql);
         }
         return $status;
     }
     return parent::undo();
 }