Changeset View
Changeset View
Standalone View
Standalone View
tools/run_event.php
Show All 30 Lines | |||||
$password = isset($argv) && isset($argv[2]) ? $argv[2] : ''; | $password = isset($argv) && isset($argv[2]) ? $argv[2] : ''; | ||||
if ( $password != 'b674006f3edb1d9cd4d838c150b0567d' ) { | if ( $password != 'b674006f3edb1d9cd4d838c150b0567d' ) { | ||||
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'); | ||||
if ( $argv[1] === 'adm:OnDeploy' ) { | |||||
$_GET['full_init'] = 0; | |||||
} | |||||
alex: Delete. | |||||
$application =& kApplication::Instance(); | $application =& kApplication::Instance(); | ||||
$application->Init(); | $application->Init(); | ||||
$application->StoreVar('user_id', USER_ROOT, true); | $application->StoreVar('user_id', USER_ROOT, true); | ||||
$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 |
Delete.