コード例 #1
0
 /**
  * Determines which controller/action to route the request to.
  * Routing candidates include actual template paths, elements with URIs, and registered URL routes.
  *
  * @param HttpRequestService $request
  * @return string The controller/action path.
  * @throws HttpException Throws a 404 in the event that we can't figure out where to route the request.
  */
 public function parseUrl(HttpRequestService $request)
 {
     $this->_routeAction = null;
     $this->_routeParams = array('variables' => array());
     $path = $request->getPath();
     // Is this an element request?
     $matchedElementRoute = $this->_getMatchedElementRoute($path);
     if ($matchedElementRoute) {
         $this->_setRoute($matchedElementRoute);
     } else {
         // Does it look like they're trying to access a public template path?
         if ($this->_isPublicTemplatePath()) {
             // Default to that, then
             $this->_setRoute($path);
         }
         // Finally see if there's a URL route that matches
         $this->_setRoute($this->_getMatchedUrlRoute($path));
     }
     // Did we come up with something?
     if ($this->_routeAction) {
         // Merge the route variables into the params
         $this->_routeParams['variables'] = array_merge($this->_routeParams['variables'], $this->_routeVariables);
         // Save the params in $_GET so they can get mapped to the controller action arguments
         $_GET = array_merge($_GET, $this->_routeParams);
         // Return the controller action
         return $this->_routeAction;
     }
     // If we couldn't figure out what to do with the request, throw a 404
     throw new HttpException(404);
 }
コード例 #2
0
 public function __construct()
 {
     parent::__construct();
     if (empty($this->APIURL) || empty($this->APIKey) || empty($this->SecretKey)) {
         throw new exception('Invalid API URL or API key or Secret key, please check config.inc.php');
     }
 }
コード例 #3
0
 public function __construct($RRconfig = null)
 {
     global $config;
     parent::__construct();
     $this->_config = !empty($RRconfig) ? $RRconfig : $config;
     if (empty($this->_config->APIURL) || empty($this->_config->APIKey) || empty($this->_config->SecretKey)) {
         throw new exception('Invalid API URL or API key or Secret key, please check config.inc.php');
     }
 }
コード例 #4
0
 public function __construct()
 {
     parent::__construct();
     $this->_config = new stdClass();
     $config = C('outlogin.renren');
     $this->_config->APIURL = $config['apiurl'];
     $this->_config->APIKey = $config['akey'];
     $this->_config->SecretKey = $config['skey'];
     $this->_config->APIVersion = $config['apiversion'];
     $this->_config->decodeFormat = $config['decodeformat'];
     if (empty($this->_config->APIURL) || empty($this->_config->APIKey) || empty($this->_config->SecretKey)) {
         throw new exception('Invalid API URL or API key or Secret key, please check config.inc.php');
     }
 }
コード例 #5
0
 public function __construct()
 {
     parent::__construct();
     $this->_configrenren = $GLOBALS['configrenren'];
 }
コード例 #6
0
 public function __construct()
 {
     global $config;
     parent::__construct();
     $this->_config = $config;
 }