szurubooru/src/Helpers/InputReader.php

24 lines
423 B
PHP
Raw Normal View History

<?php
namespace Szurubooru\Helpers;
final class InputReader
{
public function __construct()
{
2014-08-30 23:17:54 +02:00
$_PUT = [];
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;
}
}
public function __get($key)
{
return null;
}
}