当前位置: 首页>>代码示例>>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;未经允许,请勿转载。