File modules/cms/output/PHPSerializeOutput.class.php

Last commit: Sat Oct 17 01:14:30 2026 +0200	Jan Dankert	New: Using a structured class for the API-Response. The output for GET-Requests is now without the "output" layer.
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(array $data ): string 18 { 19 header('Content-Type: application/json; charset=UTF-8'); 20 return serialize($data); 21 } 22 23 public function getContentType(): string 24 { 25 return 'application/php-serialized'; 26 } 27 }
Download modules/cms/output/PHPSerializeOutput.class.php
History Sat, 17 Oct 2026 01:14:30 +0200 Jan Dankert New: Using a structured class for the API-Response. The output for GET-Requests is now without the "output" layer. Mon, 31 Jan 2022 00:00:48 +0100 dankert Some documentation... Sun, 30 Jan 2022 23:38:42 +0100 dankert Refactoring: Only 1 http-endpoint for both the UI and the API. Path "/api" is not available any more, all API data is served under "/".