Fix bin/publish: use correct .env path for rspade_system Fix bin/publish script: prevent grep exit code 1 from terminating script 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
60 lines
1.6 KiB
PHP
Executable File
60 lines
1.6 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\RSpade\Commands\Restricted;
|
|
|
|
use Illuminate\Console\Command;
|
|
use Illuminate\Support\Facades\Artisan;
|
|
|
|
class Cache_Clear_Command extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'cache:clear
|
|
{store? : The name of the store you would like to clear}
|
|
{--tags=* : The cache tags you would like to clear}';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Flush the application cache and RSX caches';
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function handle()
|
|
{
|
|
// Run the original Laravel cache:clear command by directly invoking it
|
|
$cache_manager = app('cache');
|
|
$store = $this->argument('store') ?: $cache_manager->getDefaultDriver();
|
|
$tags = $this->option('tags');
|
|
|
|
$cache = $cache_manager->store($store);
|
|
|
|
if ($tags && !method_exists($cache, 'tags')) {
|
|
$this->error('This cache store does not support tagging.');
|
|
return 1;
|
|
}
|
|
|
|
$successful = $tags ? $cache->tags($tags)->flush() : $cache->flush();
|
|
|
|
if (!$successful) {
|
|
$this->error('Failed to clear cache.');
|
|
return 1;
|
|
}
|
|
|
|
$this->info("Application cache cleared for store [{$store}]!");
|
|
|
|
// Also clear RSX caches
|
|
$this->info('Clearing RSX caches...');
|
|
Artisan::call('rsx:clean', [], $this->output);
|
|
|
|
return 0;
|
|
}
|
|
} |