當前位置: 首頁>>代碼示例>>PHP>>正文


PHP I2CE::getProtocol方法代碼示例

本文整理匯總了PHP中I2CE::getProtocol方法的典型用法代碼示例。如果您正苦於以下問題:PHP I2CE::getProtocol方法的具體用法?PHP I2CE::getProtocol怎麽用?PHP I2CE::getProtocol使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在I2CE的用法示例。


在下文中一共展示了I2CE::getProtocol方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setBase

 protected function setBase()
 {
     $head = $this->getElementByTagName('head', 0);
     if (!$head instanceof DOMNode) {
         return;
     }
     $script = substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], "/"));
     $site_url = I2CE::getProtocol() . '://' . $_SERVER['HTTP_HOST'] . $script . '/';
     $base = $this->createElement('base', array('href' => $site_url));
     $head->insertBefore($base, $head->firstChild);
 }
開發者ID:apelon-ohie,項目名稱:ihris-site,代碼行數:11,代碼來源:I2CE_Template.php

示例2: redirect

 /**
  * Send the redirect header with the given URL.
  *
  * @param string $url
  */
 public function redirect($url)
 {
     if (!array_key_exists('HTTP_HOST', $_SERVER)) {
         return;
     }
     if ($this->isGet() && !preg_match('/login/', $_SERVER['REQUEST_URI'])) {
         $_SESSION['referal'] = I2CE::getProtocol() . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     }
     if (preg_match('/^[a-zA-Z]+:\\/\\//', $url) || $url[0] == '/') {
         //an absolute url
         //do nothing;
     } else {
         $url = $this->getAccessedBaseURL() . $url;
     }
     header("Location: " . $url);
 }
開發者ID:apelon-ohie,項目名稱:ihris-site,代碼行數:21,代碼來源:I2CE_Page.php

示例3: getAccessedBaseURL

 /**
  * Returns the base url from which the site was accessed.  If no
  * .htaccess is used, ths will include the index.php.  If rewrites
  * are used (via .htacces) this will no include the
  * index.php. Point is... this is the base url from which the site
  * was accessed, no questions asked.  This of course assumes that
  * you are now accessing the site via the command line
  *
  *@return string
  */
 public static function getAccessedBaseURL($include_http = true)
 {
     $script = substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], "/"));
     if ($include_http) {
         if (array_key_exists('HTTP_HOST', $_SERVER)) {
             $site_url = I2CE::getProtocol() . '://' . $_SERVER['HTTP_HOST'] . $script . '/';
         } else {
             $site_url = 'http://localhost/';
         }
     } else {
         $site_url = $script . '/';
     }
     if (!self::rewrittenURLs()) {
         $site_url = $site_url . 'index.php/';
     } else {
         if ($_SERVER['SCRIPT_NAME'] . '/update.php' == $_SERVER['PHP_SELF']) {
             $site_url = $site_url . 'index.php/';
         }
     }
     return $site_url;
 }
開發者ID:apelon-ohie,項目名稱:ihris-site,代碼行數:31,代碼來源:I2CE.php


注:本文中的I2CE::getProtocol方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。