// Abort to keep from breaking...
return $matches;
}
-
+
$router = new PathRouter;
// Raw PATH_INFO style
/**
* Recursively normalizes UTF-8 strings in the given array.
*
- * @param $data string or array
- * @return cleaned-up version of the given
+ * @param $data string|array
+ * @return array|string cleaned-up version of the given
* @private
*/
function normalizeUnicode( $data ) {
return $ret;
}
+
+ /**
+ * Unset an arbitrary value from our get/post data.
+ *
+ * @param $key String: key name to use
+ * @return Mixed: old value if one was present, null otherwise
+ */
+ public function unsetVal( $key ) {
+ if ( !isset( $this->data[$key] ) ) {
+ $ret = null;
+ } else {
+ $ret = $this->data[$key];
+ unset( $this->data[$key] );
+ }
+ return $ret;
+ }
+
/**
* Fetch an array from the input or return $default if it's not set.
* If source was scalar, will return an array with a single element.
$retVal = array();
foreach ( $names as $name ) {
- $value = $this->getVal( $name );
+ $value = $this->getGPCVal( $this->data, $name, null );
if ( !is_null( $value ) ) {
$retVal[$name] = $value;
}
* @return Array
*/
public function getQueryValues() {
- return $_GET;
+ return $_GET;
}
/**
* Get a request header, or false if it isn't set
* @param $name String: case-insensitive header name
*
- * @return string|false
+ * @return string|bool False on failure
*/
public function getHeader( $name ) {
$this->initHeaders();
/**
* Fetch the raw IP from the request
*
+ * @since 1.19
+ *
* @return String
*/
protected function getRawIP() {
/**
* Work out the IP address based on various globals
* For trusted proxies, use the XFF client IP (first of the chain)
+ *
+ * @since 1.19
+ *
* @return string
*/
public function getIP() {
* (cookies, session and headers).
*
* @ingroup HTTP
+ * @since 1.19
*/
class DerivativeRequest extends FauxRequest {
private $base;