Implement JQHTML function cache ID system and fix bundle compilation Implement underscore prefix for system tables Fix JS syntax linter to support decorators and grant exception to Task system SPA: Update planning docs and wishlists with remaining features SPA: Document Navigation API abandonment and future enhancements Implement SPA browser integration with History API (Phase 1) Convert contacts view page to SPA action Convert clients pages to SPA actions and document conversion procedure SPA: Merge GET parameters and update documentation Implement SPA route URL generation in JavaScript and PHP Implement SPA bootstrap controller architecture Add SPA routing manual page (rsx:man spa) Add SPA routing documentation to CLAUDE.md Phase 4 Complete: Client-side SPA routing implementation Update get_routes() consumers for unified route structure Complete SPA Phase 3: PHP-side route type detection and is_spa flag Restore unified routes structure and Manifest_Query class Refactor route indexing and add SPA infrastructure Phase 3 Complete: SPA route registration in manifest Implement SPA Phase 2: Extract router code and test decorators Rename Jqhtml_Component to Component and complete SPA foundation setup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
77 lines
2.3 KiB
PHP
Executable File
77 lines
2.3 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* CODING CONVENTION:
|
|
* This file follows the coding convention where variable_names and function_names
|
|
* use snake_case (underscore_wherever_possible).
|
|
*/
|
|
|
|
namespace App\RSpade\Tests\Services;
|
|
|
|
use App\RSpade\Core\Service\Rsx_Service_Abstract;
|
|
use App\RSpade\Core\Task\Task_Instance;
|
|
|
|
/**
|
|
* Scheduled Test Service
|
|
*
|
|
* Test service with scheduled tasks for testing the scheduling system.
|
|
*/
|
|
class Scheduled_Test_Service extends Rsx_Service_Abstract
|
|
{
|
|
/**
|
|
* Test task that runs every minute
|
|
*
|
|
* @param Task_Instance $task Task instance for logging
|
|
* @param array $params Task parameters
|
|
* @return array Result data
|
|
*/
|
|
#[Task_Attribute('Test scheduled task that runs every minute')]
|
|
#[Schedule('* * * * *', 'default')]
|
|
public static function every_minute(Task_Instance $task, array $params = []): array
|
|
{
|
|
$task->info('Every minute task executed at ' . date('Y-m-d H:i:s'));
|
|
|
|
return [
|
|
'executed_at' => date('Y-m-d H:i:s'),
|
|
'message' => 'Every minute task completed',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Test task that runs every 5 minutes
|
|
*
|
|
* @param Task_Instance $task Task instance for logging
|
|
* @param array $params Task parameters
|
|
* @return array Result data
|
|
*/
|
|
#[Task_Attribute('Test scheduled task that runs every 5 minutes')]
|
|
#[Schedule('*/5 * * * *', 'default')]
|
|
public static function every_five_minutes(Task_Instance $task, array $params = []): array
|
|
{
|
|
$task->info('Every 5 minutes task executed at ' . date('Y-m-d H:i:s'));
|
|
|
|
return [
|
|
'executed_at' => date('Y-m-d H:i:s'),
|
|
'message' => 'Every 5 minutes task completed',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Test task that runs daily at midnight
|
|
*
|
|
* @param Task_Instance $task Task instance for logging
|
|
* @param array $params Task parameters
|
|
* @return array Result data
|
|
*/
|
|
#[Task_Attribute('Test scheduled task that runs daily at midnight')]
|
|
#[Schedule('0 0 * * *', 'scheduled')]
|
|
public static function daily_midnight(Task_Instance $task, array $params = []): array
|
|
{
|
|
$task->info('Daily midnight task executed at ' . date('Y-m-d H:i:s'));
|
|
|
|
return [
|
|
'executed_at' => date('Y-m-d H:i:s'),
|
|
'message' => 'Daily midnight task completed',
|
|
];
|
|
}
|
|
}
|