source: Dev/trunk/src/client/dojo/tests/store/index.php

Last change on this file was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 574 bytes
Line 
1<?php
2
3$data = array(
4        "method" => strtoupper($_SERVER["REQUEST_METHOD"]),
5        "headers" => array(),
6        "content" => null
7);
8
9foreach($_SERVER as $key => $value){
10        if(strpos($key, "HTTP_") === 0){
11                $data["headers"][strtr(strtolower(substr($key, 5)), "_", "-")] = $value;
12        }
13}
14
15if($data["method"] === "GET"){
16        $data["content"] = $_GET;
17}elseif($data["method"] === "PUT" || $data["method"] === "POST"){
18        $data["content"] = json_decode(file_get_contents("php://input"), true);
19}
20
21header("Content-Type: application/json");
22header("Cache-Control: no-cache");
23echo json_encode($data);
Note: See TracBrowser for help on using the repository browser.