checkAccess(); if (getVal('expensive')) { ini_set('max_execution_time', 600); } else { ini_set('max_execution_time', 60); } $methods = get_class_methods($this); foreach ($methods as $method) { if (strpos($method, 'run_') === false) { continue; } if (method_exists($this, $method)) { $this->$method(); } } echo 'OK'; } protected function checkAccess() { // Really stupid security, I know, but what the hell ... if (getVal('true_secret') != 'wpj') { exit('Permission denied'); } } protected function run_SymfonyCron() { if (php_sapi_name() == 'cli') { return; } $dispatcher = ServiceContainer::getService('event_dispatcher'); $event = new \KupShop\KupShopBundle\Event\CronEvent(false); $dispatcher->dispatch($event, \KupShop\KupShopBundle\Event\CronEvent::RUN_NORMAL); if (getVal('expensive')) { $event = new \KupShop\KupShopBundle\Event\CronEvent(true); $dispatcher->dispatch($event, \KupShop\KupShopBundle\Event\CronEvent::RUN_EXPENSIVE); } } }