2014-08-30 18:11:32 +02:00
|
|
|
<?php
|
|
|
|
namespace Szurubooru\Helpers;
|
|
|
|
|
|
|
|
final class InputReader
|
|
|
|
{
|
|
|
|
public function __construct()
|
|
|
|
{
|
2014-08-30 23:17:54 +02:00
|
|
|
$_PUT = [];
|
2014-09-06 17:51:04 +02:00
|
|
|
if (isset($_SERVER['REQUEST_METHOD']) and $_SERVER['REQUEST_METHOD'] == 'PUT')
|
2014-08-30 23:17:54 +02:00
|
|
|
parse_str(file_get_contents('php://input'), $_PUT);
|
|
|
|
|
|
|
|
foreach ([$_GET, $_POST, $_PUT] as $source)
|
|
|
|
{
|
|
|
|
foreach ($source as $key => $value)
|
|
|
|
$this->$key = $value;
|
|
|
|
}
|
2014-08-30 18:11:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function __get($key)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|