Esempio n. 1
0
 /**
  * 开始刷新任务
  *
  * @param   \Phalcon\DI\FactoryDefault  $di     Phalcon的DI类
  */
 private function handleTaskRefresh(&$di)
 {
     $router = new \Phalcon\Mvc\Router();
     $router->setDefaults(["namespace" => 'App\\Task', "controller" => 'Task', "action" => 'kernel']);
     $di->set('router', $router);
     $di->set('url', function () {
         $url = new \Phalcon\Mvc\Url();
         $url->setBaseUri(QP_ROOT_PATH);
         return $url;
     });
     $di->set('view', function () {
         $view = new \Phalcon\Mvc\View();
         $view->setViewsDir(QP_VIEW_PATH);
         return $view;
     });
     Task\BaseTask::flushTask();
     Task\BaseTask::initData();
     (new \Phalcon\Mvc\Application($di))->handle();
     Task\BaseTask::handleTaskRefresh();
 }