예제 #1
0
파일: Import.php 프로젝트: aleksabp/bolt
 /**
  * Set the migration files.
  *
  * Also creates an input file objects.
  *
  * @see \Bolt\Database\Migration\AbstractMigration::setMigrationFiles()
  */
 public function setMigrationFiles($files)
 {
     parent::setMigrationFiles($files);
     if ($this->getError()) {
         return $this;
     }
     foreach ($this->files as &$file) {
         if ($file['type'] === 'yaml') {
             $file['handler'] = new Input\YamlFile($this, $file['file']);
         } elseif ($file['type'] === 'json') {
             $file['handler'] = new Input\JsonFile($this, $file['file']);
         }
     }
     return $this;
 }
예제 #2
0
파일: Export.php 프로젝트: aleksabp/bolt
 /**
  * Set the migration files.
  *
  * Also creates an output file object.
  *
  * @see \Bolt\Database\Migration\AbstractMigration::setMigrationFiles()
  *
  * @return \Bolt\Database\Migration\Export
  */
 public function setMigrationFiles($files)
 {
     parent::setMigrationFiles($files);
     if ($this->getError()) {
         return $this;
     }
     $this->hash = md5($files);
     $file =& $this->files[$this->hash];
     if ($file['type'] === 'yaml') {
         $file['handler'] = new Output\YamlFile($this, $file['file']);
     } elseif ($file['type'] === 'json') {
         $file['handler'] = new Output\JsonFile($this, $file['file']);
     }
     return $this;
 }