<?php class ZirrorAPI_Request { private $rData; private $rawData; function __construct() { $rMethod = isset ( $_SERVER ['REQUEST_METHOD'] ) ? $_SERVER ['REQUEST_METHOD'] : "FAIL"; switch ($rMethod) { case 'POST' : $this->rawData = file_get_contents ( "php://input" ); break; default : Header ( "Location: http://www.Zirror.com" ); exit ( 0 ); } $this->rData = json_decode ( $this->rawData ); } function get($key) { if (! isset ( $this->rData->$key )) { return false; } else return $this->rData->$key; } } ?>