Files
rspade_system/app/RSpade/Commands/Restricted/Session_Cleanup_Command.php
root 29c657f7a7 Exclude tests directory from framework publish
Add 100+ automated unit tests from .expect file specifications
Add session system test
Add rsx:constants:regenerate command test
Add rsx:logrotate command test
Add rsx:clean command test
Add rsx:manifest:stats command test
Add model enum system test
Add model mass assignment prevention test
Add rsx:check command test
Add migrate:status command test

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-25 03:59:58 +00:00

51 lines
1.4 KiB
PHP

<?php
namespace App\RSpade\Commands\Restricted;
use Illuminate\Console\Command;
class Session_Cleanup_Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'session:cleanup';
/**
* The console command description.
*
* @var string
*/
protected $description = '[RESTRICTED] Session cleanup runs automatically via scheduled task';
/**
* Hide this command from artisan list
*
* @var bool
*/
protected $hidden = true;
/**
* Execute the console command.
*/
public function handle()
{
$this->error('[RESTRICTED] This command is disabled.');
$this->info('');
$this->info('Session cleanup runs automatically via scheduled task:');
$this->info(' Session_Cleanup_Service::cleanup_sessions()');
$this->info(' Schedule: Daily at 3 AM');
$this->info('');
$this->info('Cleanup rules:');
$this->info(' - Logged-in sessions (login_user_id set): Delete if older than 365 days');
$this->info(' - Anonymous sessions (login_user_id null): Delete if older than 14 days');
$this->info('');
$this->info('To manually trigger cleanup:');
$this->info(' php artisan rsx:task:run Session_Cleanup_Service cleanup_sessions');
return 1;
}
}