Ops sync
parent
eff5bc7bb3
commit
f6e1c65ea4
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace OCA\Office;
|
||||||
|
|
||||||
|
class Request {
|
||||||
|
protected $data = array();
|
||||||
|
|
||||||
|
public function __construct(){
|
||||||
|
$this->data = json_decode(file_get_contents('php://input'), true);
|
||||||
|
}
|
||||||
|
public function getParam($name){
|
||||||
|
$path = explode('/', $name);
|
||||||
|
|
||||||
|
reset($path);
|
||||||
|
$index = current($path);
|
||||||
|
$param = $this->data;
|
||||||
|
do {
|
||||||
|
if (!array_key_exists($index, $param)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
$param = $param[$index];
|
||||||
|
} while (($index = next($path)) !== false);
|
||||||
|
|
||||||
|
return $param;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue