openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

PHPSerializeOutput.class.php (502B)


      1 <?php
      2 
      3 namespace cms\output;
      4 
      5 use cms\output\APIOutput;
      6 use util\json\JSON;
      7 
      8 /**
      9  * Renders as a internal serialized PHP array.
     10  * A PHP powered client may simply unserialize it.
     11  */
     12 class PHPSerializeOutput extends APIOutput
     13 {
     14 	/**
     15      * Renders the output in JSON Format.
     16      */
     17     protected function renderOutput( $data )
     18 	{
     19 		header('Content-Type: application/json; charset=UTF-8');
     20 		return serialize($data);
     21 	}
     22 
     23 	public function getContentType()
     24 	{
     25 		return 'application/php-serialized';
     26 	}
     27 }