First release of domframework
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1207 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
18
outputjson.php
Normal file
18
outputjson.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
require_once ("output.php");
|
||||
class outputjson extends output
|
||||
{
|
||||
public function out ($data)
|
||||
{
|
||||
if (!function_exists ("json_encode"))
|
||||
throw new Exception ("JSON support not available in PHP ! apt-get ".
|
||||
"install php5-json", 500);
|
||||
@header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
@header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
|
||||
@header('Last-Modified: '.gmdate ('D, d M Y H:i:s').' GMT');
|
||||
@header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
@header('Pragma: no-cache');
|
||||
@header ("Content-Type: application/json");
|
||||
echo json_encode ($data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user