Пример #1
0
 public function runUp($version)
 {
     $patt = $this->migrationsDir() . '/' . $version . '_*.php';
     $files = glob($patt);
     if (!$files) {
         throw new Exception\RuntimeException(sprintf("Migration file for version %s not found", $version));
     }
     $file = $files[0];
     require $file;
     $classes = get_declared_classes();
     $className = array_pop($classes);
     unset($classes);
     $migrator = new $className();
     $migrator->up();
     STable::create(['version' => $version]);
 }