Пример #1
0
 private function loadExtlib($lib)
 {
     $extPath = explode('/', $lib['src']);
     $name = array_pop($extPath);
     if (Http::load()->isValid($extPath)) {
         // return local path to the downloaded file
         return CommonHelpers::loadFile($lib['src'], $name);
     } else {
         throw new HTTPException(HTTPException::NOT_FOUND, [$extPath]);
     }
 }
Пример #2
0
 protected function redirect($location, $status)
 {
     Http::load()->redirect($location, $status);
 }
Пример #3
0
 public function start()
 {
     PluginDataSet::load()->is_ajax = Http::load()->isAjax();
     if (is_admin() && !PluginDataSet::load()->is_ajax) {
         $this->init_admin_settings();
     }
     $this->parseRequest();
     if (!$this->isPluginRoute()) {
         return;
     }
     $currentPage = $this->formPath();
     if (($error = $this->followRoute($currentPage)) === false) {
         throw new CoreException($error, [$currentPage]);
     } else {
         include_once $currentPage;
     }
     if (($error = $this->isPathCorrect()) !== true) {
         throw new CoreException($error, [$this->_page, $this->_controller, $this->_action]);
     }
     $classname = $this->formFullPath($this->_controller);
     $currentController = new $classname();
     call_user_func_array([$currentController, $this->_action], $this->_param);
 }