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); } } }
/** * @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; }
protected function getStub(Filesystem $filesystem) { return $filesystem->get($this->stub); }