当前位置: 首页>>代码示例>>PHP>>正文


PHP Utility::getReferer方法代码示例

本文整理汇总了PHP中Utility::getReferer方法的典型用法代码示例。如果您正苦于以下问题:PHP Utility::getReferer方法的具体用法?PHP Utility::getReferer怎么用?PHP Utility::getReferer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utility的用法示例。


在下文中一共展示了Utility::getReferer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetReferer

 /**
  * UtilityTest::testGetReferer()
  *
  * @covers Utility::getReferer
  * @return void
  */
 public function testGetReferer()
 {
     $res = Utility::getReferer();
     $this->assertEquals(env('HTTP_REFERER'), $res);
     $res = Utility::getReferer(true);
     $this->assertEquals(env('HTTP_REFERER'), $res);
     $_SERVER['HTTP_REFERER'] = '/foo/bar';
     $res = Utility::getReferer(true);
     $base = Configure::read('App.fullBaseUrl');
     if (!$base) {
         $base = 'http://localhost';
     }
     $this->assertEquals($base . env('HTTP_REFERER'), $res);
 }
开发者ID:ByMyHandsOnly,项目名称:BMHO_Web,代码行数:20,代码来源:UtilityTest.php

示例2: traceDetails

 /**
  * Append some more infos to better track down the error
  *
  * @return string
  */
 public static function traceDetails()
 {
     if (empty($_SERVER['REQUEST_URI']) || strpos($_SERVER['REQUEST_URI'], '/test.php?') === 0) {
         return null;
     }
     $currentUrl = Router::url();
     //isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : 'n/a';
     $refererUrl = Utility::getReferer();
     //Router::getRequest()->url().'
     $uid = !empty($_SESSION) && !empty($_SESSION['Auth']['User']['id']) ? $_SESSION['Auth']['User']['id'] : null;
     $data = array(@CakeRequest::clientIp(), $currentUrl . (!empty($refererUrl) ? ' (' . $refererUrl . ')' : ''), $uid, env('HTTP_USER_AGENT'));
     return implode(' - ', $data);
 }
开发者ID:miznokruge,项目名称:base-cake,代码行数:18,代码来源:MyErrorHandler.php

示例3: _logAttempt

 /**
  * Logs attempts
  *
  * @param bool ErrorsOnly (only if error occured, otherwise always)
  * @returns null if not logged, true otherwise
  */
 protected function _logAttempt($errorsOnly = true)
 {
     if ($errorsOnly === true && empty($this->error) && empty($this->internalError)) {
         return null;
     }
     if (!$this->settings[$this->Model->alias]['log']) {
         return null;
     }
     $msg = 'IP \'' . Utility::getClientIp() . '\', Agent \'' . env('HTTP_USER_AGENT') . '\', Referer \'' . env('HTTP_REFERER') . '\', Host-Referer \'' . Utility::getReferer() . '\'';
     if (!empty($this->error)) {
         $msg .= ', ' . $this->error;
     }
     if (!empty($this->internalError)) {
         $msg .= ' (' . $this->internalError . ')';
     }
     $this->log($msg, 'captcha');
     return true;
 }
开发者ID:Jony01,项目名称:LLD,代码行数:24,代码来源:CaptchaBehavior.php

示例4: getReferer

 /**
  * get the current referer
  * @param bool $full (defaults to false and leaves the url untouched)
  * @return string $referer (local or foreign)
  * 2011-11-02 ms
  */
 public static function getReferer($full = false)
 {
     return Utility::getReferer($full);
 }
开发者ID:robksawyer,项目名称:grabitdown,代码行数:10,代码来源:CommonComponent.php


注:本文中的Utility::getReferer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。