Beispiel #1
0
 /**
  * create a new package
  *
  * @return void
  */
 public function create()
 {
     $this->fs->makeDirectory($this->path, '0755', True);
     $this->createSrc();
     $this->replaceAllInFiles(get_subdir_files($this->path));
     $this->createServiceProvider();
     initGit($this->path);
 }
Beispiel #2
0
function get_subdir_files($main_dir)
{
    $dirs = scandir($main_dir);
    $result = [];
    foreach ($dirs as $dir) {
        if ($dir === '.' || $dir === '..' || $dir === '.git') {
            continue;
        }
        if (is_file($main_dir . '/' . $dir)) {
            $result[] = "{$main_dir}/{$dir}";
        } else {
            $result = array_merge($result, get_subdir_files("{$main_dir}/{$dir}"));
        }
    }
    return $result;
}