Ejemplo n.º 1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $c = strtolower($this->argument('controller'));
     $files = [];
     $files[] = mkny_models_path($c) . '.php';
     $files[] = mkny_model_config_path($c) . '.php';
     $files[] = mkny_presenters_path($c) . 'Presenter.php';
     $files[] = mkny_controllers_path($c) . 'Controller.php';
     $files[] = mkny_requests_path($c) . 'Request.php';
     $files[] = mkny_lang_path(\App::getLocale() . '/' . $c) . '.php';
     $errors = [];
     foreach ($files as $file) {
         if (!$this->files->exists($file)) {
             $errors[] = $file;
         }
     }
     if (!$this->option('force') && count($errors)) {
         $this->error("Nao foi possivel executar o delete-automatico!\nAlguns arquivos estao ausentes!");
     } else {
         if ($this->option('force') || $this->confirm("Deseja realmente remover os arquivos: \n'" . implode("',\n'", $files))) {
             foreach ($files as $file) {
                 $this->files->delete($file);
             }
             $this->info('Deleted!');
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * Get the destination class path.
  *
  * @param  string  $name
  * @return string
  */
 protected function getPath($name)
 {
     // // $name = str_replace($this->laravel->getNamespace(), '', $name).$this->type;
     return mkny_controllers_path(class_basename($name) . $this->type . '.php');
     // mdd(mkny_controllers_path('/'.str_replace('\\', '/', $name).'.php'));
     // mdd($this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php');
     // // return mkny_app_path().'/'.str_replace('\\', '/', $name).'.php';
     // return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php';
 }