From 9e1ee98ff768cf4fef12cd5deadfb9db8b8e9ac4 Mon Sep 17 00:00:00 2001 From: Stephan Kasdorf Date: Thu, 1 Oct 2020 00:06:10 +0200 Subject: [PATCH] Version 0.9.5 beta - added additional json/application headers for a possible REST module --- core/c/view.php | 9 +++++++++ core/i/view.php | 17 ++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/core/c/view.php b/core/c/view.php index 404b8c1..ab86750 100755 --- a/core/c/view.php +++ b/core/c/view.php @@ -83,6 +83,15 @@ class View implements IView exit(); } + /** + * @desc setting response to application json headers + */ + public static function forwardToJsonHeader() + { + header(self::NIBIRU_CONTENT_TYPE_JSON, true); + header(self::NIBIRU_CONTENT_TYPE_CONNECTION, true); + } + /** * @param $page */ diff --git a/core/i/view.php b/core/i/view.php index 416324b..9727025 100644 --- a/core/i/view.php +++ b/core/i/view.php @@ -10,11 +10,14 @@ namespace Nibiru; */ interface IView { - const NIBIRU_SETTINGS = "SETTINGS"; - const NIBIRU_URL = "pageurl"; - const NIBIRU_ERROR = "ERROR"; - const NIBIRU_SECURITY = "SECURITY"; - const NIBIRU_ROUTING = "ROUTING"; - const NIBIRU_EMAIL = "EMAIL"; - const NIBIRU_FILE_END = ".tpl"; + const NIBIRU_SETTINGS = "SETTINGS"; + const NIBIRU_URL = "pageurl"; + const NIBIRU_ERROR = "ERROR"; + const NIBIRU_SECURITY = "SECURITY"; + const NIBIRU_ROUTING = "ROUTING"; + const NIBIRU_EMAIL = "EMAIL"; + const NIBIRU_FILE_END = ".tpl"; + const NIBIRU_CONTENT_TYPE_JSON = "Content-Type: application/json"; + const NIBIRU_CONTENT_TYPE_CONNECTION = "Connection: keep-alive"; + const NIBIRU_CONTENT_RESPONSE_OK = "HTTP/1.1 200 OK"; } \ No newline at end of file