예제 #1
0
 /**
  * Get the current script url without the script name
  *
  * @return string
  */
 public static function url()
 {
     $hostUrl = self::host();
     if (!empty($scriptName = Steelcode_Server_Vars::getVar('SCRIPT_NAME'))) {
         $arr = explode('/', $scriptName);
         $arrLen = count($arr);
         if ($arrLen <= 2) {
             return $hostUrl;
         } else {
             if (Steelcode_String_Helper::isNull($arr[0])) {
                 unset($arr[0]);
             }
             unset($arr[$arrLen - 1]);
             $newUrl = implode('/', $arr);
             return "{$hostUrl}/{$newUrl}";
         }
     }
     return $hostUrl;
 }
예제 #2
0
 /**
  * Create status header
  *
  * @param int $status
  * @return string
  */
 private function _statusHeader($status)
 {
     return sprintf("%s %d %s", Steelcode_Server_Vars::protocol(), $status, $this->_messages[$status]);
 }
예제 #3
0
 public function extract()
 {
     $requestPath = Steelcode_Server_Vars::getVar('PATH_INFO');
     if ($requestPath === null) {
         $requestPath = $this->_generatePath();
     }
     if ($requestPath === '/') {
         $this->_defaults();
     } else {
         $this->_extractPath($requestPath);
     }
     if (!Steelcode_File_Helper::exists($this->_config->getControllerPath())) {
         $this->_pageNotFound();
     }
     return $this->_config;
 }