Changeset View
Changeset View
Standalone View
Standalone View
tools/run_event.php
Show All 33 Lines | |||||
exit_code(3, 'Bad key'); | exit_code(3, 'Bad key'); | ||||
} | } | ||||
include_once(FULL_PATH . '/core/kernel/startup.php'); | include_once(FULL_PATH . '/core/kernel/startup.php'); | ||||
$application =& kApplication::Instance(); | $application =& kApplication::Instance(); | ||||
$application->Init(); | $application->Init(); | ||||
$application->StoreVar('user_id', USER_ROOT, true); | $application->StoreVar('user_id', USER_SYSTEM, true); | ||||
alex: Add tests to confirm, that this user is actually used, e.g. event that creates a record owned… | |||||
$run_event = new kEvent($argv[1]); // event name in form "prefix[.special]:event_name" | $run_event = new kEvent($argv[1]); // event name in form "prefix[.special]:event_name" | ||||
$application->HandleEvent($run_event); | $application->HandleEvent($run_event); | ||||
$application->Done(); | $application->Done(); | ||||
$end = microtime(true); | $end = microtime(true); | ||||
exit_code($run_event->status == kEvent::erSUCCESS ? 0 : 4); | exit_code($run_event->status == kEvent::erSUCCESS ? 0 : 4); | ||||
function exit_code($code, $msg = '') | function exit_code($code, $msg = '') | ||||
{ | { | ||||
if ( $msg ) { | if ( $msg ) { | ||||
echo $msg . PHP_EOL; | echo $msg . PHP_EOL; | ||||
} | } | ||||
exit($code); | exit($code); | ||||
} | } | ||||
$end = microtime(true); | $end = microtime(true); | ||||
No newline at end of file |
Add tests to confirm, that this user is actually used, e.g. event that creates a record owned by a currently logged-in user should use a system user.