Init(); $application->StoreVar('user_id', USER_ROOT, true); $run_event = new kEvent($argv[1]); // event name in form "prefix[.special]:event_name" $application->HandleEvent($run_event); $application->Done(); $end = microtime(true); exit_code($run_event->status == kEvent::erSUCCESS ? 0 : 4); function exit_code($code, $msg = '') { if ( $msg ) { echo $msg . PHP_EOL; } exit($code); } $end = microtime(true);