import v1.1.0_RC2 | 2009-09-20
This commit is contained in:
@ -14,14 +14,15 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Controller
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Abstract.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Controller
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Controller_Request_Abstract
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Controller
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Apache404.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
*/
|
||||
|
||||
/** Zend_Controller_Request_Http */
|
||||
|
@ -15,8 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Controller
|
||||
* @subpackage Request
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
*/
|
||||
|
||||
|
||||
@ -28,7 +29,7 @@ require_once 'Zend/Controller/Exception.php';
|
||||
* @category Zend
|
||||
* @package Zend_Controller
|
||||
* @subpackage Request
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Controller_Request_Exception extends Zend_Controller_Exception
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Controller
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Http.php 16933 2009-07-21 20:24:35Z matthew $
|
||||
*/
|
||||
|
||||
/** Zend_Controller_Request_Abstract */
|
||||
@ -498,7 +499,8 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
|
||||
return $this;
|
||||
}
|
||||
|
||||
if (!strpos($requestUri, basename($baseUrl))) {
|
||||
$basename = basename($baseUrl);
|
||||
if (empty($basename) || !strpos($requestUri, $basename)) {
|
||||
// no match whatsoever; set it blank
|
||||
$this->_baseUrl = '';
|
||||
return $this;
|
||||
@ -542,7 +544,9 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
|
||||
public function setBasePath($basePath = null)
|
||||
{
|
||||
if ($basePath === null) {
|
||||
$filename = basename($_SERVER['SCRIPT_FILENAME']);
|
||||
$filename = (isset($_SERVER['SCRIPT_FILENAME']))
|
||||
? basename($_SERVER['SCRIPT_FILENAME'])
|
||||
: '';
|
||||
|
||||
$baseUrl = $this->getBaseUrl();
|
||||
if (empty($baseUrl)) {
|
||||
@ -994,4 +998,22 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
|
||||
return $name . ':' . $port;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the client's IP addres
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getClientIp($checkProxy = true)
|
||||
{
|
||||
if ($checkProxy && $this->getServer('HTTP_CLIENT_IP') != null) {
|
||||
$ip = $this->getServer('HTTP_CLIENT_IP');
|
||||
} else if ($checkProxy && $this->getServer('HTTP_X_FORWARDED_FOR') != null) {
|
||||
$ip = $this->getServer('HTTP_X_FORWARDED_FOR');
|
||||
} else {
|
||||
$ip = $this->getServer('REMOTE_ADDR');
|
||||
}
|
||||
|
||||
return $ip;
|
||||
}
|
||||
}
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Controller
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: HttpTestCase.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -15,8 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Controller
|
||||
* @subpackage Request
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Simple.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
*/
|
||||
|
||||
/** Zend_Controller_Request_Abstract */
|
||||
@ -26,7 +27,7 @@ require_once 'Zend/Controller/Request/Abstract.php';
|
||||
* @category Zend
|
||||
* @package Zend_Controller
|
||||
* @subpackage Request
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Controller_Request_Simple extends Zend_Controller_Request_Abstract
|
||||
|
Reference in New Issue
Block a user