本文整理汇总了PHP中W3_Request::get_request方法的典型用法代码示例。如果您正苦于以下问题:PHP W3_Request::get_request方法的具体用法?PHP W3_Request::get_request怎么用?PHP W3_Request::get_request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类W3_Request
的用法示例。
在下文中一共展示了W3_Request::get_request方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Returns request value
*
* @param string $key
* @param mixed $default
* @return mixed
*/
function get($key, $default = null)
{
$request = W3_Request::get_request();
if (isset($request[$key])) {
$value = $request[$key];
if (defined('TEMPLATEPATH') || get_magic_quotes_gpc()) {
$value = w3_stripslashes($value);
}
return $value;
}
return $default;
}
示例2: read_request
/**
* Reads config from request
*/
function read_request()
{
require_once W3TC_LIB_W3_DIR . '/Request.php';
$request = W3_Request::get_request();
foreach ($this->_keys as $key => $type) {
$request_key = str_replace('.', '_', $key);
if (!isset($request[$request_key])) {
continue;
}
switch ($type) {
case 'string':
$this->set($key, W3_Request::get_string($request_key));
break;
case 'int':
case 'integer':
$this->set($key, W3_Request::get_integer($request_key));
break;
case 'float':
case 'double':
$this->set($key, W3_Request::get_double($request_key));
break;
case 'bool':
case 'boolean':
$this->set($key, W3_Request::get_boolean($request_key));
break;
case 'array':
$this->set($key, W3_Request::get_array($request_key));
break;
}
}
}
示例3: read_request
/**
* Reads config from request
*
* @param W3_Config|W3_ConfigAdmin $config
*/
function read_request($config)
{
w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
$request = W3_Request::get_request();
foreach ($request as $request_key => $request_value) {
if (is_array($request_value)) {
array_map('stripslashes_deep', $request_value);
} else {
$request_value = stripslashes($request_value);
}
if (strpos($request_key, 'memcached_servers')) {
$request_value = explode(',', $request_value);
}
$config->set($request_key, $request_value);
}
}
示例4: get_as_array
/**
* Returns array value
*
* @param string $prefix
* @param array $default
* @return array
*/
static function get_as_array($prefix, $default = array())
{
$request = W3_Request::get_request();
$array = array();
foreach ($request as $key => $value) {
if (strpos($key, $prefix) === 0) {
$array[substr($key, strlen($prefix))] = $value;
}
}
return $array;
}