コード例 #1
0
 public function run($args = array())
 {
     parent::run($args);
     // start the session
     if (!$this->di['session']->isStarted()) {
         $this->di['session']->start();
     }
 }
コード例 #2
0
 public function run($args = array())
 {
     parent::run($args);
     // Call the task action specified
     $class = '\\Tasks\\' . ucfirst($args['task']) . 'Task';
     if (!class_exists($class)) {
         throw new \Exception("Task '{$args['task']}' doesn't exist!");
     }
     $action = strtolower($args['action']) . 'Action';
     $task = new $class();
     return call_user_func_array([$task, $action], $args['params']);
 }
コード例 #3
0
 protected function initConfig()
 {
     parent::initConfig();
     // set up error reporting
     $config = $this->di['config'];
     if ($config->app->errorReporting) {
         error_reporting(E_ALL);
         ini_set('display_errors', 1);
     } else {
         error_reporting(0);
         ini_set('display_errors', 0);
     }
 }