Scaffolder v2.0.0
  • Namespace
  • Class

Namespaces

  • Scaffolder
    • Commands
    • Compilers
      • Core
        • Api
      • Layout
      • View

Classes

  • Scaffolder\Commands\BaseCommand
  • Scaffolder\Commands\ClearCacheCommand
  • Scaffolder\Commands\GeneratorCommand
  • Scaffolder\Commands\InitializeApiCommand
  • Scaffolder\Compilers\AbstractCompiler
  • Scaffolder\Compilers\AbstractCoreCompiler
  • Scaffolder\Compilers\AbstractViewCompiler
  • Scaffolder\Compilers\Core\Api\ApiControllerCompiler
  • Scaffolder\Compilers\Core\Api\ApiModelCompiler
  • Scaffolder\Compilers\Core\Api\ApiRouteCompiler
  • Scaffolder\Compilers\Core\ControllerCompiler
  • Scaffolder\Compilers\Core\MigrationCompiler
  • Scaffolder\Compilers\Core\ModelCompiler
  • Scaffolder\Compilers\Core\RouteCompiler
  • Scaffolder\Compilers\Layout\CreateLayoutCompiler
  • Scaffolder\Compilers\Layout\EditLayoutCompiler
  • Scaffolder\Compilers\Layout\PageLayoutCompiler
  • Scaffolder\Compilers\View\CreateViewCompiler
  • Scaffolder\Compilers\View\DashboardViewCompiler
  • Scaffolder\Compilers\View\EditViewCompiler
  • Scaffolder\Compilers\View\IndexViewCompiler
  • Scaffolder\Compilers\View\LoginViewCompiler
  • Scaffolder\Compilers\View\WelcomeViewCompiler
  • Scaffolder\ScaffolderServiceProvider
 1 <?php
 2 
 3 namespace Scaffolder\Commands;
 4 
 5 use Illuminate\Console\Command;
 6 use Illuminate\Support\Facades\File;
 7 use Illuminate\Support\Facades\Log;
 8 
 9 class ClearCacheCommand extends Command
10 {
11     /**
12      * Command signature.
13      * @var string
14      */
15     protected $signature = 'scaffolder:cache-clear';
16 
17     /**
18      * Command description.
19      * @var string
20      */
21     protected $description = 'Delete compiled files';
22 
23     /**
24      * Execute the command.
25      */
26     public function handle()
27     {
28         try
29         {
30             // Get the compiled files
31             $compiledFiles = File::glob(base_path('scaffolder-config/cache/*.scf'));
32 
33             // Start progress bar
34             $this->output->progressStart(count($compiledFiles));
35 
36             foreach ($compiledFiles as $compiledFile)
37             {
38                 File::delete($compiledFile);
39 
40                 // Advance progress
41                 $this->output->progressAdvance();
42             }
43 
44             // Finish progress
45             $this->output->progressFinish();
46 
47             $this->info('Cache cleared');
48         }
49         catch (\Exception $exception)
50         {
51             Log::error($exception->getMessage());
52         }
53     }
54 }
55 
Scaffolder v2.0.0 API documentation generated by ApiGen