Move mode detection from Rsx_Mode to Rsx class
Simplify ajax batching to be mode-based instead of configurable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
namespace App\RSpade\Commands\Rsx;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use App\RSpade\Core\Mode\Rsx_Mode;
|
||||
use App\RSpade\Core\Rsx;
|
||||
|
||||
/**
|
||||
* Set the application mode (development, debug, or production)
|
||||
@@ -23,9 +23,9 @@ class Mode_Set_Command extends Command
|
||||
|
||||
// Normalize mode aliases
|
||||
$normalized = match (strtolower($mode)) {
|
||||
'dev', 'development' => Rsx_Mode::DEVELOPMENT,
|
||||
'debug' => Rsx_Mode::DEBUG,
|
||||
'prod', 'production' => Rsx_Mode::PRODUCTION,
|
||||
'dev', 'development' => Rsx::MODE_DEVELOPMENT,
|
||||
'debug' => Rsx::MODE_DEBUG,
|
||||
'prod', 'production' => Rsx::MODE_PRODUCTION,
|
||||
default => null,
|
||||
};
|
||||
|
||||
@@ -54,7 +54,7 @@ class Mode_Set_Command extends Command
|
||||
$this->_update_env_mode($normalized);
|
||||
|
||||
// Clear the cached mode so subsequent calls see the new value
|
||||
Rsx_Mode::clear_cache();
|
||||
Rsx::clear_mode_cache();
|
||||
|
||||
// Step 2: Clear all caches
|
||||
$this->line(' [2/3] Clearing caches...');
|
||||
@@ -68,7 +68,7 @@ class Mode_Set_Command extends Command
|
||||
// Step 3: Build appropriate assets
|
||||
$this->line(' [3/3] Building assets...');
|
||||
|
||||
if ($normalized === Rsx_Mode::DEVELOPMENT) {
|
||||
if ($normalized === Rsx::MODE_DEVELOPMENT) {
|
||||
// In development, pre-warm the bundle cache
|
||||
// Explicitly pass RSX_MODE to ensure subprocess uses correct mode
|
||||
passthru("RSX_MODE={$normalized} php artisan rsx:bundle:compile", $exit_code);
|
||||
@@ -100,7 +100,7 @@ class Mode_Set_Command extends Command
|
||||
{
|
||||
$env_path = base_path('.env');
|
||||
if (!file_exists($env_path)) {
|
||||
return Rsx_Mode::DEVELOPMENT;
|
||||
return Rsx::MODE_DEVELOPMENT;
|
||||
}
|
||||
|
||||
$contents = file_get_contents($env_path);
|
||||
@@ -108,7 +108,7 @@ class Mode_Set_Command extends Command
|
||||
return trim($matches[1]);
|
||||
}
|
||||
|
||||
return Rsx_Mode::DEVELOPMENT;
|
||||
return Rsx::MODE_DEVELOPMENT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user