Esempio n. 1
0
 private function clearApps(Filesystem $file)
 {
     $path = base_path('storages/apps');
     if (!$file->isWritable($path)) {
         $this->showError('Apps folder isn\'t writeable.');
         exit;
     }
     $file->deleteDirectory($path, true);
     $file->put($path . '/.gitignore', "* \n!.gitignore");
     $this->showInfo('Compiled apps cleared.');
 }
 private function loadAnnotationRouter(RouteAnnotation $router)
 {
     $path = base_path('app/Controller');
     $files = new Filesystem();
     $controllers = $files->files($path);
     foreach ($controllers as $ctrl) {
         preg_match('/app\\/Controller\\/(.*)(Controller)\\.php/', $ctrl, $match);
         if ($match) {
             $resouce = "App\\Controller\\" . $match[1];
             $router->addResource($resouce);
         }
     }
 }
Esempio n. 3
0
 /**
  * @inheritdoc
  */
 public function build()
 {
     $files = $this->files->files($this->getDirectory());
     $configs = [];
     foreach ($files as $file) {
         $configs[$this->files->name($file)] = $this->files->getRequire($file);
     }
     return $configs;
 }
Esempio n. 4
0
 protected function getStub(Filesystem $filesystem)
 {
     return $filesystem->get($this->stub);
 }