コード例 #1
0
ファイル: XLite.php プロジェクト: kingsj/core
 /**
  * Get controller
  *
  * @return \XLite\Controller\AController
  */
 public static function getController()
 {
     if (!isset(static::$controller)) {
         $class = static::getControllerClass();
         if (!\XLite\Core\Operator::isClassExists($class)) {
             \XLite\Core\Request::getInstance()->target = static::TARGET_DEFAULT;
             \XLite\Logger::getInstance()->log('Controller class ' . $class . ' not found!', LOG_ERR);
             \XLite\Core\Request::getInstance()->target = static::TARGET_404;
             $class = static::getControllerClass();
         }
         static::$controller = new $class(\XLite\Core\Request::getInstance()->getData());
         static::$controller->init();
     }
     return static::$controller;
 }
コード例 #2
0
ファイル: XLite.php プロジェクト: kewaunited/xcart
 /**
  * Get controller
  *
  * @return \XLite\Controller\AController
  */
 public static function getController()
 {
     if (!isset(static::$controller)) {
         $class = static::getControllerClass();
         if (!$class) {
             \XLite\Core\Request::getInstance()->target = static::TARGET_DEFAULT;
             \XLite\Logger::logCustom('access', 'Controller class ' . $class . ' not found!');
             \XLite\Core\Request::getInstance()->target = static::TARGET_404;
             $class = static::getControllerClass();
         }
         static::$controller = new $class(\XLite\Core\Request::getInstance()->getData());
         static::$controller->init();
     }
     return static::$controller;
 }
コード例 #3
0
ファイル: XLite.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Get controller
  *
  * @return \XLite\Controller\AController
  */
 public static function getController()
 {
     if (null === static::$controller) {
         $class = static::getControllerClass();
         if (!$class) {
             \XLite\Core\Request::getInstance()->target = static::TARGET_DEFAULT;
             \XLite\Logger::logCustom('access', 'Controller class ' . $class . ' not found!');
             \XLite\Core\Request::getInstance()->target = static::TARGET_404;
             $class = static::getControllerClass();
         }
         if (!\XLite\Core\Request::getInstance()->isCLI() && \XLite::getInstance()->getRequestedScript() !== \XLite::getInstance()->getExpectedScript() && \XLite::getInstance()->getRequestedScript() !== \XLite::getInstance()->getExpectedScript(true)) {
             \XLite\Core\Request::getInstance()->target = static::TARGET_404;
             $class = static::getControllerClass();
         }
         static::$controller = new $class(\XLite\Core\Request::getInstance()->getData());
         static::$controller->init();
     }
     return static::$controller;
 }