Синхронизировал частично с CMS2
This commit is contained in:
parent
6b412f5d6f
commit
f2938b1353
30 changed files with 1447 additions and 1099 deletions
|
|
@ -10,6 +10,8 @@ class WrongRequestException extends Exception
|
|||
// HTTPRequest = ArrayAccess
|
||||
class HttpRequest extends Collection implements ArrayAccess
|
||||
{
|
||||
|
||||
public $_session;
|
||||
/**
|
||||
* Constructor
|
||||
* Stores "request data" in GPC order.
|
||||
|
|
@ -24,9 +26,8 @@ class HttpRequest extends Collection implements ArrayAccess
|
|||
|
||||
$ajax = $this->isAjax();
|
||||
foreach ($list as $key => $value) {
|
||||
$data = new SafeCollection();
|
||||
$data = new Collection();
|
||||
$data->import($value);
|
||||
|
||||
parent::set($key, $data);
|
||||
}
|
||||
|
||||
|
|
@ -35,50 +36,32 @@ class HttpRequest extends Collection implements ArrayAccess
|
|||
parent::set('files', $data);
|
||||
}
|
||||
|
||||
function get($key, $default = null)
|
||||
{
|
||||
return parent::get('data')->get($key, $default);
|
||||
}
|
||||
|
||||
function session($value = false)
|
||||
{
|
||||
if ($value) {
|
||||
$this->session = $value;
|
||||
}
|
||||
return $this->session;
|
||||
}
|
||||
|
||||
function set($key, $value)
|
||||
{
|
||||
return parent::get('data')->set($key, $value);
|
||||
}
|
||||
|
||||
|
||||
function _get($key)
|
||||
{
|
||||
return parent::get($key);
|
||||
}
|
||||
|
||||
function export()
|
||||
function get($key, $default = null)
|
||||
{
|
||||
return parent::get('data')->export();
|
||||
return parent::get('data')->get($key, $default);
|
||||
}
|
||||
|
||||
function session(Session $value = null)
|
||||
{
|
||||
if ($value) {
|
||||
$this->_session = $value;
|
||||
}
|
||||
return $this->_session;
|
||||
}
|
||||
|
||||
/* Array Acces Interface */
|
||||
function offsetExists($offset)
|
||||
function set($key, /*.any.*/$value)
|
||||
{
|
||||
return parent::get('data')->set($key, $value);
|
||||
}
|
||||
|
||||
function offsetGet($offset)
|
||||
{
|
||||
}
|
||||
|
||||
function offsetSet($offset, $value)
|
||||
{
|
||||
}
|
||||
|
||||
function offsetUnset($offset)
|
||||
function export($key = 'data')
|
||||
{
|
||||
return parent::get($key)->export();
|
||||
}
|
||||
|
||||
function clear()
|
||||
|
|
@ -125,4 +108,22 @@ class HttpRequest extends Collection implements ArrayAccess
|
|||
{
|
||||
return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest');
|
||||
}
|
||||
|
||||
public function redirect($url) {
|
||||
header('location: ' . $url);
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
public function offsetSet($key, $value) {
|
||||
}
|
||||
|
||||
public function offsetExists($key) {
|
||||
}
|
||||
|
||||
public function offsetUnset($key) {
|
||||
}
|
||||
|
||||
public function offsetGet($key) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue