예제 #1
0
 /**
  * Generate .gitkeep files within generated folders.
  */
 protected function generateGitkeep()
 {
     $slug = $this->container['slug'];
     $modulePath = $this->getModulePath($slug);
     foreach ($this->moduleFolders as $folder) {
         $path = $modulePath . $folder;
         //
         $files = $this->files->glob($path . '/*');
         if (!empty($files)) {
             continue;
         }
         $gitkeep = $path . '/.gitkeep';
         $this->files->put($gitkeep, '');
     }
 }
예제 #2
0
 /**
  * Get all of the migration files in a given path.
  *
  * @param  string  $path
  * @return array
  */
 public function getMigrationFiles($path)
 {
     $files = $this->files->glob($path . '/*_*.php');
     // Once we have the array of files in the directory we will just remove the
     // extension and take the basename of the file which is all we need when
     // finding the migrations that haven't been run against the databases.
     if ($files === false) {
         return array();
     }
     $files = array_map(function ($file) {
         return str_replace('.php', '', basename($file));
     }, $files);
     // Once we have all of the formatted file names we will sort them and since
     // they all start with a timestamp this should give us the migrations in
     // the order they were actually created by the application developers.
     sort($files);
     return $files;
 }