From 5b82eaa43252ccc0dfa277f31949929a4c4bc994 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 31 Aug 2017 18:07:34 -0500 Subject: [PATCH] Update: use late static binding for class constants This is done to encourage the use of classes that extend a parent class that only need to change a single constant. This is done by replacing self:: with static:: for class constants. see: http://php.net/manual/en/language.oop5.late-static-bindings.php --- common/base/classes/base_charset.php | 42 +- common/base/classes/base_cookie.php | 22 +- common/base/classes/base_error.php | 12 +- .../base/classes/base_error_messages_english.php | 50 +- .../base/classes/base_error_messages_japanese.php | 48 +- common/base/classes/base_http.php | 2718 ++++++++++---------- common/base/classes/base_http_status.php | 132 +- common/base/classes/base_log.php | 8 +- common/base/classes/base_markup.php | 4 +- common/base/classes/base_mime.php | 252 +- common/base/classes/base_path.php | 6 +- common/base/classes/base_rfc_string.php | 12 +- common/base/classes/base_roles.php | 108 +- common/base/classes/base_session.php | 14 +- common/base/classes/base_utf8.php | 22 +- common/standard/classes/standard_index.php | 2 +- common/standard/classes/standard_menu.php | 26 +- common/standard/classes/standard_path.php | 138 +- .../standard/classes/standard_path_exception.php | 4 +- common/standard/classes/standard_paths.php | 86 +- common/standard/menus/menu_breadcrumbs.php | 4 +- common/standard/menus/menu_utility.php | 16 +- common/standard/paths/u/user_login.php | 4 +- common/standard/paths/u/user_settings.php | 22 +- common/theme/classes/theme_form.php | 488 ++-- common/theme/classes/theme_html.php | 4 +- common/theme/classes/theme_markup.php | 70 +- documentation/class_self_references.txt | 85 + 28 files changed, 2246 insertions(+), 2153 deletions(-) create mode 100644 documentation/class_self_references.txt diff --git a/common/base/classes/base_charset.php b/common/base/classes/base_charset.php index 4053dd7..256130f 100644 --- a/common/base/classes/base_charset.php +++ b/common/base/classes/base_charset.php @@ -46,7 +46,7 @@ class c_base_charset { return c_base_return_error::s_false($error); } - if ($charset < self::ASCII || $charset > self::ISO_8859_16) { + if ($charset < static::ASCII || $charset > static::ISO_8859_16) { return new c_base_return_false(); } @@ -70,45 +70,45 @@ class c_base_charset { } switch ($charset) { - case self::UTF_8: + case static::UTF_8: return c_base_return_string::s_new('UTF-8'); - case self::ASCII: + case static::ASCII: return c_base_return_string::s_new('ASCII'); - case self::UTF_16: + case static::UTF_16: return c_base_return_string::s_new('UTF-16'); - case self::UTF_32: + case static::UTF_32: return c_base_return_string::s_new('UTF-32'); - case self::ISO_8859_1: + case static::ISO_8859_1: return c_base_return_string::s_new('ISO-8859-1'); - case self::ISO_8859_2: + case static::ISO_8859_2: return c_base_return_string::s_new('ISO-8859-2'); - case self::ISO_8859_3: + case static::ISO_8859_3: return c_base_return_string::s_new('ISO-8859-3'); - case self::ISO_8859_4: + case static::ISO_8859_4: return c_base_return_string::s_new('ISO-8859-4'); - case self::ISO_8859_5: + case static::ISO_8859_5: return c_base_return_string::s_new('ISO-8859-5'); - case self::ISO_8859_6: + case static::ISO_8859_6: return c_base_return_string::s_new('ISO-8859-6'); - case self::ISO_8859_7: + case static::ISO_8859_7: return c_base_return_string::s_new('ISO-8859-7'); - case self::ISO_8859_8: + case static::ISO_8859_8: return c_base_return_string::s_new('ISO-8859-8'); - case self::ISO_8859_9: + case static::ISO_8859_9: return c_base_return_string::s_new('ISO-8859-9'); - case self::ISO_8859_10: + case static::ISO_8859_10: return c_base_return_string::s_new('ISO-8859-10'); - case self::ISO_8859_11: + case static::ISO_8859_11: return c_base_return_string::s_new('ISO-8859-11'); - case self::ISO_8859_12: + case static::ISO_8859_12: return c_base_return_string::s_new('ISO-8859-12'); - case self::ISO_8859_13: + case static::ISO_8859_13: return c_base_return_string::s_new('ISO-8859-13'); - case self::ISO_8859_14: + case static::ISO_8859_14: return c_base_return_string::s_new('ISO-8859-14'); - case self::ISO_8859_15: + case static::ISO_8859_15: return c_base_return_string::s_new('ISO-8859-15'); - case self::ISO_8859_16: + case static::ISO_8859_16: return c_base_return_string::s_new('ISO-8859-16'); } diff --git a/common/base/classes/base_cookie.php b/common/base/classes/base_cookie.php index 263b12a..4d73389 100644 --- a/common/base/classes/base_cookie.php +++ b/common/base/classes/base_cookie.php @@ -56,13 +56,13 @@ class c_base_cookie extends c_base_return_array { $this->secure = TRUE; $this->max_age = NULL; $this->expires = NULL; - $this->path = self::DEFAULT_PATH; + $this->path = static::DEFAULT_PATH; $this->domain = NULL; $this->http_only = FALSE; $this->first_only = TRUE; $this->host_only = TRUE; $this->same_site = TRUE; - $this->json_encode_depth = self::DEFAULT_JSON_ENCODE_DEPTH; + $this->json_encode_depth = static::DEFAULT_JSON_ENCODE_DEPTH; $this->p_set_lifetime_default(); } @@ -337,7 +337,7 @@ class c_base_cookie extends c_base_return_array { public function get_path() { // this flag should never be undefined, if it is NULL, then force the default. if (is_null($this->path)) { - $this->path = self::DEFAULT_PATH; + $this->path = static::DEFAULT_PATH; } return c_base_return_string::s_new($this->path); @@ -514,9 +514,9 @@ class c_base_cookie extends c_base_return_array { } switch ($same_site) { - case self::SAME_SITE_NONE: - case self::SAME_SITE_RELAXED: - case self::SAME_SITE_STRICT: + case static::SAME_SITE_NONE: + case static::SAME_SITE_RELAXED: + case static::SAME_SITE_STRICT: $this->same_site = $same_site; break; default: @@ -538,7 +538,7 @@ class c_base_cookie extends c_base_return_array { public function get_same_site() { // this flag should never be undefined, if it is NULL, then force the default. if (is_null($this->same_site)) { - $this->same_site = self::SAME_SITE_RELAXED; + $this->same_site = static::SAME_SITE_RELAXED; } return c_base_return_int::s_new($this->same_site); @@ -790,7 +790,7 @@ class c_base_cookie extends c_base_return_array { private function p_set_lifetime_default() { $lifetime = ini_get('session.cookie_lifetime'); if ($lifetime <= 0) { - $lifetime = self::DEFAULT_LIFETIME; + $lifetime = static::DEFAULT_LIFETIME; } $this->max_age = $lifetime; @@ -935,13 +935,13 @@ class c_base_cookie extends c_base_return_array { } switch ($this->same_site) { - case self::SAME_SITE_NONE: + case static::SAME_SITE_NONE: $cookie .= ' samesite=no_restriction;'; break; - case self::SAME_SITE_RELAXED: + case static::SAME_SITE_RELAXED: $cookie .= ' samesite=lax;'; break; - case self::SAME_SITE_STRICT: + case static::SAME_SITE_STRICT: $cookie .= ' samesite=strict;'; break; } diff --git a/common/base/classes/base_error.php b/common/base/classes/base_error.php index b2057ad..e00dc4c 100644 --- a/common/base/classes/base_error.php +++ b/common/base/classes/base_error.php @@ -80,8 +80,6 @@ class c_base_error { $this->ignore_arguments = TRUE; $this->code = NULL; - - } /** @@ -153,11 +151,11 @@ class c_base_error { $entry->set_code(0); } - if (is_int($severity) && $severity >= self::SEVERITY_EMERGENCY && $severity < self::SEVERITY_UNKNOWN) { + if (is_int($severity) && $severity >= static::SEVERITY_EMERGENCY && $severity < static::SEVERITY_UNKNOWN) { $entry->set_severity($severity); } elseif (is_null($severity)) { - $entry->set_severity(self::SEVERITY_ERROR); + $entry->set_severity(static::SEVERITY_ERROR); } if (is_int($limit) && $limit >= 0) { @@ -405,7 +403,7 @@ class c_base_error { */ public function get_severity() { if (is_null($this->severity)) { - $this->severity = self::SEVERITY_ERROR; + $this->severity = static::SEVERITY_ERROR; } return $this->severity; @@ -423,7 +421,7 @@ class c_base_error { */ public function get_limit() { if ($limit !== FALSE && (!is_int($limit) || $limit < 0)) { - $this->limit = self::DEFAULT_BACKTRACE_LIMIT; + $this->limit = static::DEFAULT_BACKTRACE_LIMIT; } return $this->limit; @@ -527,7 +525,7 @@ class c_base_error { } if (is_null($this->limit)) { - $this->limit = self::DEFAULT_BACKTRACE_LIMIT; + $this->limit = static::DEFAULT_BACKTRACE_LIMIT; } // Make sure unnecessary backtrace logs are not part of the count. diff --git a/common/base/classes/base_error_messages_english.php b/common/base/classes/base_error_messages_english.php index 14d64a2..17a7a6d 100644 --- a/common/base/classes/base_error_messages_english.php +++ b/common/base/classes/base_error_messages_english.php @@ -125,7 +125,7 @@ final class c_base_error_messages_english implements i_base_error_messages { $function_name_string = ' while calling :{function_name}'; } - if ($code === self::INVALID_ARGUMENT) { + if ($code === static::INVALID_ARGUMENT) { if ($arguments === TRUE) { return c_base_return_string::s_new('An invalid argument, :{argument_name}, has been specified' . $function_name_string . '.'); } @@ -133,7 +133,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('An invalid argument has been specified' . $function_name_string . '.'); } } - elseif ($code === self::INVALID_FORMAT) { + elseif ($code === static::INVALID_FORMAT) { if ($arguments === TRUE) { return c_base_return_string::s_new('The argument, :{format_name}, has an invalid format' . $function_name_string . '.:{expected_format}'); } @@ -141,7 +141,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('An invalid format has been specified.'); } } - elseif ($code === self::INVALID_SESSION) { + elseif ($code === static::INVALID_SESSION) { if ($arguments === TRUE) { return c_base_return_string::s_new('The requested session is invalid' . $function_name_string . '.'); } @@ -149,7 +149,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('The requested session is invalid.'); } } - elseif ($code === self::INVALID_VARIABLE) { + elseif ($code === static::INVALID_VARIABLE) { if ($arguments === TRUE) { return c_base_return_string::s_new('The variable, :{variable_name}, is invalid' . $function_name_string . '.'); } @@ -157,7 +157,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('An invalid variable has been specified.'); } } - elseif ($code === self::OPERATION_FAILURE) { + elseif ($code === static::OPERATION_FAILURE) { if ($arguments === TRUE) { return c_base_return_string::s_new('Failed to perform operation, :{operation_name}' . (is_null($function_name_string) ? '' : ',') . $function_name_string . '.'); } @@ -165,7 +165,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('Failed to perform operation.'); } } - elseif ($code === self::OPERATION_UNECESSARY) { + elseif ($code === static::OPERATION_UNECESSARY) { if ($arguments === TRUE) { return c_base_return_string::s_new('Did not perform unnecessary operation, :{operation_name}' . (is_null($function_name_string) ? '' : ',') . $function_name_string . '.'); } @@ -173,7 +173,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('Did not perform unnecessary operation.'); } } - elseif ($code === self::FUNCTION_FAILURE) { + elseif ($code === static::FUNCTION_FAILURE) { if ($arguments === TRUE) { return c_base_return_string::s_new('The function, :{function_name}, has failed execution.'); } @@ -181,7 +181,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('A function has failed execution.'); } } - elseif ($code === self::NOT_FOUND) { + elseif ($code === static::NOT_FOUND) { if ($arguments === TRUE) { return c_base_return_string::s_new('Not found' . $function_name_string . '.'); } @@ -189,7 +189,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('Not found.'); } } - elseif ($code === self::NOT_FOUND_ARRAY_INDEX) { + elseif ($code === static::NOT_FOUND_ARRAY_INDEX) { if ($arguments === TRUE) { return c_base_return_string::s_new('The index, :{index_name}, was not found in the array, :{array_name}' . $function_name_string . '.'); } @@ -197,7 +197,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('Failed to find index within specified array.'); } } - elseif ($code === self::NOT_FOUND_FILE) { + elseif ($code === static::NOT_FOUND_FILE) { if ($arguments === TRUE) { return c_base_return_string::s_new('The file, :{file_name}, was not found or cannot be accessed' . $function_name_string . '.'); } @@ -205,7 +205,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('File not found or cannot be accessed.'); } } - elseif ($code === self::NOT_FOUND_DIRECTORY) { + elseif ($code === static::NOT_FOUND_DIRECTORY) { if ($arguments === TRUE) { return c_base_return_string::s_new('The directory, :{directory_name}, was not found or cannot be accessed' . $function_name_string . '.'); } @@ -213,7 +213,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('File not found or cannot be accessed.'); } } - elseif ($code === self::NOT_FOUND_PATH) { + elseif ($code === static::NOT_FOUND_PATH) { if ($arguments === TRUE) { return c_base_return_string::s_new('The path, :{path_name}, was not found or cannot be accessed' . $function_name_string . '.'); } @@ -221,7 +221,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('Path not found or cannot be accessed.'); } } - elseif ($code === self::NOT_DEFINED) { + elseif ($code === static::NOT_DEFINED) { if ($arguments === TRUE) { return c_base_return_string::s_new('The requested data, :{data_name}, is not defined' . $function_name_string . '.'); } @@ -229,7 +229,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('The requested data is not defined.'); } } - elseif ($code === self::NO_CONNECTION) { + elseif ($code === static::NO_CONNECTION) { if ($arguments === TRUE) { return c_base_return_string::s_new('The resource, :{resource_name}, is not connected' . $function_name_string . '.'); } @@ -237,7 +237,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('The resource is not connected.'); } } - elseif ($code === self::NO_SUPPORT) { + elseif ($code === static::NO_SUPPORT) { if ($arguments === TRUE) { return c_base_return_string::s_new('The functionality, :{functionality_name}, is currently not supported.' . $function_name_string . '.'); } @@ -245,7 +245,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('The requested functionality is not supported.'); } } - elseif ($code === self::POSTGRESQL_CONNECTION_FAILURE) { + elseif ($code === static::POSTGRESQL_CONNECTION_FAILURE) { if ($arguments === TRUE) { return c_base_return_string::s_new('Failed to connect to the database, :{database_name}, reasons: :{failure_reasons}' . (is_null($function_name_string) ? '' : ',') . $function_name_string . '.'); } @@ -253,7 +253,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('Failed to connect to the database.'); } } - elseif ($code === self::POSTGRESQL_NO_CONNECTION) { + elseif ($code === static::POSTGRESQL_NO_CONNECTION) { if ($arguments === TRUE) { return c_base_return_string::s_new('The database, :{database_name}, is not connected' . $function_name_string . '.'); } @@ -261,7 +261,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('The database is not connected.'); } } - elseif ($code === self::POSTGRESQL_NO_RESOURCE) { + elseif ($code === static::POSTGRESQL_NO_RESOURCE) { if ($arguments === TRUE) { return c_base_return_string::s_new('No database resource is available' . $function_name_string . '.'); } @@ -269,7 +269,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('No database resource is available.'); } } - elseif ($code === self::POSTGRESQL_ERROR) { + elseif ($code === static::POSTGRESQL_ERROR) { if ($arguments === TRUE) { return c_base_return_string::s_new('Database query error: :{database_error_message}' . $function_name_string . '.'); } @@ -277,7 +277,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('Failed to perform database query.'); } } - elseif ($code === self::SOCKET_FAILURE) { + elseif ($code === static::SOCKET_FAILURE) { if ($arguments === TRUE) { return c_base_return_string::s_new('Failed to perform socket operation, :{operation_name}, socket error (:{socket_error}) \':{socket_error_message}\'' . (is_null($function_name_string) ? '' : ',') . $function_name_string . '.'); } @@ -285,7 +285,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('Failed to perform socket operation.'); } } - elseif ($code === self::ACCESS_DENIED) { + elseif ($code === static::ACCESS_DENIED) { if ($arguments === TRUE) { return c_base_return_string::s_new('Access is denied, :{operation_name}' . (is_null($function_name_string) ? '' : ',') . $function_name_string . '.'); } @@ -293,7 +293,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('Access is denied.'); } } - elseif ($code === self::ACCESS_DENIED_UNAVAILABLE) { + elseif ($code === static::ACCESS_DENIED_UNAVAILABLE) { if ($arguments === TRUE) { return c_base_return_string::s_new('Access is denied due to unavailability, :{operation_name} ' . (is_null($function_name_string) ? '' : ',') . $function_name_string . '.'); } @@ -301,7 +301,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('Access is denied due to unavailability.'); } } - elseif ($code === self::ACCESS_DENIED_USER) { + elseif ($code === static::ACCESS_DENIED_USER) { if ($arguments === TRUE) { return c_base_return_string::s_new('Access is denied for user :name_machine_user (:{id_user}), :{operation_name} ' . (is_null($function_name_string) ? '' : ',') . $function_name_string . '.'); } @@ -309,7 +309,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('Access is denied for user.'); } } - elseif ($code === self::ACCESS_DENIED_ADMINISTRATION) { + elseif ($code === static::ACCESS_DENIED_ADMINISTRATION) { if ($arguments === TRUE) { return c_base_return_string::s_new('Access is denied for administrative reasons, :{operation_name} ' . (is_null($function_name_string) ? '' : ',') . $function_name_string . '.'); } @@ -317,7 +317,7 @@ final class c_base_error_messages_english implements i_base_error_messages { return c_base_return_string::s_new('Access is denied for administrative reasons.'); } } - elseif ($code === self::SERVER_ERROR) { + elseif ($code === static::SERVER_ERROR) { if ($arguments === TRUE) { return c_base_return_string::s_new('A server error has occurred, :{operation_name} ' . (is_null($function_name_string) ? '' : ',') . $function_name_string . '.'); } diff --git a/common/base/classes/base_error_messages_japanese.php b/common/base/classes/base_error_messages_japanese.php index 28be0c3..933a45e 100644 --- a/common/base/classes/base_error_messages_japanese.php +++ b/common/base/classes/base_error_messages_japanese.php @@ -130,7 +130,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { $function_name_string = ' :{function_name} を呼び出している間'; } - if ($code === self::INVALID_ARGUMENT) { + if ($code === static::INVALID_ARGUMENT) { if ($arguments === TRUE) { return c_base_return_string::s_new('無効な引数 :{argument_name} が指定されています' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -138,7 +138,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('無効な引数が指定されています' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } } - elseif ($code === self::INVALID_FORMAT) { + elseif ($code === static::INVALID_FORMAT) { if ($arguments === TRUE) { return c_base_return_string::s_new('引数 :{format_name} の形式が無効です' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。:{expected_format}'); } @@ -146,7 +146,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('無効な形式が指定されています。'); } } - elseif ($code === self::INVALID_SESSION) { + elseif ($code === static::INVALID_SESSION) { if ($arguments === TRUE) { return c_base_return_string::s_new('要求されたセッションは無効です' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -154,7 +154,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('要求されたセッションは無効です。'); } } - elseif ($code === self::INVALID_VARIABLE) { + elseif ($code === static::INVALID_VARIABLE) { if ($arguments === TRUE) { return c_base_return_string::s_new('変数 :{variable_name} は無効です' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -162,7 +162,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('無効な変数が指定されています。'); } } - elseif ($code === self::OPERATION_FAILURE) { + elseif ($code === static::OPERATION_FAILURE) { if ($arguments === TRUE) { return c_base_return_string::s_new('操作の実行に失敗しました :{operation_name}' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -170,7 +170,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('操作を実行できませんでした。'); } } - elseif ($code === self::OPERATION_UNECESSARY) { + elseif ($code === static::OPERATION_UNECESSARY) { if ($arguments === TRUE) { return c_base_return_string::s_new('不要な操作を実行しませんでした :{operation_name}' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -178,7 +178,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('不要な操作を実行しませんでした。'); } } - elseif ($code === self::FUNCTION_FAILURE) { + elseif ($code === static::FUNCTION_FAILURE) { if ($arguments === TRUE) { return c_base_return_string::s_new('関数 :{function_name} は実行に失敗しました' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -186,7 +186,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('関数の実行に失敗しました。'); } } - elseif ($code === self::NOT_FOUND) { + elseif ($code === static::NOT_FOUND) { if ($arguments === TRUE) { return c_base_return_string::s_new('見つかりません' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -194,7 +194,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('見つかりません。'); } } - elseif ($code === self::NOT_FOUND_ARRAY_INDEX) { + elseif ($code === static::NOT_FOUND_ARRAY_INDEX) { if ($arguments === TRUE) { return c_base_return_string::s_new('配列 :{index_name} に索引 :{array_name} が見つかりませんでした' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -202,7 +202,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('指定された配列内のインデックスの検索に失敗しました。'); } } - elseif ($code === self::NOT_FOUND_FILE) { + elseif ($code === static::NOT_FOUND_FILE) { if ($arguments === TRUE) { return c_base_return_string::s_new('ファイル :{file_name} が見つかりませんでした、またはアクセスできません' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -210,7 +210,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('ファイルが見つからないか、アクセスできません。'); } } - elseif ($code === self::NOT_FOUND_DIRECTORY) { + elseif ($code === static::NOT_FOUND_DIRECTORY) { if ($arguments === TRUE) { return c_base_return_string::s_new('ディレクトリ :{directory_name} が見つかりませんでした、またはアクセスできません' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -218,7 +218,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('ファイルが見つからないか、アクセスできません。'); } } - elseif ($code === self::NOT_FOUND_FILE) { + elseif ($code === static::NOT_FOUND_FILE) { if ($arguments === TRUE) { return c_base_return_string::s_new('パス :{path_name} が見つかりませんでした' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -226,7 +226,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('パスが見つかりません。'); } } - elseif ($code === self::NOT_DEFINED) { + elseif ($code === static::NOT_DEFINED) { if ($arguments === TRUE) { return c_base_return_string::s_new('要求されたデータ:{data_name}は定義されていません' . $function_name_string . '.'); } @@ -234,7 +234,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('要求されたデータは定義されていません。'); } } - elseif ($code === self::NO_CONNECTION) { + elseif ($code === static::NO_CONNECTION) { if ($arguments === TRUE) { return c_base_return_string::s_new('リソース :{resource_name} は接続されていません' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -242,7 +242,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('リソースが接続されていません。'); } } - elseif ($code === self::NO_SUPPORT) { + elseif ($code === static::NO_SUPPORT) { if ($arguments === TRUE) { return c_base_return_string::s_new('機能 :{functionality_name} は現在サポートされていません' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -250,7 +250,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('要求された機能はサポートされていません。'); } } - elseif ($code === self::POSTGRESQL_CONNECTION_FAILURE) { + elseif ($code === static::POSTGRESQL_CONNECTION_FAILURE) { if ($arguments === TRUE) { return c_base_return_string::s_new('データベースへの接続に失敗しました。 :{database_name}' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -258,7 +258,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('データベースに接続できませんでした。'); } } - elseif ($code === self::POSTGRESQL_NO_CONNECTION) { + elseif ($code === static::POSTGRESQL_NO_CONNECTION) { if ($arguments === TRUE) { return c_base_return_string::s_new('データベース :{database_name} は接続されていません' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -266,7 +266,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('データベースが接続されていません。'); } } - elseif ($code === self::POSTGRESQL_NO_RESOURCE) { + elseif ($code === static::POSTGRESQL_NO_RESOURCE) { if ($arguments === TRUE) { return c_base_return_string::s_new('データベースリソースがありません' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -274,7 +274,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('データベースリソースは使用できません。.'); } } - elseif ($code === self::SOCKET_FAILURE) { + elseif ($code === static::SOCKET_FAILURE) { if ($arguments === TRUE) { return c_base_return_string::s_new('ソケット操作の実行に失敗しました。 :{operation_name} 、ソケットエラー(:{socket_error} \':{socket_error_message}\'' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -282,7 +282,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('ソケット操作を実行できませんでした。'); } } - elseif ($code === self::ACCESS_DENIED) { + elseif ($code === static::ACCESS_DENIED) { if ($arguments === TRUE) { return c_base_return_string::s_new('アクセスが拒否されました。 :{operation_name}' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -290,7 +290,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('アクセスは拒否されました。'); } } - elseif ($code === self::ACCESS_DENIED_UNAVAILABLE) { + elseif ($code === static::ACCESS_DENIED_UNAVAILABLE) { if ($arguments === TRUE) { return c_base_return_string::s_new('利用できないためアクセスが拒否されましたが、 :{operation_name} ' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -298,7 +298,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('利用できないためアクセスが拒否されました。'); } } - elseif ($code === self::ACCESS_DENIED_USER) { + elseif ($code === static::ACCESS_DENIED_USER) { if ($arguments === TRUE) { return c_base_return_string::s_new('ユーザーのアクセスが拒否されました :name_machine_user (:{id_user}), :{operation_name} ' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -306,7 +306,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('ユーザーのアクセスが拒否されました。'); } } - elseif ($code === self::ACCESS_DENIED_ADMINISTRATION) { + elseif ($code === static::ACCESS_DENIED_ADMINISTRATION) { if ($arguments === TRUE) { return c_base_return_string::s_new('管理上の理由でアクセスが拒否されました, :{operation_name} ' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } @@ -314,7 +314,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { return c_base_return_string::s_new('管理上の理由からアクセスが拒否されました。'); } } - elseif ($code === self::SERVER_ERROR) { + elseif ($code === static::SERVER_ERROR) { if ($arguments === TRUE) { return c_base_return_string::s_new('サーバーエラーが発生しました, :{operation_name} ' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } diff --git a/common/base/classes/base_http.php b/common/base/classes/base_http.php index 07d990a..aabcd9f 100644 --- a/common/base/classes/base_http.php +++ b/common/base/classes/base_http.php @@ -331,15 +331,15 @@ class c_base_http extends c_base_rfc_string { */ public function get_response_headers_for_meta() { return c_base_return_array::s_new(array( - self::RESPONSE_CACHE_CONTROL => self::RESPONSE_CACHE_CONTROL, - self::RESPONSE_CONTENT_ENCODING => self::RESPONSE_CONTENT_ENCODING, - self::RESPONSE_CONTENT_LANGUAGE => self::RESPONSE_CONTENT_LANGUAGE, - self::RESPONSE_CONTENT_SECURITY_POLICY => self::RESPONSE_CONTENT_SECURITY_POLICY, - self::RESPONSE_CONTENT_TYPE => self::RESPONSE_CONTENT_TYPE, - self::RESPONSE_EXPIRES => self::RESPONSE_EXPIRES, - self::RESPONSE_LINK => self::RESPONSE_LINK, - self::RESPONSE_PRAGMA => self::RESPONSE_PRAGMA, - self::RESPONSE_REFRESH => self::RESPONSE_REFRESH, + static::RESPONSE_CACHE_CONTROL => static::RESPONSE_CACHE_CONTROL, + static::RESPONSE_CONTENT_ENCODING => static::RESPONSE_CONTENT_ENCODING, + static::RESPONSE_CONTENT_LANGUAGE => static::RESPONSE_CONTENT_LANGUAGE, + static::RESPONSE_CONTENT_SECURITY_POLICY => static::RESPONSE_CONTENT_SECURITY_POLICY, + static::RESPONSE_CONTENT_TYPE => static::RESPONSE_CONTENT_TYPE, + static::RESPONSE_EXPIRES => static::RESPONSE_EXPIRES, + static::RESPONSE_LINK => static::RESPONSE_LINK, + static::RESPONSE_PRAGMA => static::RESPONSE_PRAGMA, + static::RESPONSE_REFRESH => static::RESPONSE_REFRESH, )); } @@ -660,49 +660,49 @@ class c_base_http extends c_base_rfc_string { $this->request = array(); $initialize_keys = array( - self::REQUEST_ACCEPT, - self::REQUEST_ACCEPT_CHARSET, - self::REQUEST_ACCEPT_ENCODING, - self::REQUEST_ACCEPT_LANGUAGE, - self::REQUEST_ACCEPT_DATETIME, - self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD, - self::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS, - self::REQUEST_AUTHORIZATION, - self::REQUEST_CACHE_CONTROL, - self::REQUEST_CONNECTION, - self::REQUEST_COOKIE, - self::REQUEST_CONTENT_LENGTH, - self::REQUEST_CONTENT_TYPE, - self::REQUEST_DATE, - self::REQUEST_EXPECT, - self::REQUEST_FROM, - self::REQUEST_HOST, - self::REQUEST_IF_MATCH, - self::REQUEST_IF_MODIFIED_SINCE, - self::REQUEST_IF_NONE_MATCH, - self::REQUEST_IF_RANGE, - self::REQUEST_IF_UNMODIFIED_SINCE, - self::REQUEST_MAX_FORWARDS, - self::REQUEST_METHOD, - self::REQUEST_ORIGIN, - self::REQUEST_PRAGMA, - self::REQUEST_PROXY_AUTHORIZATION, - self::REQUEST_RANGE, - self::REQUEST_REFERER, - self::REQUEST_SCRIPT_NAME, - self::REQUEST_TE, - self::REQUEST_UPGRADE, - self::REQUEST_URI, - self::REQUEST_USER_AGENT, - self::REQUEST_VIA, - self::REQUEST_WARNING, - self::REQUEST_X_REQUESTED_WITH, - self::REQUEST_X_FORWARDED_FOR, - self::REQUEST_X_FORWARDED_HOST, - self::REQUEST_X_FORWARDED_PROTO, - self::REQUEST_CHECKSUM_HEADER, - self::REQUEST_CHECKSUM_HEADERS, - self::REQUEST_CHECKSUM_CONTENT, + static::REQUEST_ACCEPT, + static::REQUEST_ACCEPT_CHARSET, + static::REQUEST_ACCEPT_ENCODING, + static::REQUEST_ACCEPT_LANGUAGE, + static::REQUEST_ACCEPT_DATETIME, + static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD, + static::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS, + static::REQUEST_AUTHORIZATION, + static::REQUEST_CACHE_CONTROL, + static::REQUEST_CONNECTION, + static::REQUEST_COOKIE, + static::REQUEST_CONTENT_LENGTH, + static::REQUEST_CONTENT_TYPE, + static::REQUEST_DATE, + static::REQUEST_EXPECT, + static::REQUEST_FROM, + static::REQUEST_HOST, + static::REQUEST_IF_MATCH, + static::REQUEST_IF_MODIFIED_SINCE, + static::REQUEST_IF_NONE_MATCH, + static::REQUEST_IF_RANGE, + static::REQUEST_IF_UNMODIFIED_SINCE, + static::REQUEST_MAX_FORWARDS, + static::REQUEST_METHOD, + static::REQUEST_ORIGIN, + static::REQUEST_PRAGMA, + static::REQUEST_PROXY_AUTHORIZATION, + static::REQUEST_RANGE, + static::REQUEST_REFERER, + static::REQUEST_SCRIPT_NAME, + static::REQUEST_TE, + static::REQUEST_UPGRADE, + static::REQUEST_URI, + static::REQUEST_USER_AGENT, + static::REQUEST_VIA, + static::REQUEST_WARNING, + static::REQUEST_X_REQUESTED_WITH, + static::REQUEST_X_FORWARDED_FOR, + static::REQUEST_X_FORWARDED_HOST, + static::REQUEST_X_FORWARDED_PROTO, + static::REQUEST_CHECKSUM_HEADER, + static::REQUEST_CHECKSUM_HEADERS, + static::REQUEST_CHECKSUM_CONTENT, ); foreach ($initialize_keys as $initialize_key) { @@ -720,7 +720,7 @@ class c_base_http extends c_base_rfc_string { $headers = array_flip(array_keys($this->headers)); // additional keys for specific cases. - $this->request[self::REQUEST_ACCEPT]['types'] = array(); + $this->request[static::REQUEST_ACCEPT]['types'] = array(); if (array_key_exists('accept', $this->headers)) { @@ -952,7 +952,7 @@ class c_base_http extends c_base_rfc_string { // process all unknown headers and store them in the unknown key, with a max size of 256. if (!empty($headers)) { foreach ($headers as $header_name => $header_value) { - $this->p_load_request_unknown($header_name, self::REQUEST_UNKNOWN, 256); + $this->p_load_request_unknown($header_name, static::REQUEST_UNKNOWN, 256); } unset($header_name); unset($header_value); @@ -984,14 +984,14 @@ class c_base_http extends c_base_rfc_string { // specify a failsafe in case decision making has trouble. $language_chosen = reset($supported_languages); - if (isset($this->request[self::REQUEST_ACCEPT_LANGUAGE]['data']) && is_array($this->request[self::REQUEST_ACCEPT_LANGUAGE]['data'])) { - if (isset($this->request[self::REQUEST_ACCEPT_LANGUAGE]['invalid']) && $this->request[self::REQUEST_ACCEPT_LANGUAGE]['invalid']) {; + if (isset($this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']) && is_array($this->request[static::REQUEST_ACCEPT_LANGUAGE]['data'])) { + if (isset($this->request[static::REQUEST_ACCEPT_LANGUAGE]['invalid']) && $this->request[static::REQUEST_ACCEPT_LANGUAGE]['invalid']) {; $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'supported_languages', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value($language_chosen, 'c_base_return_int', $error); } - if (isset($this->request[self::REQUEST_ACCEPT_LANGUAGE]['data']['weight']) && is_array($this->request[self::REQUEST_ACCEPT_LANGUAGE]['data']['weight'])) { - foreach ($this->request[self::REQUEST_ACCEPT_LANGUAGE]['data']['weight'] as $weight => $aliases) { + if (isset($this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['weight']) && is_array($this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['weight'])) { + foreach ($this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['weight'] as $weight => $aliases) { $alias = end($aliases); $language_code = c_base_defaults_global::s_get_languages()::s_get_id_by_alias($alias)->get_value_exact(); unset($alias); @@ -1037,7 +1037,7 @@ class c_base_http extends c_base_rfc_string { if ($uri == c_base_ascii::ASTERISK) { - $this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN] = array('wildcard' => TRUE); + $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN] = array('wildcard' => TRUE); } else { $text = $this->pr_rfc_string_prepare($uri); @@ -1060,7 +1060,7 @@ class c_base_http extends c_base_rfc_string { unset($parsed['current']); $parsed['wildcard'] = FALSE; - $this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN] = $parsed; + $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN] = $parsed; unset($parsed); } @@ -1087,7 +1087,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS] = $allow_credentials; + $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS] = $allow_credentials; return new c_base_return_true(); } @@ -1129,14 +1129,14 @@ class c_base_http extends c_base_rfc_string { } if ($append) { - if (!isset($this->response[self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS]) || !is_array($this->response[self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS])) { - $this->response[self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS] = array(); + if (!isset($this->response[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS]) || !is_array($this->response[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS])) { + $this->response[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS] = array(); } - $this->response[self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS][$prepared_token] = $prepared_token; + $this->response[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS][$prepared_token] = $prepared_token; } else { - $this->response[self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS] = array($prepared_token => $prepared_token); + $this->response[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS] = array($prepared_token => $prepared_token); } unset($prepared_token); @@ -1163,7 +1163,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_ACCESS_CONTROL_MAX_AGE] = $seconds; + $this->response[static::RESPONSE_ACCESS_CONTROL_MAX_AGE] = $seconds; return new c_base_return_true(); } @@ -1197,25 +1197,25 @@ class c_base_http extends c_base_rfc_string { // this method does nothing. - if ($method === self::HTTP_METHOD_NONE) { + if ($method === static::HTTP_METHOD_NONE) { return new c_base_return_true(); } // require only valid/known methods. switch ($method) { - case self::HTTP_METHOD_NONE: - case self::HTTP_METHOD_GET: - case self::HTTP_METHOD_HEAD: - case self::HTTP_METHOD_POST: - case self::HTTP_METHOD_PUT: - case self::HTTP_METHOD_DELETE: - case self::HTTP_METHOD_TRACE: - case self::HTTP_METHOD_OPTIONS: - case self::HTTP_METHOD_CONNECT: - case self::HTTP_METHOD_PATCH: - case self::HTTP_METHOD_TRACK: - case self::HTTP_METHOD_DEBUG: + case static::HTTP_METHOD_NONE: + case static::HTTP_METHOD_GET: + case static::HTTP_METHOD_HEAD: + case static::HTTP_METHOD_POST: + case static::HTTP_METHOD_PUT: + case static::HTTP_METHOD_DELETE: + case static::HTTP_METHOD_TRACE: + case static::HTTP_METHOD_OPTIONS: + case static::HTTP_METHOD_CONNECT: + case static::HTTP_METHOD_PATCH: + case static::HTTP_METHOD_TRACK: + case static::HTTP_METHOD_DEBUG: break; default: @@ -1225,14 +1225,14 @@ class c_base_http extends c_base_rfc_string { if ($append) { - if (!isset($this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS]) || !is_array($this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS])) { - $this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] = array(); + if (!isset($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS]) || !is_array($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS])) { + $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] = array(); } - $this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS][$method] = $method; + $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS][$method] = $method; } else { - $this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] = array($method => $method); + $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] = array($method => $method); } return new c_base_return_true(); @@ -1272,14 +1272,14 @@ class c_base_http extends c_base_rfc_string { } if ($append) { - if (!isset($this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS]) || !is_array($this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS])) { - $this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS] = array(); + if (!isset($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS]) || !is_array($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS])) { + $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS] = array(); } - $this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS][$prepared_token] = $prepared_token; + $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS][$prepared_token] = $prepared_token; } else { - $this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS] = array($prepared_token => $prepared_token); + $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS] = array($prepared_token => $prepared_token); } unset($prepared_token); @@ -1337,14 +1337,14 @@ class c_base_http extends c_base_rfc_string { unset($parsed['current']); if ($append) { - if (!isset($this->response[self::RESPONSE_ACCEPT_PATCH]) || !is_array($this->response[self::RESPONSE_ACCEPT_PATCH])) { - $this->response[self::RESPONSE_ACCEPT_PATCH] = array(); + if (!isset($this->response[static::RESPONSE_ACCEPT_PATCH]) || !is_array($this->response[static::RESPONSE_ACCEPT_PATCH])) { + $this->response[static::RESPONSE_ACCEPT_PATCH] = array(); } - $this->response[self::RESPONSE_ACCEPT_PATCH][] = $parsed; + $this->response[static::RESPONSE_ACCEPT_PATCH][] = $parsed; } else { - $this->response[self::RESPONSE_ACCEPT_PATCH] = array($parsed); + $this->response[static::RESPONSE_ACCEPT_PATCH] = array($parsed); } unset($parsed); @@ -1384,7 +1384,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_ACCEPT_RANGES] = $prepared_token; + $this->response[static::RESPONSE_ACCEPT_RANGES] = $prepared_token; unset($prepared_token); return new c_base_return_true(); @@ -1409,7 +1409,7 @@ class c_base_http extends c_base_rfc_string { } - $this->response[self::RESPONSE_AGE] = $seconds; + $this->response[static::RESPONSE_AGE] = $seconds; unset($parsed); return new c_base_return_true(); @@ -1445,38 +1445,38 @@ class c_base_http extends c_base_rfc_string { switch ($allow) { - case self::HTTP_METHOD_NONE: - case self::HTTP_METHOD_GET: - case self::HTTP_METHOD_HEAD: - case self::HTTP_METHOD_POST: - case self::HTTP_METHOD_PUT: - case self::HTTP_METHOD_DELETE: - case self::HTTP_METHOD_TRACE: - case self::HTTP_METHOD_OPTIONS: - case self::HTTP_METHOD_CONNECT: - case self::HTTP_METHOD_PATCH: - case self::HTTP_METHOD_TRACK: - case self::HTTP_METHOD_DEBUG: + case static::HTTP_METHOD_NONE: + case static::HTTP_METHOD_GET: + case static::HTTP_METHOD_HEAD: + case static::HTTP_METHOD_POST: + case static::HTTP_METHOD_PUT: + case static::HTTP_METHOD_DELETE: + case static::HTTP_METHOD_TRACE: + case static::HTTP_METHOD_OPTIONS: + case static::HTTP_METHOD_CONNECT: + case static::HTTP_METHOD_PATCH: + case static::HTTP_METHOD_TRACK: + case static::HTTP_METHOD_DEBUG: break; default: $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'allow', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - if ($allow == self::HTTP_METHOD_NONE) { - $this->response[self::RESPONSE_ALLOW] = array($allow => $allow); + if ($allow == static::HTTP_METHOD_NONE) { + $this->response[static::RESPONSE_ALLOW] = array($allow => $allow); return new c_base_return_true(); } if ($append) { - if (!isset($this->response[self::RESPONSE_ALLOW]) || !is_array($this->response[self::RESPONSE_ALLOW])) { - $this->response[self::RESPONSE_ALLOW] = array(); + if (!isset($this->response[static::RESPONSE_ALLOW]) || !is_array($this->response[static::RESPONSE_ALLOW])) { + $this->response[static::RESPONSE_ALLOW] = array(); } - $this->response[self::RESPONSE_ALLOW][$allow] = $allow; + $this->response[static::RESPONSE_ALLOW][$allow] = $allow; } else { - $this->response[self::RESPONSE_ALLOW] = array($allow => $allow); + $this->response[static::RESPONSE_ALLOW] = array($allow => $allow); } return new c_base_return_true(); @@ -1528,18 +1528,18 @@ class c_base_http extends c_base_rfc_string { switch($directive_name) { - case self::CACHE_CONTROL_NO_CACHE: - case self::CACHE_CONTROL_NO_STORE: - case self::CACHE_CONTROL_NO_TRANSFORM: - case self::CACHE_CONTROL_MAX_AGE: - case self::CACHE_CONTROL_MAX_AGE_S: - case self::CACHE_CONTROL_MAX_STALE: - case self::CACHE_CONTROL_MIN_FRESH: - case self::CACHE_CONTROL_ONLY_IF_CACHED: - case self::CACHE_CONTROL_PUBLIC: - case self::CACHE_CONTROL_PRIVATE: - case self::CACHE_CONTROL_MUST_REVALIDATE: - case self::CACHE_CONTROL_PROXY_REVALIDATE: + case static::CACHE_CONTROL_NO_CACHE: + case static::CACHE_CONTROL_NO_STORE: + case static::CACHE_CONTROL_NO_TRANSFORM: + case static::CACHE_CONTROL_MAX_AGE: + case static::CACHE_CONTROL_MAX_AGE_S: + case static::CACHE_CONTROL_MAX_STALE: + case static::CACHE_CONTROL_MIN_FRESH: + case static::CACHE_CONTROL_ONLY_IF_CACHED: + case static::CACHE_CONTROL_PUBLIC: + case static::CACHE_CONTROL_PRIVATE: + case static::CACHE_CONTROL_MUST_REVALIDATE: + case static::CACHE_CONTROL_PROXY_REVALIDATE: break; default: @@ -1570,14 +1570,14 @@ class c_base_http extends c_base_rfc_string { } if ($append) { - if (!isset($this->response[self::RESPONSE_CACHE_CONTROL]) || !is_array($this->response[self::RESPONSE_CACHE_CONTROL])) { - $this->response[self::RESPONSE_CACHE_CONTROL] = array(); + if (!isset($this->response[static::RESPONSE_CACHE_CONTROL]) || !is_array($this->response[static::RESPONSE_CACHE_CONTROL])) { + $this->response[static::RESPONSE_CACHE_CONTROL] = array(); } - $this->response[self::RESPONSE_CACHE_CONTROL][$directive_name] = $directive_value; + $this->response[static::RESPONSE_CACHE_CONTROL][$directive_name] = $directive_value; } else { - $this->response[self::RESPONSE_CACHE_CONTROL] = array($directive_name => $directive_value); + $this->response[static::RESPONSE_CACHE_CONTROL] = array($directive_name => $directive_value); } unset($parsed_directive_value); @@ -1624,14 +1624,14 @@ class c_base_http extends c_base_rfc_string { } if ($append) { - if (!isset($this->response[self::RESPONSE_CONNECTION]) || !is_array($this->response[self::RESPONSE_CONNECTION])) { - $this->response[self::RESPONSE_CONNECTION] = array(); + if (!isset($this->response[static::RESPONSE_CONNECTION]) || !is_array($this->response[static::RESPONSE_CONNECTION])) { + $this->response[static::RESPONSE_CONNECTION] = array(); } - $this->response[self::RESPONSE_CONNECTION][$prepared_token] = $prepared_token; + $this->response[static::RESPONSE_CONNECTION][$prepared_token] = $prepared_token; } else { - $this->response[self::RESPONSE_CONNECTION] = array($prepared_token => $prepared_token); + $this->response[static::RESPONSE_CONNECTION] = array($prepared_token => $prepared_token); } unset($prepared_token); @@ -1842,7 +1842,7 @@ class c_base_http extends c_base_rfc_string { $parsed_parameter_value = NULL; } - if (!isset($this->response[self::RESPONSE_CONTENT_DISPOSITION])) { + if (!isset($this->response[static::RESPONSE_CONTENT_DISPOSITION])) { // type cannot be NULL if there is no type currently assigned. if (is_null($type)) { unset($prepared_token); @@ -1851,23 +1851,23 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_CONTENT_DISPOSITION] = array( + $this->response[static::RESPONSE_CONTENT_DISPOSITION] = array( 'type' => NULL, 'parameters' => array(), ); } if (is_string($type)) { - $this->response[self::RESPONSE_CONTENT_DISPOSITION]['type'] = $prepared_token; + $this->response[static::RESPONSE_CONTENT_DISPOSITION]['type'] = $prepared_token; } unset($prepared_token); if (is_string($parameter_name)) { if ($append) { - $this->response[self::RESPONSE_CONTENT_DISPOSITION]['parameters'][$prepared_parameter_name] = $parsed_parameter_value['text']; + $this->response[static::RESPONSE_CONTENT_DISPOSITION]['parameters'][$prepared_parameter_name] = $parsed_parameter_value['text']; } else { - $this->response[self::RESPONSE_CONTENT_DISPOSITION]['parameters'] = array($prepared_parameter_name => $parsed_parameter_value['text']); + $this->response[static::RESPONSE_CONTENT_DISPOSITION]['parameters'] = array($prepared_parameter_name => $parsed_parameter_value['text']); } } unset($prepared_parameter_name); @@ -1959,17 +1959,17 @@ class c_base_http extends c_base_rfc_string { switch ($encoding) { - case self::ENCODING_CHUNKED: - case self::ENCODING_COMPRESS: - case self::ENCODING_DEFLATE: - case self::ENCODING_GZIP: - case self::ENCODING_BZIP: - case self::ENCODING_LZO: - case self::ENCODING_XZ: - case self::ENCODING_EXI: - case self::ENCODING_IDENTITY: - case self::ENCODING_SDCH: - case self::ENCODING_PG: + case static::ENCODING_CHUNKED: + case static::ENCODING_COMPRESS: + case static::ENCODING_DEFLATE: + case static::ENCODING_GZIP: + case static::ENCODING_BZIP: + case static::ENCODING_LZO: + case static::ENCODING_XZ: + case static::ENCODING_EXI: + case static::ENCODING_IDENTITY: + case static::ENCODING_SDCH: + case static::ENCODING_PG: break; default: $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); @@ -1977,10 +1977,10 @@ class c_base_http extends c_base_rfc_string { } if ($append) { - $this->response[self::RESPONSE_CONTENT_ENCODING][] = $encoding; + $this->response[static::RESPONSE_CONTENT_ENCODING][] = $encoding; } else { - $this->response[self::RESPONSE_CONTENT_ENCODING] = array($encoding); + $this->response[static::RESPONSE_CONTENT_ENCODING] = array($encoding); } return new c_base_return_true(); @@ -2028,7 +2028,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_CONTENT_LANGUAGE] = array($default->get_value_exact()); + $this->response[static::RESPONSE_CONTENT_LANGUAGE] = array($default->get_value_exact()); unset($default); } else { @@ -2037,11 +2037,11 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - if (!isset($this->response[self::RESPONSE_CONTENT_LANGUAGE])) { - $this->response[self::RESPONSE_CONTENT_LANGUAGE] = array(); + if (!isset($this->response[static::RESPONSE_CONTENT_LANGUAGE])) { + $this->response[static::RESPONSE_CONTENT_LANGUAGE] = array(); } - $this->response[self::RESPONSE_CONTENT_LANGUAGE][] = $language; + $this->response[static::RESPONSE_CONTENT_LANGUAGE][] = $language; } return new c_base_return_true(); @@ -2083,17 +2083,17 @@ class c_base_http extends c_base_rfc_string { // From the RFC: "A sender MUST NOT send a Content-Length header field in any message that contains a Transfer-Encoding header field." - if ($force === FALSE && array_key_exists(self::RESPONSE_TRANSFER_ENCODING, $this->response)) { + if ($force === FALSE && array_key_exists(static::RESPONSE_TRANSFER_ENCODING, $this->response)) { return new c_base_return_false(); } if (is_null($length)) { if (is_null($this->content)) { - $this->response[self::RESPONSE_CONTENT_LENGTH] = 0; + $this->response[static::RESPONSE_CONTENT_LENGTH] = 0; } else { if ($this->content_is_file) { - $this->response[self::RESPONSE_CONTENT_LENGTH] = 0; + $this->response[static::RESPONSE_CONTENT_LENGTH] = 0; foreach ($this->content as $filename) { if (!file_exists($filename)) { @@ -2103,16 +2103,16 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_CONTENT_LENGTH] += filesize($filename); + $this->response[static::RESPONSE_CONTENT_LENGTH] += filesize($filename); } } else { - $this->response[self::RESPONSE_CONTENT_LENGTH] = $this->p_calculate_content_length($this->content); + $this->response[static::RESPONSE_CONTENT_LENGTH] = $this->p_calculate_content_length($this->content); } } } else { - $this->response[self::RESPONSE_CONTENT_LENGTH] = $length; + $this->response[static::RESPONSE_CONTENT_LENGTH] = $length; } return new c_base_return_true(); @@ -2163,7 +2163,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_CONTENT_RANGE] = array( + $this->response[static::RESPONSE_CONTENT_RANGE] = array( 'total' => $total, 'type' => 'bytes', 'range' => array( @@ -2173,7 +2173,7 @@ class c_base_http extends c_base_rfc_string { ); if ($start === FALSE || $stop === FALSE) { - $this->response[self::RESPONSE_CONTENT_RANGE]['range'] = FALSE; + $this->response[static::RESPONSE_CONTENT_RANGE]['range'] = FALSE; } return new c_base_return_true(); @@ -2233,7 +2233,7 @@ class c_base_http extends c_base_rfc_string { } - $this->response[self::RESPONSE_CONTENT_TYPE] = array( + $this->response[static::RESPONSE_CONTENT_TYPE] = array( 'type' => $content_type_string, 'charset' => $charset, ); @@ -2268,7 +2268,7 @@ class c_base_http extends c_base_rfc_string { unset($timezone_old); } - $this->response[self::RESPONSE_DATE] = $this->request_time; + $this->response[static::RESPONSE_DATE] = $this->request_time; return new c_base_return_true(); } @@ -2278,7 +2278,7 @@ class c_base_http extends c_base_rfc_string { } - $this->response[self::RESPONSE_DATE] = $timestamp; + $this->response[static::RESPONSE_DATE] = $timestamp; return new c_base_return_true(); } @@ -2305,7 +2305,7 @@ class c_base_http extends c_base_rfc_string { $this->request_time = microtime(TRUE); } - $this->response[self::RESPONSE_DATE_ACTUAL] = $this->request_time; + $this->response[static::RESPONSE_DATE_ACTUAL] = $this->request_time; return new c_base_return_true(); } @@ -2315,7 +2315,7 @@ class c_base_http extends c_base_rfc_string { } - $this->response[self::RESPONSE_DATE_ACTUAL] = $timestamp; + $this->response[static::RESPONSE_DATE_ACTUAL] = $timestamp; return new c_base_return_true(); } @@ -2423,7 +2423,7 @@ class c_base_http extends c_base_rfc_string { $response['weak'] = $weak; - $this->response[self::RESPONSE_ETAG] = $response; + $this->response[static::RESPONSE_ETAG] = $response; unset($response); return new c_base_return_true(); @@ -2449,7 +2449,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_EXPIRES] = $timestamp; + $this->response[static::RESPONSE_EXPIRES] = $timestamp; return new c_base_return_true(); } @@ -2471,7 +2471,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_LAST_MODIFIED] = $timestamp; + $this->response[static::RESPONSE_LAST_MODIFIED] = $timestamp; return new c_base_return_true(); } @@ -2560,11 +2560,11 @@ class c_base_http extends c_base_rfc_string { // when append is FALSE and there is no parameter name, then assign url instead of appending url. if (!$append && is_null($parameter_name)) { - if (!isset($this->response[self::RESPONSE_LINK])) { - $this->response[self::RESPONSE_LINK] = array(); + if (!isset($this->response[static::RESPONSE_LINK])) { + $this->response[static::RESPONSE_LINK] = array(); } - $this->response[self::RESPONSE_LINK][$uri] = array( + $this->response[static::RESPONSE_LINK][$uri] = array( 'uri' => $parsed_uri, 'parameters' => array(), ); @@ -2621,12 +2621,12 @@ class c_base_http extends c_base_rfc_string { } - if (!isset($this->response[self::RESPONSE_LINK])) { - $this->response[self::RESPONSE_LINK] = array(); + if (!isset($this->response[static::RESPONSE_LINK])) { + $this->response[static::RESPONSE_LINK] = array(); } - if (!array_key_exists($uri, $this->response[self::RESPONSE_LINK])) { - $this->response[self::RESPONSE_LINK][$uri] = array( + if (!array_key_exists($uri, $this->response[static::RESPONSE_LINK])) { + $this->response[static::RESPONSE_LINK][$uri] = array( 'uri' => $parsed_uri, 'parameters' => array() ); @@ -2635,10 +2635,10 @@ class c_base_http extends c_base_rfc_string { if (is_string($parameter_name)) { if ($append) { - $this->response[self::RESPONSE_LINK][$uri]['parameters'][$prepared_parameter_name] = $parsed_parameter_value['text']; + $this->response[static::RESPONSE_LINK][$uri]['parameters'][$prepared_parameter_name] = $parsed_parameter_value['text']; } else { - $this->response[self::RESPONSE_LINK][$uri]['parameters'] = array($prepared_parameter_name => $parsed_parameter_value['text']); + $this->response[static::RESPONSE_LINK][$uri]['parameters'] = array($prepared_parameter_name => $parsed_parameter_value['text']); } } unset($prepared_parameter_name); @@ -2701,7 +2701,7 @@ class c_base_http extends c_base_rfc_string { } unset($parsed['invalid']); - $this->response[self::RESPONSE_LOCATION] = $parsed; + $this->response[static::RESPONSE_LOCATION] = $parsed; unset($parsed); return new c_base_return_true(); @@ -2794,14 +2794,14 @@ class c_base_http extends c_base_rfc_string { } if ($append) { - if (!isset($this->response[self::RESPONSE_PRAGMA])) { - $this->response[self::RESPONSE_PRAGMA] = array(); + if (!isset($this->response[static::RESPONSE_PRAGMA])) { + $this->response[static::RESPONSE_PRAGMA] = array(); } - $this->response[self::RESPONSE_PRAGMA][$prepared_parameter_name] = $parsed_parameter_value['text']; + $this->response[static::RESPONSE_PRAGMA][$prepared_parameter_name] = $parsed_parameter_value['text']; } else { - $this->response[self::RESPONSE_PRAGMA] = array($prepared_parameter_name => $parsed_parameter_value['text']); + $this->response[static::RESPONSE_PRAGMA] = array($prepared_parameter_name => $parsed_parameter_value['text']); } unset($prepared_parameter_name); unset($parsed_parameter_value); @@ -2900,7 +2900,7 @@ class c_base_http extends c_base_rfc_string { } - $this->response[self::RESPONSE_RETRY_AFTER] = array( + $this->response[static::RESPONSE_RETRY_AFTER] = array( 'value' => $date, 'is_seconds' => $seconds, ); @@ -2960,14 +2960,14 @@ class c_base_http extends c_base_rfc_string { $cookie_name = $cookie->get_name()->get_value_exact(); if ($append) { - if (!isset($this->response[self::RESPONSE_SET_COOKIE]) || !is_array($this->response[self::RESPONSE_SET_COOKIE])) { - $this->response[self::RESPONSE_SET_COOKIE] = array(); + if (!isset($this->response[static::RESPONSE_SET_COOKIE]) || !is_array($this->response[static::RESPONSE_SET_COOKIE])) { + $this->response[static::RESPONSE_SET_COOKIE] = array(); } - $this->response[self::RESPONSE_SET_COOKIE][$cookie_name] = clone($cookie); + $this->response[static::RESPONSE_SET_COOKIE][$cookie_name] = clone($cookie); } else { - $this->response[self::RESPONSE_SET_COOKIE] = array($cookie_name => clone($cookie)); + $this->response[static::RESPONSE_SET_COOKIE] = array($cookie_name => clone($cookie)); } unset($cookie_name); @@ -2993,7 +2993,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_STATUS] = $code; + $this->response[static::RESPONSE_STATUS] = $code; return new c_base_return_true(); } @@ -3052,8 +3052,8 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_transfer_encoding($value) { // From the RFC: "A sender MUST NOT send a Content-Length header field in any message that contains a Transfer-Encoding header field." - if (array_key_exists(self::RESPONSE_CONTENT_LENGTH, $this->response)) { - unset($this->response[self::RESPONSE_CONTENT_LENGTH]); + if (array_key_exists(static::RESPONSE_CONTENT_LENGTH, $this->response)) { + unset($this->response[static::RESPONSE_CONTENT_LENGTH]); } // @todo: self::RESPONSE_TRANSFER_ENCODING @@ -3114,14 +3114,14 @@ class c_base_http extends c_base_rfc_string { } if ($append) { - if (!isset($this->response[self::RESPONSE_VARY]) || !is_array($this->response[self::RESPONSE_VARY])) { - $this->response[self::RESPONSE_VARY] = array(); + if (!isset($this->response[static::RESPONSE_VARY]) || !is_array($this->response[static::RESPONSE_VARY])) { + $this->response[static::RESPONSE_VARY] = array(); } - $this->response[self::RESPONSE_VARY][$prepared_token] = $prepared_token; + $this->response[static::RESPONSE_VARY][$prepared_token] = $prepared_token; } else { - $this->response[self::RESPONSE_VARY] = array($prepared_token => $prepared_token); + $this->response[static::RESPONSE_VARY] = array($prepared_token => $prepared_token); } unset($prepared_token); @@ -3182,7 +3182,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_PROTOCOL] = $protocol; + $this->response[static::RESPONSE_PROTOCOL] = $protocol; return new c_base_return_true(); } @@ -3276,16 +3276,16 @@ class c_base_http extends c_base_rfc_string { if ($append) { - if (!isset($this->response[self::RESPONSE_CONTENT_SECURITY_POLICY]) || !is_array($this->response[self::RESPONSE_CONTENT_SECURITY_POLICY])) { - $this->response[self::RESPONSE_CONTENT_SECURITY_POLICY] = array( + if (!isset($this->response[static::RESPONSE_CONTENT_SECURITY_POLICY]) || !is_array($this->response[static::RESPONSE_CONTENT_SECURITY_POLICY])) { + $this->response[static::RESPONSE_CONTENT_SECURITY_POLICY] = array( $parsed_policy_name['text'] => array(), ); } - $this->response[self::RESPONSE_CONTENT_SECURITY_POLICY][$parsed_policy_name['text']][] = $parsed_policy_value['text']; + $this->response[static::RESPONSE_CONTENT_SECURITY_POLICY][$parsed_policy_name['text']][] = $parsed_policy_value['text']; } else { - $this->response[self::RESPONSE_CONTENT_SECURITY_POLICY] = array($parsed_policy_name['text'] => array($parsed_policy_value['text'])); + $this->response[static::RESPONSE_CONTENT_SECURITY_POLICY] = array($parsed_policy_name['text'] => array($parsed_policy_value['text'])); } unset($parsed_policy_name); unset($parsed_policy_value); @@ -3307,7 +3307,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_X_CONTENT_TYPE_OPTIONS] = $no_sniff; + $this->response[static::RESPONSE_X_CONTENT_TYPE_OPTIONS] = $no_sniff; return new c_base_return_true(); } @@ -3357,8 +3357,8 @@ class c_base_http extends c_base_rfc_string { // remove the browser name when compatible version is null. if (is_null($compatible_version)) { - if (isset($this->response[self::RESPONSE_X_UA_COMPATIBLE][$prepared_browser_name])) { - unset($this->response[self::RESPONSE_X_UA_COMPATIBLE][$prepared_browser_name]); + if (isset($this->response[static::RESPONSE_X_UA_COMPATIBLE][$prepared_browser_name])) { + unset($this->response[static::RESPONSE_X_UA_COMPATIBLE][$prepared_browser_name]); } unset($prepared_browser_name); @@ -3382,14 +3382,14 @@ class c_base_http extends c_base_rfc_string { } if ($append) { - if (!isset($this->response[self::RESPONSE_X_UA_COMPATIBLE])) { - $this->response[self::RESPONSE_X_UA_COMPATIBLE] = array(); + if (!isset($this->response[static::RESPONSE_X_UA_COMPATIBLE])) { + $this->response[static::RESPONSE_X_UA_COMPATIBLE] = array(); } - $this->response[self::RESPONSE_X_UA_COMPATIBLE][$prepared_browser_name] = $parsed_compatible_version['text']; + $this->response[static::RESPONSE_X_UA_COMPATIBLE][$prepared_browser_name] = $parsed_compatible_version['text']; } else { - $this->response[self::RESPONSE_X_UA_COMPATIBLE] = array($prepared_browser_name => $parsed_compatible_version['text']); + $this->response[static::RESPONSE_X_UA_COMPATIBLE] = array($prepared_browser_name => $parsed_compatible_version['text']); } unset($prepared_browser_name); unset($parsed_compatible_version); @@ -3402,12 +3402,13 @@ class c_base_http extends c_base_rfc_string { * * This is a field for applying a checksum to the headers. * - * @param int $action + * @param int|null $action * (optional) Define how the checksum is to be processed. * Can only be one of: * - self::CHECKSUM_ACTION_NONE * - self::CHECKSUM_ACTION_AUTO * - self::CHECKSUM_ACTION_MANUAL + * When NULL, a default will be assigned. * @param int|null $what * (optional) An integer representing the checksum what, can be one of: * - self::CHECKSUM_WHAT_FULL @@ -3425,18 +3426,22 @@ class c_base_http extends c_base_rfc_string { * TRUE on success, FALSE otherwise. * FALSE with error bit set is returned on error. */ - public function set_response_checksum_header($action = self::CHECKSUM_ACTION_AUTO, $what = NULL, $type = NULL, $checksum = NULL) { - if (!is_int($action)) { + public function set_response_checksum_header($action = NULL, $what = NULL, $type = NULL, $checksum = NULL) { + if (is_null($action)) { + // static:: cannot be used as a default function parameter because it may be used in compile-time constants (which is what default parameters are). + $action = static::CHECKSUM_ACTION_AUTO; + } + elseif (!is_int($action)) { $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'action', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - if ($action != self::CHECKSUM_ACTION_NONE && $action != self::CHECKSUM_ACTION_AUTO && $action != self::CHECKSUM_ACTION_MANUAL) { + if ($action != static::CHECKSUM_ACTION_NONE && $action != static::CHECKSUM_ACTION_AUTO && $action != static::CHECKSUM_ACTION_MANUAL) { $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'action', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - if ($action == self::CHECKSUM_ACTION_MANUAL) { + if ($action == static::CHECKSUM_ACTION_MANUAL) { if (!is_int($what)) { $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'what', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); @@ -3452,7 +3457,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - if ($what != self::CHECKSUM_WHAT_PARTIAL && $what != self::CHECKSUM_WHAT_FULL) { + if ($what != static::CHECKSUM_WHAT_PARTIAL && $what != static::CHECKSUM_WHAT_FULL) { $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'what', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3475,7 +3480,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_CHECKSUM_HEADER] = array( + $this->response[static::RESPONSE_CHECKSUM_HEADER] = array( 'checksum' => $checksum, 'action' => $action, 'what' => $what, @@ -3499,19 +3504,19 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_CHECKSUM_HEADER] = array( + $this->response[static::RESPONSE_CHECKSUM_HEADER] = array( 'checksum' => NULL, 'action' => $action, - 'what' => self::CHECKSUM_WHAT_FULL, - 'type' => self::CHECKSUM_SHA256, + 'what' => static::CHECKSUM_WHAT_FULL, + 'type' => static::CHECKSUM_SHA256, ); if (!is_null($what)) { - $this->response[self::RESPONSE_CHECKSUM_HEADER]['what'] = $what; + $this->response[static::RESPONSE_CHECKSUM_HEADER]['what'] = $what; } if (!is_null($type)) { - $this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] = $type; + $this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] = $type; } } @@ -3554,14 +3559,14 @@ class c_base_http extends c_base_rfc_string { } if ($append) { - if (!isset($this->response[self::RESPONSE_CHECKSUM_HEADERS]) || !is_array($this->response[self::RESPONSE_CHECKSUM_HEADERS])) { - $this->response[self::RESPONSE_CHECKSUM_HEADERS] = array(); + if (!isset($this->response[static::RESPONSE_CHECKSUM_HEADERS]) || !is_array($this->response[static::RESPONSE_CHECKSUM_HEADERS])) { + $this->response[static::RESPONSE_CHECKSUM_HEADERS] = array(); } - $this->response[self::RESPONSE_CHECKSUM_HEADERS][$prepared_token] = $prepared_token; + $this->response[static::RESPONSE_CHECKSUM_HEADERS][$prepared_token] = $prepared_token; } else { - $this->response[self::RESPONSE_CHECKSUM_HEADERS] = array($prepared_token => $prepared_token); + $this->response[static::RESPONSE_CHECKSUM_HEADERS] = array($prepared_token => $prepared_token); } unset($prepared_token); @@ -3571,13 +3576,14 @@ class c_base_http extends c_base_rfc_string { /** * Assign HTTP response header: checksum_content. * - * @param int $action + * @param int|null $action * (optional) Define how the checksum is to be processed. * Can only be one of: * - self::CHECKSUM_ACTION_NONE * - self::CHECKSUM_ACTION_AUTO * - self::CHECKSUM_ACTION_MANUAL * When $action is self::CHECKSUM_ACTION_AUTO, the checksum will not be calculated at this point in time. + * When $action is NULL, a default is used. * @param int|null $what * (optional) An integer representing the checksum what, can be one of: * - self::CHECKSUM_WHAT_FULL @@ -3595,18 +3601,22 @@ class c_base_http extends c_base_rfc_string { * TRUE on success, FALSE otherwise. * FALSE with error bit set is returned on error. */ - public function set_response_checksum_content($action = self::CHECKSUM_ACTION_AUTO, $what = NULL, $type = NULL, $checksum = NULL) { - if (!is_int($action)) { + public function set_response_checksum_content($action = NULL, $what = NULL, $type = NULL, $checksum = NULL) { + if (is_null($action)) { + // static:: cannot be used as a default function parameter because it may be used in compile-time constants (which is what default parameters are). + $action = static::CHECKSUM_ACTION_AUTO; + } + else if (!is_int($action)) { $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'action', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - if ($action != self::CHECKSUM_ACTION_NONE && $action != self::CHECKSUM_ACTION_AUTO && $action != self::CHECKSUM_ACTION_MANUAL) { + if ($action != static::CHECKSUM_ACTION_NONE && $action != static::CHECKSUM_ACTION_AUTO && $action != static::CHECKSUM_ACTION_MANUAL) { $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'action', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - if ($action == self::CHECKSUM_ACTION_MANUAL) { + if ($action == static::CHECKSUM_ACTION_MANUAL) { if (!is_int($what)) { $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'what', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); @@ -3622,7 +3632,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - if ($what != self::CHECKSUM_WHAT_PARTIAL && $what != self::CHECKSUM_WHAT_FULL) { + if ($what != static::CHECKSUM_WHAT_PARTIAL && $what != static::CHECKSUM_WHAT_FULL) { $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'what', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3645,7 +3655,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_CHECKSUM_CONTENT] = array( + $this->response[static::RESPONSE_CHECKSUM_CONTENT] = array( 'checksum' => $checksum, 'action' => $action, 'what' => $what, @@ -3668,19 +3678,19 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_CHECKSUM_CONTENT] = array( + $this->response[static::RESPONSE_CHECKSUM_CONTENT] = array( 'checksum' => NULL, 'action' => $action, - 'what' => self::CHECKSUM_WHAT_FULL, - 'type' => self::CHECKSUM_SHA256, + 'what' => static::CHECKSUM_WHAT_FULL, + 'type' => static::CHECKSUM_SHA256, ); if (!is_null($what)) { - $this->response[self::RESPONSE_CHECKSUM_HEADER]['what'] = $what; + $this->response[static::RESPONSE_CHECKSUM_HEADER]['what'] = $what; } if (!is_null($type)) { - $this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] = $type; + $this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] = $type; } } @@ -3705,7 +3715,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_error::s_false($error); } - $this->response[self::RESPONSE_CONTENT_REVISION] = $revision; + $this->response[static::RESPONSE_CONTENT_REVISION] = $revision; return new c_base_return_true(); } @@ -3746,12 +3756,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Access-Control-Allow-Origin */ public function get_response_access_control_allow_origin() { - if (!array_key_exists(self::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN]); + return c_base_return_array::s_new($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN]); } /** @@ -3767,12 +3777,12 @@ class c_base_http extends c_base_rfc_string { * */ public function get_response_access_control_allow_credentials() { - if (!array_key_exists(self::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(FALSE, 'c_base_return_bool', $error); } - return c_base_return_bool::s_new($this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS]); + return c_base_return_bool::s_new($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS]); } /** @@ -3787,12 +3797,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Access-Control-Expose-Headers */ public function get_response_access_control_expose_headers() { - if (!array_key_exists(self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS]); + return c_base_return_array::s_new($this->response[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS]); } /** @@ -3807,12 +3817,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Access-Control-Max-Age */ public function get_response_access_control_max_age() { - if (!array_key_exists(self::RESPONSE_ACCESS_CONTROL_MAX_AGE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_ACCESS_CONTROL_MAX_AGE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_ACCESS_CONTROL_MAX_AGE, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ACCESS_CONTROL_MAX_AGE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } - return c_base_return_int::s_new($this->response[self::RESPONSE_ACCESS_CONTROL_MAX_AGE]); + return c_base_return_int::s_new($this->response[static::RESPONSE_ACCESS_CONTROL_MAX_AGE]); } /** @@ -3826,12 +3836,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Access-Control-Allow-Methods */ public function get_response_access_control_allow_methods() { - if (!array_key_exists(self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS]); + return c_base_return_array::s_new($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS]); } /** @@ -3846,12 +3856,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Access-Control-Allow-Headers */ public function get_response_access_control_allow_headers() { - if (!array_key_exists(self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS]); + return c_base_return_array::s_new($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS]); } /** @@ -3866,12 +3876,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc2616#section-3.12 */ public function get_response_accept_patch() { - if (!array_key_exists(self::RESPONSE_ACCEPT_PATCH, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_ACCEPT_PATCH, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_ACCEPT_PATCH, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ACCEPT_PATCH, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_ACCEPT_PATCH]); + return c_base_return_array::s_new($this->response[static::RESPONSE_ACCEPT_PATCH]); } /** @@ -3890,12 +3900,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7233#section-3.1 */ public function get_response_accept_ranges() { - if (!array_key_exists(self::RESPONSE_ACCEPT_RANGES, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_ACCEPT_RANGES, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_ACCEPT_RANGES, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ACCEPT_RANGES, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value('', 'c_base_return_string', $error); } - return c_base_return_string::s_new($this->response[self::RESPONSE_ACCEPT_RANGES]); + return c_base_return_string::s_new($this->response[static::RESPONSE_ACCEPT_RANGES]); } /** @@ -3908,12 +3918,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7234#section-5.1 */ public function get_response_age() { - if (!array_key_exists(self::RESPONSE_AGE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_AGE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_AGE, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_AGE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } - return c_base_return_int::s_new($this->response[self::RESPONSE_AGE]); + return c_base_return_int::s_new($this->response[static::RESPONSE_AGE]); } /** @@ -3926,12 +3936,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-7.4.1 */ public function get_response_allow() { - if (!array_key_exists(self::RESPONSE_ALLOW, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_ALLOW, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_ALLOW, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ALLOW, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_ALLOW]); + return c_base_return_array::s_new($this->response[static::RESPONSE_ALLOW]); } /** @@ -3960,12 +3970,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7234#section-5.2.3 */ public function get_response_cache_control() { - if (!array_key_exists(self::RESPONSE_CACHE_CONTROL, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_CACHE_CONTROL, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_CACHE_CONTROL, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CACHE_CONTROL, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_CACHE_CONTROL]); + return c_base_return_array::s_new($this->response[static::RESPONSE_CACHE_CONTROL]); } /** @@ -3981,12 +3991,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7230#section-6.1 */ public function get_response_connection() { - if (!array_key_exists(self::RESPONSE_CONNECTION, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_CONNECTION, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_CONNECTION, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONNECTION, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_CONNECTION]); + return c_base_return_array::s_new($this->response[static::RESPONSE_CONNECTION]); } /** @@ -3999,12 +4009,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc6266#section-4 */ public function get_response_content_disposition() { - if (!array_key_exists(self::RESPONSE_CONTENT_DISPOSITION, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_CONTENT_DISPOSITION, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_CONTENT_DISPOSITION, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONTENT_DISPOSITION, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_CONTENT_DISPOSITION]); + return c_base_return_array::s_new($this->response[static::RESPONSE_CONTENT_DISPOSITION]); } /** @@ -4015,12 +4025,12 @@ class c_base_http extends c_base_rfc_string { * An empty array with error bit set is returned on error, including when the key is not defined. */ public function get_response_content_encoding() { - if (!array_key_exists(self::RESPONSE_CONTENT_ENCODING, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_CONTENT_ENCODING, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_CONTENT_ENCODING, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONTENT_ENCODING, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_CONTENT_ENCODING]); + return c_base_return_array::s_new($this->response[static::RESPONSE_CONTENT_ENCODING]); } /** @@ -4033,12 +4043,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-3.1.3.2 */ public function get_response_content_language() { - if (!array_key_exists(self::RESPONSE_CONTENT_LANGUAGE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_CONTENT_LANGUAGE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_CONTENT_LANGUAGE, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONTENT_LANGUAGE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_CONTENT_LANGUAGE]); + return c_base_return_array::s_new($this->response[static::RESPONSE_CONTENT_LANGUAGE]); } /** @@ -4051,12 +4061,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7230#section-3.3.2 */ public function get_response_content_length() { - if (!array_key_exists(self::RESPONSE_CONTENT_LENGTH, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_CONTENT_LENGTH, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_CONTENT_LENGTH, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONTENT_LENGTH, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } - return c_base_return_int::s_new($this->response[self::RESPONSE_CONTENT_LENGTH]); + return c_base_return_int::s_new($this->response[static::RESPONSE_CONTENT_LENGTH]); } /** @@ -4077,12 +4087,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7233#section-4.2 */ public function get_response_content_range() { - if (!array_key_exists(self::RESPONSE_CONTENT_RANGE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_CONTENT_RANGE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_CONTENT_RANGE, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONTENT_RANGE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_CONTENT_RANGE]); + return c_base_return_array::s_new($this->response[static::RESPONSE_CONTENT_RANGE]); } /** @@ -4097,12 +4107,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-3.1.1.5 */ public function get_response_content_type() { - if (!array_key_exists(self::RESPONSE_CONTENT_TYPE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_CONTENT_TYPE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_CONTENT_TYPE, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONTENT_TYPE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_CONTENT_TYPE]); + return c_base_return_array::s_new($this->response[static::RESPONSE_CONTENT_TYPE]); } /** @@ -4115,16 +4125,16 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-7.1.1.2 */ public function get_response_date() { - if (!array_key_exists(self::RESPONSE_DATE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_DATE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_DATE, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_DATE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } - if (is_float($this->response[self::RESPONSE_DATE])) { - return c_base_return_float::s_new($this->response[self::RESPONSE_DATE]); + if (is_float($this->response[static::RESPONSE_DATE])) { + return c_base_return_float::s_new($this->response[static::RESPONSE_DATE]); } - return c_base_return_int::s_new($this->response[self::RESPONSE_DATE]); + return c_base_return_int::s_new($this->response[static::RESPONSE_DATE]); } /** @@ -4141,16 +4151,16 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-7.1.1.2 */ public function get_response_date_actual() { - if (!array_key_exists(self::RESPONSE_DATE_ACTUAL, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_DATE_ACTUAL, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_DATE_ACTUAL, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_DATE_ACTUAL, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } - if (is_float($this->response[self::RESPONSE_DATE_ACTUAL])) { - return c_base_return_float::s_new($this->response[self::RESPONSE_DATE_ACTUAL]); + if (is_float($this->response[static::RESPONSE_DATE_ACTUAL])) { + return c_base_return_float::s_new($this->response[static::RESPONSE_DATE_ACTUAL]); } - return c_base_return_int::s_new($this->response[self::RESPONSE_DATE_ACTUAL]); + return c_base_return_int::s_new($this->response[static::RESPONSE_DATE_ACTUAL]); } /** @@ -4165,12 +4175,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7232#section-2.3 */ public function get_response_etag() { - if (!array_key_exists(self::RESPONSE_ETAG, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_ETAG, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_ETAG, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_ETAG, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_ETAG]); + return c_base_return_array::s_new($this->response[static::RESPONSE_ETAG]); } /** @@ -4183,16 +4193,16 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7234#section-5.3 */ public function get_response_expires() { - if (!array_key_exists(self::RESPONSE_EXPIRES, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_EXPIRES, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_EXPIRES, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_EXPIRES, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } - if (is_float($this->response[self::RESPONSE_EXPIRES])) { - return c_base_return_float::s_new($this->response[self::RESPONSE_EXPIRES]); + if (is_float($this->response[static::RESPONSE_EXPIRES])) { + return c_base_return_float::s_new($this->response[static::RESPONSE_EXPIRES]); } - return c_base_return_int::s_new($this->response[self::RESPONSE_EXPIRES]); + return c_base_return_int::s_new($this->response[static::RESPONSE_EXPIRES]); } /** @@ -4205,16 +4215,16 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7232#section-2.2 */ public function get_response_last_modified() { - if (!array_key_exists(self::RESPONSE_LAST_MODIFIED, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_LAST_MODIFIED, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_LAST_MODIFIED, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_LAST_MODIFIED, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } - if (is_float($this->response[self::RESPONSE_LAST_MODIFIED])) { - return c_base_return_float::s_new($this->response[self::RESPONSE_LAST_MODIFIED]); + if (is_float($this->response[static::RESPONSE_LAST_MODIFIED])) { + return c_base_return_float::s_new($this->response[static::RESPONSE_LAST_MODIFIED]); } - return c_base_return_int::s_new($this->response[self::RESPONSE_LAST_MODIFIED]); + return c_base_return_int::s_new($this->response[static::RESPONSE_LAST_MODIFIED]); } /** @@ -4230,12 +4240,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc3986 */ public function get_response_link() { - if (!array_key_exists(self::RESPONSE_LINK, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_LINK, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_LINK, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_LINK, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_LINK]); + return c_base_return_array::s_new($this->response[static::RESPONSE_LINK]); } /** @@ -4250,12 +4260,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc3986 */ public function get_response_location() { - if (!array_key_exists(self::RESPONSE_LOCATION, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_LOCATION, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_LOCATION, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_LOCATION, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_LOCATION]); + return c_base_return_array::s_new($this->response[static::RESPONSE_LOCATION]); } /** @@ -4269,12 +4279,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7234#section-5.4 */ public function get_response_pragma() { - if (!array_key_exists(self::RESPONSE_PRAGMA, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_PRAGMA, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_PRAGMA, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_PRAGMA, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_PRAGMA]); + return c_base_return_array::s_new($this->response[static::RESPONSE_PRAGMA]); } /** @@ -4289,8 +4299,8 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7235#section-4.3 */ public function get_response_proxy_authenticate() { - if (!array_key_exists(self::RESPONSE_PROXY_AUTHENTICATE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_PROXY_AUTHENTICATE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_PROXY_AUTHENTICATE, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_PROXY_AUTHENTICATE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -4312,8 +4322,8 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7469 */ public function get_response_public_key_pins() { - if (!array_key_exists(self::RESPONSE_PUBLIC_KEY_PINS, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_PUBLIC_KEY_PINS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_PUBLIC_KEY_PINS, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_PUBLIC_KEY_PINS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -4338,8 +4348,8 @@ class c_base_http extends c_base_rfc_string { * @see: https://en.wikipedia.org/wiki/List_of_HTTP_header_fields */ public function get_response_refresh() { - if (!array_key_exists(self::RESPONSE_REFRESH, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_REFRESH, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_REFRESH, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_REFRESH, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -4362,12 +4372,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-7.1.3 */ public function get_response_retry_after() { - if (!array_key_exists(self::RESPONSE_RETRY_AFTER, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_RETRY_AFTER, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_RETRY_AFTER, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_RETRY_AFTER, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_RETRY_AFTER]); + return c_base_return_array::s_new($this->response[static::RESPONSE_RETRY_AFTER]); } /** @@ -4380,12 +4390,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc6265 */ public function get_response_set_cookie() { - if (!array_key_exists(self::RESPONSE_SET_COOKIE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_SET_COOKIE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_SET_COOKIE, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_SET_COOKIE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_cookie', $error); } - return $this->response[self::RESPONSE_SET_COOKIE]; + return $this->response[static::RESPONSE_SET_COOKIE]; } /** @@ -4397,8 +4407,8 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-7.4.2 */ public function get_response_server() { - if (!array_key_exists(self::RESPONSE_SERVER, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_SERVER, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_SERVER, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_SERVER, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -4418,12 +4428,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7232#section-4 */ public function get_response_status() { - if (!array_key_exists(self::RESPONSE_STATUS, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_STATUS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_STATUS, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_STATUS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } - return c_base_return_int::s_new($this->response[self::RESPONSE_STATUS]); + return c_base_return_int::s_new($this->response[static::RESPONSE_STATUS]); } /** @@ -4436,8 +4446,8 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc6797#section-6.1 */ public function get_response_strict_transport_security() { - if (!array_key_exists(self::RESPONSE_STRICT_TRANSPORT_SECURITY, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_STRICT_TRANSPORT_SECURITY, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_STRICT_TRANSPORT_SECURITY, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_STRICT_TRANSPORT_SECURITY, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -4462,8 +4472,8 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7230#section-3.3.1 */ public function get_response_trailer() { - if (!array_key_exists(self::RESPONSE_TRAILER, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_TRAILER, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_TRAILER, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_TRAILER, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -4483,8 +4493,8 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7230#section-3.3.1 */ public function get_response_transfer_encoding() { - if (!array_key_exists(self::RESPONSE_TRANSFER_ENCODING, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_TRANSFER_ENCODING, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_TRANSFER_ENCODING, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_TRANSFER_ENCODING, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -4503,8 +4513,8 @@ class c_base_http extends c_base_rfc_string { * FALSE with error bit set is returned on error, including when the key is not defined. */ public function get_response_upgrade() { - if (!array_key_exists(self::RESPONSE_UPGRADE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_UPGRADE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_UPGRADE, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_UPGRADE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -4524,12 +4534,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-7.1.4 */ public function get_response_vary() { - if (!array_key_exists(self::RESPONSE_VARY, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_VARY, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_VARY, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_VARY, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_VARY]); + return c_base_return_array::s_new($this->response[static::RESPONSE_VARY]); } /** @@ -4542,8 +4552,8 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7234#section-5.5 */ public function get_response_warning() { - if (!array_key_exists(self::RESPONSE_WARNING, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_WARNING, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_WARNING, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_WARNING, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -4563,8 +4573,8 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7235#section-4.1 */ public function get_response_www_authenticate() { - if (!array_key_exists(self::RESPONSE_WWW_AUTHENTICATE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_WWW_AUTHENTICATE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_WWW_AUTHENTICATE, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_WWW_AUTHENTICATE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -4582,12 +4592,12 @@ class c_base_http extends c_base_rfc_string { * An empty string with error bit set is returned on error, including when the key is not defined. */ public function get_response_protocol() { - if (!array_key_exists(self::RESPONSE_PROTOCOL, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_PROTOCOL, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_PROTOCOL, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_PROTOCOL, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value('', 'c_base_return_string', $error); } - return c_base_return_string::s_new($this->response[self::RESPONSE_PROTOCOL]); + return c_base_return_string::s_new($this->response[static::RESPONSE_PROTOCOL]); } /** @@ -4602,12 +4612,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://www.html5rocks.com/en/tutorials/security/content-security-policy/ */ public function get_response_content_security_policy() { - if (!array_key_exists(self::RESPONSE_CONTENT_SECURITY_POLICY, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_CONTENT_SECURITY_POLICY, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_CONTENT_SECURITY_POLICY, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONTENT_SECURITY_POLICY, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_CONTENT_SECURITY_POLICY]); + return c_base_return_array::s_new($this->response[static::RESPONSE_CONTENT_SECURITY_POLICY]); } /** @@ -4618,12 +4628,12 @@ class c_base_http extends c_base_rfc_string { * FALSE with error bit set is returned on error, including when the key is not defined. */ public function get_response_x_content_type_options() { - if (!array_key_exists(self::RESPONSE_X_CONTENT_TYPE_OPTIONS, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_X_CONTENT_TYPE_OPTIONS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_X_CONTENT_TYPE_OPTIONS, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_X_CONTENT_TYPE_OPTIONS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(FALSE, 'c_base_return_bool', $error); } - return c_base_return_bool::s_new($this->response[self::RESPONSE_X_CONTENT_TYPE_OPTIONS]); + return c_base_return_bool::s_new($this->response[static::RESPONSE_X_CONTENT_TYPE_OPTIONS]); } /** @@ -4634,12 +4644,12 @@ class c_base_http extends c_base_rfc_string { * An empty array with error bit set is returned on error, including when the key is not defined. */ public function get_response_x_ua_compatible() { - if (!array_key_exists(self::RESPONSE_X_UA_COMPATIBLE, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_X_UA_COMPATIBLE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_X_UA_COMPATIBLE, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_X_UA_COMPATIBLE, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_X_UA_COMPATIBLE]); + return c_base_return_array::s_new($this->response[static::RESPONSE_X_UA_COMPATIBLE]); } /** @@ -4656,12 +4666,12 @@ class c_base_http extends c_base_rfc_string { * An empty array with error bit set is returned on error, including when the key is not defined. */ public function get_response_checksum_header() { - if (!array_key_exists(self::RESPONSE_CHECKSUM_HEADER, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_CHECKSUM_HEADER, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_CHECKSUM_HEADER, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CHECKSUM_HEADER, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_CHECKSUM_HEADER]); + return c_base_return_array::s_new($this->response[static::RESPONSE_CHECKSUM_HEADER]); } /** @@ -4672,12 +4682,12 @@ class c_base_http extends c_base_rfc_string { * An empty array with error bit set is returned on error, including when the key is not defined. */ public function get_response_checksum_headers() { - if (!array_key_exists(self::RESPONSE_CHECKSUM_HEADERS, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_CHECKSUM_HEADERS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_CHECKSUM_HEADERS, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CHECKSUM_HEADERS, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_CHECKSUM_HEADERS]); + return c_base_return_array::s_new($this->response[static::RESPONSE_CHECKSUM_HEADERS]); } /** @@ -4692,12 +4702,12 @@ class c_base_http extends c_base_rfc_string { * An empty array with error bit set is returned on error, including when the key is not defined. */ public function get_response_checksum_content() { - if (!array_key_exists(self::RESPONSE_CHECKSUM_CONTENT, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_CHECKSUM_CONTENT, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_CHECKSUM_CONTENT, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CHECKSUM_CONTENT, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } - return c_base_return_array::s_new($this->response[self::RESPONSE_CHECKSUM_CONTENT]); + return c_base_return_array::s_new($this->response[static::RESPONSE_CHECKSUM_CONTENT]); } /** @@ -4708,12 +4718,12 @@ class c_base_http extends c_base_rfc_string { * 0 with error bit set is returned on error, including when the key is not defined. */ public function get_response_content_revision() { - if (!array_key_exists(self::RESPONSE_CONTENT_REVISION, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => self::RESPONSE_CONTENT_REVISION, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + if (!array_key_exists(static::RESPONSE_CONTENT_REVISION, $this->response)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{index_name}' => static::RESPONSE_CONTENT_REVISION, ':{array_name}' => 'this->response', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } - return c_base_return_int::s_new($this->response[self::RESPONSE_CONTENT_REVISION]); + return c_base_return_int::s_new($this->response[static::RESPONSE_CONTENT_REVISION]); } /** @@ -4816,74 +4826,74 @@ class c_base_http extends c_base_rfc_string { // response status, this must always be first. - unset($headers[self::RESPONSE_STATUS]); + unset($headers[static::RESPONSE_STATUS]); $status_string = NULL; - if (array_key_exists(self::RESPONSE_STATUS, $this->response)) { - if (array_key_exists(self::RESPONSE_PROTOCOL, $this->response)) { - $status_string = $this->response[self::RESPONSE_PROTOCOL] . ' '; + if (array_key_exists(static::RESPONSE_STATUS, $this->response)) { + if (array_key_exists(static::RESPONSE_PROTOCOL, $this->response)) { + $status_string = $this->response[static::RESPONSE_PROTOCOL] . ' '; } else { - $status_string = self::FALLBACK_PROTOCOL . ' '; + $status_string = static::FALLBACK_PROTOCOL . ' '; } - $status_text = c_base_http_status::to_text($this->response[self::RESPONSE_STATUS]); + $status_text = c_base_http_status::to_text($this->response[static::RESPONSE_STATUS]); if ($status_text instanceof c_base_return_false) { - $status_string .= $this->response[self::RESPONSE_STATUS]; + $status_string .= $this->response[static::RESPONSE_STATUS]; } else { - $status_string .= $this->response[self::RESPONSE_STATUS] . ' ' . $status_text->get_value_exact(); + $status_string .= $this->response[static::RESPONSE_STATUS] . ' ' . $status_text->get_value_exact(); } unset($status_text); - header($status_string, TRUE, $this->response[self::RESPONSE_STATUS]); - } - - $this->p_prepare_header_response_access_control_allow_origin($header_id_to_names[self::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN], $header_output); - $this->p_prepare_header_response_boolean_value($header_id_to_names[self::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS], $header_output, self::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS); - $this->p_prepare_header_response_access_control_expose_headers($header_id_to_names[self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS], $header_output); - $this->p_prepare_header_response_simple_value($header_id_to_names[self::RESPONSE_ACCESS_CONTROL_MAX_AGE], $header_output, self::RESPONSE_ACCESS_CONTROL_MAX_AGE); - $this->p_prepare_header_response_access_control_allow_methods($header_id_to_names[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS], $header_output); - $this->p_prepare_header_response_access_control_allow_headers($header_id_to_names[self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS], $header_output); - $this->p_prepare_header_response_accept_patch($header_id_to_names[self::RESPONSE_ACCEPT_PATCH], $header_output); - $this->p_prepare_header_response_simple_value($header_id_to_names[self::RESPONSE_ACCEPT_RANGES], $header_output, self::RESPONSE_ACCEPT_RANGES); - $this->p_prepare_header_response_simple_value($header_id_to_names[self::RESPONSE_AGE], $header_output, self::RESPONSE_AGE); - $this->p_prepare_header_response_allow($header_id_to_names[self::RESPONSE_ALLOW], $header_output); - $this->p_prepare_header_response_cache_control($header_id_to_names[self::RESPONSE_CACHE_CONTROL], $header_output); - $this->p_prepare_header_response_connection($header_id_to_names[self::RESPONSE_CONNECTION], $header_output); - $this->p_prepare_header_response_content_disposition($header_id_to_names[self::RESPONSE_CONTENT_DISPOSITION], $header_output); - $this->p_prepare_header_response_content_encoding($header_id_to_names[self::RESPONSE_CONTENT_ENCODING], $header_output); - $this->p_prepare_header_response_content_language($header_id_to_names[self::RESPONSE_CONTENT_LANGUAGE], $header_output); - $this->p_prepare_header_response_simple_value($header_id_to_names[self::RESPONSE_CONTENT_LENGTH], $header_output, self::RESPONSE_CONTENT_LENGTH); - $this->p_prepare_header_response_content_range($header_id_to_names[self::RESPONSE_CONTENT_RANGE], $header_output, self::RESPONSE_CONTENT_RANGE); - $this->p_prepare_header_response_content_type($header_id_to_names[self::RESPONSE_CONTENT_TYPE], $header_output); - $this->p_prepare_header_response_timestamp_value($header_id_to_names[self::RESPONSE_DATE], $header_output, $headers[self::RESPONSE_DATE], self::RESPONSE_DATE); - $this->p_prepare_header_response_timestamp_value($header_id_to_names[self::RESPONSE_DATE_ACTUAL], $header_output, $headers[self::RESPONSE_DATE_ACTUAL], self::RESPONSE_DATE_ACTUAL); - $this->p_prepare_header_response_etag($header_id_to_names[self::RESPONSE_ETAG], $header_output); - $this->p_prepare_header_response_timestamp_value($header_id_to_names[self::RESPONSE_EXPIRES], $header_output, $headers[self::RESPONSE_EXPIRES], self::RESPONSE_EXPIRES); - $this->p_prepare_header_response_timestamp_value($header_id_to_names[self::RESPONSE_LAST_MODIFIED], $header_output, $headers[self::RESPONSE_LAST_MODIFIED], self::RESPONSE_LAST_MODIFIED); - $this->p_prepare_header_response_link($header_id_to_names[self::RESPONSE_LINK], $header_output); - $this->p_prepare_header_response_location($header_id_to_names[self::RESPONSE_LOCATION], $header_output); - $this->p_prepare_header_response_pragma($header_id_to_names[self::RESPONSE_PRAGMA], $header_output); - $this->p_prepare_header_response_proxy_authenticate($header_id_to_names[self::RESPONSE_PROXY_AUTHENTICATE], $header_output); - $this->p_prepare_header_response_public_key_pins($header_id_to_names[self::RESPONSE_PUBLIC_KEY_PINS], $header_output); - $this->p_prepare_header_response_refresh($header_id_to_names[self::RESPONSE_REFRESH], $header_output); - $this->p_prepare_header_response_retry_after($header_id_to_names[self::RESPONSE_RETRY_AFTER], $header_output); - $this->p_prepare_header_response_server($header_id_to_names[self::RESPONSE_SERVER], $header_output); - $this->p_prepare_header_response_set_cookie($header_id_to_names[self::RESPONSE_SET_COOKIE], $header_output); - $this->p_prepare_header_response_strict_transport_security($header_id_to_names[self::RESPONSE_STRICT_TRANSPORT_SECURITY], $header_output); - $this->p_prepare_header_response_trailer($header_id_to_names[self::RESPONSE_TRAILER], $header_output); - $this->p_prepare_header_response_transfer_encoding($header_id_to_names[self::RESPONSE_TRANSFER_ENCODING], $header_output); - $this->p_prepare_header_response_upgrade($header_id_to_names[self::RESPONSE_UPGRADE], $header_output); - $this->p_prepare_header_response_vary($header_id_to_names[self::RESPONSE_VARY], $header_output); - $this->p_prepare_header_response_warning($header_id_to_names[self::RESPONSE_WARNING], $header_output); - $this->p_prepare_header_response_www_authenticate($header_id_to_names[self::RESPONSE_WWW_AUTHENTICATE], $header_output); - $this->p_prepare_header_response_content_security_policy($header_id_to_names[self::RESPONSE_CONTENT_SECURITY_POLICY], $header_output); - $this->p_prepare_header_response_x_content_type_options($header_id_to_names[self::RESPONSE_X_CONTENT_TYPE_OPTIONS], $header_output); - $this->p_prepare_header_response_x_ua_compatible($header_id_to_names[self::RESPONSE_X_UA_COMPATIBLE], $header_output); - $this->p_prepare_header_response_simple_value($header_id_to_names[self::RESPONSE_CONTENT_LENGTH], $header_output, self::RESPONSE_CONTENT_LENGTH); - $this->p_prepare_header_response_simple_value($header_id_to_names[self::RESPONSE_CONTENT_REVISION], $header_output, self::RESPONSE_CONTENT_REVISION); - $this->p_prepare_header_response_checksum_content($header_id_to_names[self::RESPONSE_CHECKSUM_CONTENT], $header_output); - $this->p_prepare_header_response_checksum_header($header_id_to_names[self::RESPONSE_CHECKSUM_HEADERS], $header_id_to_names[self::RESPONSE_CHECKSUM_HEADER], $header_output, $status_string); + header($status_string, TRUE, $this->response[static::RESPONSE_STATUS]); + } + + $this->p_prepare_header_response_access_control_allow_origin($header_id_to_names[static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN], $header_output); + $this->p_prepare_header_response_boolean_value($header_id_to_names[static::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS], $header_output, static::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS); + $this->p_prepare_header_response_access_control_expose_headers($header_id_to_names[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS], $header_output); + $this->p_prepare_header_response_simple_value($header_id_to_names[static::RESPONSE_ACCESS_CONTROL_MAX_AGE], $header_output, static::RESPONSE_ACCESS_CONTROL_MAX_AGE); + $this->p_prepare_header_response_access_control_allow_methods($header_id_to_names[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS], $header_output); + $this->p_prepare_header_response_access_control_allow_headers($header_id_to_names[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS], $header_output); + $this->p_prepare_header_response_accept_patch($header_id_to_names[static::RESPONSE_ACCEPT_PATCH], $header_output); + $this->p_prepare_header_response_simple_value($header_id_to_names[static::RESPONSE_ACCEPT_RANGES], $header_output, static::RESPONSE_ACCEPT_RANGES); + $this->p_prepare_header_response_simple_value($header_id_to_names[static::RESPONSE_AGE], $header_output, static::RESPONSE_AGE); + $this->p_prepare_header_response_allow($header_id_to_names[static::RESPONSE_ALLOW], $header_output); + $this->p_prepare_header_response_cache_control($header_id_to_names[static::RESPONSE_CACHE_CONTROL], $header_output); + $this->p_prepare_header_response_connection($header_id_to_names[static::RESPONSE_CONNECTION], $header_output); + $this->p_prepare_header_response_content_disposition($header_id_to_names[static::RESPONSE_CONTENT_DISPOSITION], $header_output); + $this->p_prepare_header_response_content_encoding($header_id_to_names[static::RESPONSE_CONTENT_ENCODING], $header_output); + $this->p_prepare_header_response_content_language($header_id_to_names[static::RESPONSE_CONTENT_LANGUAGE], $header_output); + $this->p_prepare_header_response_simple_value($header_id_to_names[static::RESPONSE_CONTENT_LENGTH], $header_output, static::RESPONSE_CONTENT_LENGTH); + $this->p_prepare_header_response_content_range($header_id_to_names[static::RESPONSE_CONTENT_RANGE], $header_output, static::RESPONSE_CONTENT_RANGE); + $this->p_prepare_header_response_content_type($header_id_to_names[static::RESPONSE_CONTENT_TYPE], $header_output); + $this->p_prepare_header_response_timestamp_value($header_id_to_names[static::RESPONSE_DATE], $header_output, $headers[static::RESPONSE_DATE], static::RESPONSE_DATE); + $this->p_prepare_header_response_timestamp_value($header_id_to_names[static::RESPONSE_DATE_ACTUAL], $header_output, $headers[static::RESPONSE_DATE_ACTUAL], static::RESPONSE_DATE_ACTUAL); + $this->p_prepare_header_response_etag($header_id_to_names[static::RESPONSE_ETAG], $header_output); + $this->p_prepare_header_response_timestamp_value($header_id_to_names[static::RESPONSE_EXPIRES], $header_output, $headers[static::RESPONSE_EXPIRES], static::RESPONSE_EXPIRES); + $this->p_prepare_header_response_timestamp_value($header_id_to_names[static::RESPONSE_LAST_MODIFIED], $header_output, $headers[static::RESPONSE_LAST_MODIFIED], static::RESPONSE_LAST_MODIFIED); + $this->p_prepare_header_response_link($header_id_to_names[static::RESPONSE_LINK], $header_output); + $this->p_prepare_header_response_location($header_id_to_names[static::RESPONSE_LOCATION], $header_output); + $this->p_prepare_header_response_pragma($header_id_to_names[static::RESPONSE_PRAGMA], $header_output); + $this->p_prepare_header_response_proxy_authenticate($header_id_to_names[static::RESPONSE_PROXY_AUTHENTICATE], $header_output); + $this->p_prepare_header_response_public_key_pins($header_id_to_names[static::RESPONSE_PUBLIC_KEY_PINS], $header_output); + $this->p_prepare_header_response_refresh($header_id_to_names[static::RESPONSE_REFRESH], $header_output); + $this->p_prepare_header_response_retry_after($header_id_to_names[static::RESPONSE_RETRY_AFTER], $header_output); + $this->p_prepare_header_response_server($header_id_to_names[static::RESPONSE_SERVER], $header_output); + $this->p_prepare_header_response_set_cookie($header_id_to_names[static::RESPONSE_SET_COOKIE], $header_output); + $this->p_prepare_header_response_strict_transport_security($header_id_to_names[static::RESPONSE_STRICT_TRANSPORT_SECURITY], $header_output); + $this->p_prepare_header_response_trailer($header_id_to_names[static::RESPONSE_TRAILER], $header_output); + $this->p_prepare_header_response_transfer_encoding($header_id_to_names[static::RESPONSE_TRANSFER_ENCODING], $header_output); + $this->p_prepare_header_response_upgrade($header_id_to_names[static::RESPONSE_UPGRADE], $header_output); + $this->p_prepare_header_response_vary($header_id_to_names[static::RESPONSE_VARY], $header_output); + $this->p_prepare_header_response_warning($header_id_to_names[static::RESPONSE_WARNING], $header_output); + $this->p_prepare_header_response_www_authenticate($header_id_to_names[static::RESPONSE_WWW_AUTHENTICATE], $header_output); + $this->p_prepare_header_response_content_security_policy($header_id_to_names[static::RESPONSE_CONTENT_SECURITY_POLICY], $header_output); + $this->p_prepare_header_response_x_content_type_options($header_id_to_names[static::RESPONSE_X_CONTENT_TYPE_OPTIONS], $header_output); + $this->p_prepare_header_response_x_ua_compatible($header_id_to_names[static::RESPONSE_X_UA_COMPATIBLE], $header_output); + $this->p_prepare_header_response_simple_value($header_id_to_names[static::RESPONSE_CONTENT_LENGTH], $header_output, static::RESPONSE_CONTENT_LENGTH); + $this->p_prepare_header_response_simple_value($header_id_to_names[static::RESPONSE_CONTENT_REVISION], $header_output, static::RESPONSE_CONTENT_REVISION); + $this->p_prepare_header_response_checksum_content($header_id_to_names[static::RESPONSE_CHECKSUM_CONTENT], $header_output); + $this->p_prepare_header_response_checksum_header($header_id_to_names[static::RESPONSE_CHECKSUM_HEADERS], $header_id_to_names[static::RESPONSE_CHECKSUM_HEADER], $header_output, $status_string); unset($status_string); unset($header_id_to_names); @@ -5090,7 +5100,7 @@ class c_base_http extends c_base_rfc_string { unset($encoding); // the content-length cannot be specified in this case. - unset($this->response[self::RESPONSE_CONTENT_LENGTH]); + unset($this->response[static::RESPONSE_CONTENT_LENGTH]); } } else { @@ -5211,33 +5221,33 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_accept() { if (empty($this->headers['accept'])) { - $this->request[self::REQUEST_ACCEPT]['invalid'] = TRUE; + $this->request[static::REQUEST_ACCEPT]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['accept']); if ($text['invalid']) { - $this->request[self::REQUEST_ACCEPT]['invalid'] = TRUE; + $this->request[static::REQUEST_ACCEPT]['invalid'] = TRUE; unset($text); return; } - $this->request[self::REQUEST_ACCEPT]['data'] = $this->pr_rfc_string_is_negotiation($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_ACCEPT]['data'] = $this->pr_rfc_string_is_negotiation($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_ACCEPT]['data']['invalid']) { - $this->request[self::REQUEST_ACCEPT]['invalid'] = TRUE; + if ($this->request[static::REQUEST_ACCEPT]['data']['invalid']) { + $this->request[static::REQUEST_ACCEPT]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_ACCEPT]['defined'] = TRUE; - $this->request[self::REQUEST_ACCEPT]['data']['accept'] = NULL; - $this->request[self::REQUEST_ACCEPT]['data']['category'] = NULL; - $this->request[self::REQUEST_ACCEPT]['data']['weight'] = array(); - $this->request[self::REQUEST_ACCEPT]['data']['types'] = array(); - #$this->request[self::REQUEST_ACCEPT]['data']['categories'] = array(); + $this->request[static::REQUEST_ACCEPT]['defined'] = TRUE; + $this->request[static::REQUEST_ACCEPT]['data']['accept'] = NULL; + $this->request[static::REQUEST_ACCEPT]['data']['category'] = NULL; + $this->request[static::REQUEST_ACCEPT]['data']['weight'] = array(); + $this->request[static::REQUEST_ACCEPT]['data']['types'] = array(); + #$this->request[static::REQUEST_ACCEPT]['data']['categories'] = array(); // convert the known values into integers for improved processing. - foreach ($this->request[self::REQUEST_ACCEPT]['data']['choices'] as $weight => &$choice) { + foreach ($this->request[static::REQUEST_ACCEPT]['data']['choices'] as $weight => &$choice) { foreach ($choice as $key => &$c) { $result = c_base_mime::s_identify($c['choice'], TRUE); if ($result instanceof c_base_return_false) { @@ -5252,9 +5262,9 @@ class c_base_http extends c_base_rfc_string { $c['accept'] = $identified['id_type']; $c['category'] = $identified['id_category']; - $this->request[self::REQUEST_ACCEPT]['data']['types'][$weight][$identified['id_type']] = $identified['id_type']; - #$this->request[self::REQUEST_ACCEPT]['data']['categories'][$weight][$identified['id_category']] = $identified['id_category']; - $this->request[self::REQUEST_ACCEPT]['data']['weight'][$weight][$identified['id_type']] = $identified['name_category'] . '/' . $identified['name_type']; + $this->request[static::REQUEST_ACCEPT]['data']['types'][$weight][$identified['id_type']] = $identified['id_type']; + #$this->request[static::REQUEST_ACCEPT]['data']['categories'][$weight][$identified['id_category']] = $identified['id_category']; + $this->request[static::REQUEST_ACCEPT]['data']['weight'][$weight][$identified['id_type']] = $identified['name_category'] . '/' . $identified['name_type']; // @todo: should this be used or not? #if ($identified['id_category'] == c_base_mime::CATEGORY_UNKNOWN || $identified['id_type'] == c_base_mime::TYPE_UNKNOWN) { @@ -5270,19 +5280,19 @@ class c_base_http extends c_base_rfc_string { unset($key); // sort the weight array. - krsort($this->request[self::REQUEST_ACCEPT]['data']['weight']); + krsort($this->request[static::REQUEST_ACCEPT]['data']['weight']); // The NULL key should be the first key in the weight. - $this->pr_prepend_array_value(NULL, $this->request[self::REQUEST_ACCEPT]['data']['weight']); + $this->pr_prepend_array_value(NULL, $this->request[static::REQUEST_ACCEPT]['data']['weight']); // rename 'choices' array key to 'accept'. - $this->request[self::REQUEST_ACCEPT]['data']['accept'] = $this->request[self::REQUEST_ACCEPT]['data']['choices']; - unset($this->request[self::REQUEST_ACCEPT]['data']['choices']); + $this->request[static::REQUEST_ACCEPT]['data']['accept'] = $this->request[static::REQUEST_ACCEPT]['data']['choices']; + unset($this->request[static::REQUEST_ACCEPT]['data']['choices']); } - unset($this->request[self::REQUEST_ACCEPT]['data']['invalid']); - unset($this->request[self::REQUEST_ACCEPT]['data']['current']); + unset($this->request[static::REQUEST_ACCEPT]['data']['invalid']); + unset($this->request[static::REQUEST_ACCEPT]['data']['current']); - $this->request[self::REQUEST_ACCEPT]['invalid'] = FALSE; + $this->request[static::REQUEST_ACCEPT]['invalid'] = FALSE; } /** @@ -5293,29 +5303,29 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_accept_language() { if (empty($this->headers['accept-language'])) { - $this->request[self::REQUEST_ACCEPT_LANGUAGE]['invalid'] = TRUE; + $this->request[static::REQUEST_ACCEPT_LANGUAGE]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['accept-language']); if ($text['invalid']) { - $this->request[self::REQUEST_ACCEPT_LANGUAGE]['invalid'] = TRUE; + $this->request[static::REQUEST_ACCEPT_LANGUAGE]['invalid'] = TRUE; unset($text); return; } - $this->request[self::REQUEST_ACCEPT_LANGUAGE]['data'] = $this->pr_rfc_string_is_negotiation($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_ACCEPT_LANGUAGE]['data'] = $this->pr_rfc_string_is_negotiation($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_ACCEPT_LANGUAGE]['data']['invalid']) { - $this->request[self::REQUEST_ACCEPT_LANGUAGE]['invalid'] = TRUE; + if ($this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['invalid']) { + $this->request[static::REQUEST_ACCEPT_LANGUAGE]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_ACCEPT_LANGUAGE]['defined'] = TRUE; - $this->request[self::REQUEST_ACCEPT_LANGUAGE]['data']['weight'] = array(); + $this->request[static::REQUEST_ACCEPT_LANGUAGE]['defined'] = TRUE; + $this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['weight'] = array(); // convert the known values into integers for improved processing. - foreach ($this->request[self::REQUEST_ACCEPT_LANGUAGE]['data']['choices'] as $weight => &$choice) { + foreach ($this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['choices'] as $weight => &$choice) { foreach ($choice as $key => &$c) { $id = c_base_defaults_global::s_get_languages()->s_get_id_by_name($c['choice']); if ($id instanceof c_base_return_false) { @@ -5323,26 +5333,26 @@ class c_base_http extends c_base_rfc_string { } else { $c['language'] = $id->get_value_exact(); - $this->request[self::REQUEST_ACCEPT_LANGUAGE]['data']['weight'][$weight][$c['language']] = c_base_utf8::s_lowercase($c['choice'])->get_value_exact(); + $this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['weight'][$weight][$c['language']] = c_base_utf8::s_lowercase($c['choice'])->get_value_exact(); unset($c['choice']); } } } // sort the weight array. - krsort($this->request[self::REQUEST_ACCEPT_LANGUAGE]['data']['weight']); + krsort($this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['weight']); // The NULL key should be the first key in the weight. - $this->pr_prepend_array_value(NULL, $this->request[self::REQUEST_ACCEPT_LANGUAGE]['data']['weight']); + $this->pr_prepend_array_value(NULL, $this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['weight']); // rename 'choices' array key to 'language'. - $this->request[self::REQUEST_ACCEPT_LANGUAGE]['data']['language'] = $this->request[self::REQUEST_ACCEPT_LANGUAGE]['data']['choices']; - unset($this->request[self::REQUEST_ACCEPT_LANGUAGE]['data']['choices']); + $this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['language'] = $this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['choices']; + unset($this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['choices']); } - unset($this->request[self::REQUEST_ACCEPT_LANGUAGE]['data']['invalid']); - unset($this->request[self::REQUEST_ACCEPT_LANGUAGE]['data']['current']); + unset($this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['invalid']); + unset($this->request[static::REQUEST_ACCEPT_LANGUAGE]['data']['current']); - $this->request[self::REQUEST_ACCEPT_LANGUAGE]['invalid'] = FALSE; + $this->request[static::REQUEST_ACCEPT_LANGUAGE]['invalid'] = FALSE; } /** @@ -5353,84 +5363,84 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_accept_encoding() { if (empty($this->headers['accept-encoding'])) { - $this->request[self::REQUEST_ACCEPT_ENCODING]['invalid'] = TRUE; + $this->request[static::REQUEST_ACCEPT_ENCODING]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['accept-encoding']); if ($text['invalid']) { - $this->request[self::REQUEST_ACCEPT_ENCODING]['invalid'] = TRUE; + $this->request[static::REQUEST_ACCEPT_ENCODING]['invalid'] = TRUE; unset($text); return; } - $this->request[self::REQUEST_ACCEPT_ENCODING]['data'] = $this->pr_rfc_string_is_negotiation($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_ACCEPT_ENCODING]['data'] = $this->pr_rfc_string_is_negotiation($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_ACCEPT_ENCODING]['data']['invalid']) { - $this->request[self::REQUEST_ACCEPT_ENCODING]['invalid'] = TRUE; + if ($this->request[static::REQUEST_ACCEPT_ENCODING]['data']['invalid']) { + $this->request[static::REQUEST_ACCEPT_ENCODING]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_ACCEPT_ENCODING]['defined'] = TRUE; - $this->request[self::REQUEST_ACCEPT_ENCODING]['data']['weight'] = array(); + $this->request[static::REQUEST_ACCEPT_ENCODING]['defined'] = TRUE; + $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight'] = array(); // convert the known values into integers for improved processing. - foreach ($this->request[self::REQUEST_ACCEPT_ENCODING]['data']['choices'] as $weight => &$choice) { + foreach ($this->request[static::REQUEST_ACCEPT_ENCODING]['data']['choices'] as $weight => &$choice) { foreach ($choice as $key => &$c) { $lowercase = c_base_utf8::s_lowercase($c['choice'])->get_value_exact(); if ($lowercase == 'chunked') { - $c['encoding'] = self::ENCODING_CHUNKED; - $this->request[self::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][self::ENCODING_CHUNKED] = $lowercase; + $c['encoding'] = static::ENCODING_CHUNKED; + $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][static::ENCODING_CHUNKED] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'compress') { - $c['encoding'] = self::ENCODING_COMPRESS; - $this->request[self::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][self::ENCODING_COMPRESS] = $lowercase; + $c['encoding'] = static::ENCODING_COMPRESS; + $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][static::ENCODING_COMPRESS] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'deflate') { - $c['encoding'] = self::ENCODING_DEFLATE; - $this->request[self::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][self::ENCODING_DEFLATE] = $lowercase; + $c['encoding'] = static::ENCODING_DEFLATE; + $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][static::ENCODING_DEFLATE] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'gzip') { - $c['encoding'] = self::ENCODING_GZIP; - $this->request[self::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][self::ENCODING_GZIP] = $lowercase; + $c['encoding'] = static::ENCODING_GZIP; + $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][static::ENCODING_GZIP] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'bzip') { - $c['encoding'] = self::ENCODING_BZIP; - $this->request[self::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][self::ENCODING_BZIP] = $lowercase; + $c['encoding'] = static::ENCODING_BZIP; + $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][static::ENCODING_BZIP] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'lzo') { - $c['encoding'] = self::ENCODING_LZO; - $this->request[self::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][self::ENCODING_LZO] = $lowercase; + $c['encoding'] = static::ENCODING_LZO; + $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][static::ENCODING_LZO] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'xz') { - $c['encoding'] = self::ENCODING_XZ; - $this->request[self::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][self::ENCODING_XZ] = $lowercase; + $c['encoding'] = static::ENCODING_XZ; + $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][static::ENCODING_XZ] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'exit') { - $c['encoding'] = self::ENCODING_EXI; - $this->request[self::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][self::ENCODING_EXI] = $lowercase; + $c['encoding'] = static::ENCODING_EXI; + $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][static::ENCODING_EXI] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'identity') { - $c['encoding'] = self::ENCODING_IDENTITY; - $this->request[self::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][self::ENCODING_IDENTITY] = $lowercase; + $c['encoding'] = static::ENCODING_IDENTITY; + $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][static::ENCODING_IDENTITY] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'sdch') { - $c['encoding'] = self::ENCODING_SDCH; - $this->request[self::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][self::ENCODING_SDCH] = $lowercase; + $c['encoding'] = static::ENCODING_SDCH; + $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][static::ENCODING_SDCH] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'pg') { - $c['encoding'] = self::ENCODING_PG; - $this->request[self::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][self::ENCODING_PG] = $lowercase; + $c['encoding'] = static::ENCODING_PG; + $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight'][$weight][static::ENCODING_PG] = $lowercase; unset($c['choice']); } else { @@ -5441,19 +5451,19 @@ class c_base_http extends c_base_rfc_string { unset($lowercase); // sort the weight array. - krsort($this->request[self::REQUEST_ACCEPT_ENCODING]['data']['weight']); + krsort($this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight']); // The NULL key should be the first key in the weight. - $this->pr_prepend_array_value(NULL, $this->request[self::REQUEST_ACCEPT_ENCODING]['data']['weight']); + $this->pr_prepend_array_value(NULL, $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight']); // rename 'choices' array key to 'encoding'. - $this->request[self::REQUEST_ACCEPT_ENCODING]['data']['encoding'] = $this->request[self::REQUEST_ACCEPT_ENCODING]['data']['choices']; - unset($this->request[self::REQUEST_ACCEPT_ENCODING]['data']['choices']); + $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['encoding'] = $this->request[static::REQUEST_ACCEPT_ENCODING]['data']['choices']; + unset($this->request[static::REQUEST_ACCEPT_ENCODING]['data']['choices']); } - unset($this->request[self::REQUEST_ACCEPT_ENCODING]['data']['invalid']); - unset($this->request[self::REQUEST_ACCEPT_ENCODING]['data']['current']); + unset($this->request[static::REQUEST_ACCEPT_ENCODING]['data']['invalid']); + unset($this->request[static::REQUEST_ACCEPT_ENCODING]['data']['current']); - $this->request[self::REQUEST_ACCEPT_ENCODING]['invalid'] = FALSE; + $this->request[static::REQUEST_ACCEPT_ENCODING]['invalid'] = FALSE; } /** @@ -5464,129 +5474,129 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_accept_charset() { if (empty($this->headers['accept-charset'])) { - $this->request[self::REQUEST_ACCEPT_CHARSET]['invalid'] = TRUE; + $this->request[static::REQUEST_ACCEPT_CHARSET]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['accept-charset']); if ($text['invalid']) { - $this->request[self::REQUEST_ACCEPT_CHARSET]['invalid'] = TRUE; + $this->request[static::REQUEST_ACCEPT_CHARSET]['invalid'] = TRUE; unset($text); return; } - $this->request[self::REQUEST_ACCEPT_CHARSET]['data'] = $this->pr_rfc_string_is_negotiation($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_ACCEPT_CHARSET]['data'] = $this->pr_rfc_string_is_negotiation($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_ACCEPT_CHARSET]['data']['invalid']) { - $this->request[self::REQUEST_ACCEPT_CHARSET]['invalid'] = TRUE; + if ($this->request[static::REQUEST_ACCEPT_CHARSET]['data']['invalid']) { + $this->request[static::REQUEST_ACCEPT_CHARSET]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_ACCEPT_CHARSET]['defined'] = TRUE; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'] = array(); + $this->request[static::REQUEST_ACCEPT_CHARSET]['defined'] = TRUE; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'] = array(); // convert the known values into integers for improved processing. - foreach ($this->request[self::REQUEST_ACCEPT_CHARSET]['data']['choices'] as $weight => &$choice) { + foreach ($this->request[static::REQUEST_ACCEPT_CHARSET]['data']['choices'] as $weight => &$choice) { foreach ($choice as $key => &$c) { $lowercase = c_base_utf8::s_lowercase($c['choice'])->get_value_exact(); if ($lowercase == 'ascii') { $c['charset'] = c_base_charset::ASCII; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ASCII] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ASCII] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'utf-8') { $c['charset'] = c_base_charset::UTF_8; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::UTF_8] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::UTF_8] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'utf-16') { $c['charset'] = c_base_charset::UTF_16; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::UTF_16] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::UTF_16] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'utf-32') { $c['charset'] = c_base_charset::UTF_32; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::UTF_32] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::UTF_32] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'iso-8859-1') { $c['charset'] = c_base_charset::ISO_8859_1; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_1] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_1] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'iso-8859-2') { $c['charset'] = c_base_charset::ISO_8859_2; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_2] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_2] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'iso-8859-3') { $c['charset'] = c_base_charset::ISO_8859_3; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_3] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_3] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'iso-8859-4') { $c['charset'] = c_base_charset::ISO_8859_4; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_4] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_4] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'iso-8859-5') { $c['charset'] = c_base_charset::ISO_8859_5; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_5] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_5] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'iso-8859-6') { $c['charset'] = c_base_charset::ISO_8859_6; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_6] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_6] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'iso-8859-7') { $c['charset'] = c_base_charset::ISO_8859_7; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_7] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_7] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'iso-8859-8') { $c['charset'] = c_base_charset::ISO_8859_8; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_8] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_8] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'iso-8859-9') { $c['charset'] = c_base_charset::ISO_8859_9; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_9] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_9] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'iso-8859-10') { $c['charset'] = c_base_charset::ISO_8859_10; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_10] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_10] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'iso-8859-11') { $c['charset'] = c_base_charset::ISO_8859_11; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_11] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_11] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'iso-8859-12') { $c['charset'] = c_base_charset::ISO_8859_12; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_12] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_12] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'iso-8859-13') { $c['charset'] = c_base_charset::ISO_8859_13; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_13] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_13] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'iso-8859-14') { $c['charset'] = c_base_charset::ISO_8859_14; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_14] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_14] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'iso-8859-15') { $c['charset'] = c_base_charset::ISO_8859_15; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_15] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_15] = $lowercase; unset($c['choice']); } elseif ($lowercase == 'iso-8859-16') { $c['charset'] = c_base_charset::ISO_8859_16; - $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_16] = $lowercase; + $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight'][$weight][c_base_charset::ISO_8859_16] = $lowercase; unset($c['choice']); } else { @@ -5597,14 +5607,14 @@ class c_base_http extends c_base_rfc_string { unset($lowercase); // sort the weight array. - krsort($this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight']); + krsort($this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight']); // The NULL key should be the first key in the weight. - $this->pr_prepend_array_value(NULL, $this->request[self::REQUEST_ACCEPT_CHARSET]['data']['weight']); + $this->pr_prepend_array_value(NULL, $this->request[static::REQUEST_ACCEPT_CHARSET]['data']['weight']); } - unset($this->request[self::REQUEST_ACCEPT_CHARSET]['data']['invalid']); + unset($this->request[static::REQUEST_ACCEPT_CHARSET]['data']['invalid']); - $this->request[self::REQUEST_ACCEPT_CHARSET]['invalid'] = FALSE; + $this->request[static::REQUEST_ACCEPT_CHARSET]['invalid'] = FALSE; } /** @@ -5616,20 +5626,20 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_accept_datetime() { if (p_validate_date_is_valid_rfc($this->headers['accept-datetime']) === FALSE) { - $this->request[self::REQUEST_ACCEPT_DATETIME]['invalid'] = TRUE; + $this->request[static::REQUEST_ACCEPT_DATETIME]['invalid'] = TRUE; return; } $timestamp = strtotime($this->headers['accept-datetime']); if ($timestamp === FALSE) { - $this->request[self::REQUEST_ACCEPT_DATETIME]['invalid'] = TRUE; + $this->request[static::REQUEST_ACCEPT_DATETIME]['invalid'] = TRUE; unset($timestamp); return; } - $this->request[self::REQUEST_ACCEPT_DATETIME]['defined'] = TRUE; - $this->request[self::REQUEST_ACCEPT_DATETIME]['data'] = $timestamp; - $this->request[self::REQUEST_ACCEPT_DATETIME]['invalid'] = FALSE; + $this->request[static::REQUEST_ACCEPT_DATETIME]['defined'] = TRUE; + $this->request[static::REQUEST_ACCEPT_DATETIME]['data'] = $timestamp; + $this->request[static::REQUEST_ACCEPT_DATETIME]['invalid'] = FALSE; unset($timestamp); } @@ -5649,56 +5659,56 @@ class c_base_http extends c_base_rfc_string { unset($method_string); if (empty($methods)) { - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['invalid'] = TRUE; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['invalid'] = TRUE; return; } - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'] = array(); + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'] = array(); foreach ($methods as $method) { switch ($method) { case 'get': - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][self::HTTP_METHOD_GET] = self::HTTP_METHOD_GET; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][static::HTTP_METHOD_GET] = static::HTTP_METHOD_GET; break; case 'head': - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][self::HTTP_METHOD_HEAD] = self::HTTP_METHOD_HEAD; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][static::HTTP_METHOD_HEAD] = static::HTTP_METHOD_HEAD; break; case 'post': - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][self::HTTP_METHOD_POST] = self::HTTP_METHOD_POST; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][static::HTTP_METHOD_POST] = static::HTTP_METHOD_POST; break; case 'put': - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][self::HTTP_METHOD_PUT] = self::HTTP_METHOD_PUT; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][static::HTTP_METHOD_PUT] = static::HTTP_METHOD_PUT; break; case 'delete': - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][self::HTTP_METHOD_DELETE] = self::HTTP_METHOD_DELETE; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][static::HTTP_METHOD_DELETE] = static::HTTP_METHOD_DELETE; break; case 'trace': - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][self::HTTP_METHOD_TRACE] = self::HTTP_METHOD_TRACE; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][static::HTTP_METHOD_TRACE] = static::HTTP_METHOD_TRACE; break; case 'options': - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][self::HTTP_METHOD_OPTIONS] = self::HTTP_METHOD_OPTIONS; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][static::HTTP_METHOD_OPTIONS] = static::HTTP_METHOD_OPTIONS; break; case 'connect': - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][self::HTTP_METHOD_CONNECT] = self::HTTP_METHOD_CONNECT; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][static::HTTP_METHOD_CONNECT] = static::HTTP_METHOD_CONNECT; break; case 'patch': - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][self::HTTP_METHOD_PATCH] = self::HTTP_METHOD_PATCH; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][static::HTTP_METHOD_PATCH] = static::HTTP_METHOD_PATCH; break; case 'track': - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][self::HTTP_METHOD_TRACK] = self::HTTP_METHOD_TRACK; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][static::HTTP_METHOD_TRACK] = static::HTTP_METHOD_TRACK; break; case 'debug': - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][self::HTTP_METHOD_DEBUG] = self::HTTP_METHOD_DEBUG; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'][static::HTTP_METHOD_DEBUG] = static::HTTP_METHOD_DEBUG; break; default: @@ -5708,17 +5718,17 @@ class c_base_http extends c_base_rfc_string { } unset($method); - if (!empty($methods) && empty($this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'])) { + if (!empty($methods) && empty($this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['data'])) { unset($methods); // no valid methods were found, now the error can be reported. - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['invalid'] = TRUE; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['invalid'] = TRUE; return; } unset($methods); - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['defined'] = TRUE; - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['invalid'] = FALSE; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['defined'] = TRUE; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD]['invalid'] = FALSE; } /** @@ -5730,34 +5740,34 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_access_control_request_headers() { if (empty($this->headers['access-control-request-headers'])) { - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['invalid'] = TRUE; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['access-control-request-headers']); if ($text['invalid']) { - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['invalid'] = TRUE; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['invalid'] = TRUE; unset($text); return; } - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['data'] = $this->pr_rfc_string_is_token($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['data'] = $this->pr_rfc_string_is_token($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['data']['invalid']) { - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['invalid'] = TRUE; + if ($this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['data']['invalid']) { + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['defined'] = TRUE; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['defined'] = TRUE; // rename 'tokens' array key to 'headers'. - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['data']['headers'] = $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['data']['tokens']; - unset($this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['data']['tokens']); + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['data']['headers'] = $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['data']['tokens']; + unset($this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['data']['tokens']); } - unset($this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['data']['invalid']); - unset($this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['data']['current']); + unset($this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['data']['invalid']); + unset($this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['data']['current']); - $this->request[self::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['invalid'] = FALSE; + $this->request[static::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS]['invalid'] = FALSE; } /** @@ -5769,30 +5779,30 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_authorization() { if (empty($this->headers['authorization'])) { - $this->request[self::REQUEST_AUTHORIZATION]['invalid'] = TRUE; + $this->request[static::REQUEST_AUTHORIZATION]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['authorization']); if ($text['invalid']) { - $this->request[self::REQUEST_AUTHORIZATION]['invalid'] = TRUE; + $this->request[static::REQUEST_AUTHORIZATION]['invalid'] = TRUE; unset($text); return; } - $this->request[self::REQUEST_AUTHORIZATION]['data'] = $this->pr_rfc_string_is_credentials($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_AUTHORIZATION]['data'] = $this->pr_rfc_string_is_credentials($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_AUTHORIZATION]['data']['invalid']) { - $this->request[self::REQUEST_AUTHORIZATION]['invalid'] = TRUE; + if ($this->request[static::REQUEST_AUTHORIZATION]['data']['invalid']) { + $this->request[static::REQUEST_AUTHORIZATION]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_AUTHORIZATION]['defined'] = TRUE; + $this->request[static::REQUEST_AUTHORIZATION]['defined'] = TRUE; } - unset($this->request[self::REQUEST_AUTHORIZATION]['data']['invalid']); - unset($this->request[self::REQUEST_AUTHORIZATION]['data']['current']); + unset($this->request[static::REQUEST_AUTHORIZATION]['data']['invalid']); + unset($this->request[static::REQUEST_AUTHORIZATION]['data']['current']); - $this->request[self::REQUEST_AUTHORIZATION]['invalid'] = FALSE; + $this->request[static::REQUEST_AUTHORIZATION]['invalid'] = FALSE; } /** @@ -5805,12 +5815,12 @@ class c_base_http extends c_base_rfc_string { private function p_load_request_cache_control() { $cache_control = $this->headers['cache-control']; if (empty($cache_control)) { - $this->request[self::REQUEST_CACHE_CONTROL]['invalid'] = TRUE; + $this->request[static::REQUEST_CACHE_CONTROL]['invalid'] = TRUE; unset($cache_control); return; } - $this->request[self::REQUEST_CACHE_CONTROL]['data'] = array( + $this->request[static::REQUEST_CACHE_CONTROL]['data'] = array( 'methods' => array(), ); @@ -5824,20 +5834,20 @@ class c_base_http extends c_base_rfc_string { foreach ($parts as $part) { $cleaned_up = c_base_utf8::s_lowercase(preg_replace('/(^\s+)|(\s+$)/us', '', $part))->get_value_exact(); if ($cleaned_up == 'no-cache') { - $this->request[self::REQUEST_CACHE_CONTROL]['defined'] = TRUE; - $this->request[self::REQUEST_CACHE_CONTROL]['data']['methods'][SELF::CACHE_CONTROL_NO_CACHE] = SELF::CACHE_CONTROL_NO_CACHE; + $this->request[static::REQUEST_CACHE_CONTROL]['defined'] = TRUE; + $this->request[static::REQUEST_CACHE_CONTROL]['data']['methods'][SELF::CACHE_CONTROL_NO_CACHE] = SELF::CACHE_CONTROL_NO_CACHE; } elseif ($cleaned_up == 'no-store') { - $this->request[self::REQUEST_CACHE_CONTROL]['defined'] = TRUE; - $this->request[self::REQUEST_CACHE_CONTROL]['data']['methods'][SELF::CACHE_CONTROL_NO_STORE] = SELF::CACHE_CONTROL_NO_STORE; + $this->request[static::REQUEST_CACHE_CONTROL]['defined'] = TRUE; + $this->request[static::REQUEST_CACHE_CONTROL]['data']['methods'][SELF::CACHE_CONTROL_NO_STORE] = SELF::CACHE_CONTROL_NO_STORE; } elseif ($cleaned_up == 'no-transform') { - $this->request[self::REQUEST_CACHE_CONTROL]['defined'] = TRUE; - $this->request[self::REQUEST_CACHE_CONTROL]['data']['methods'][SELF::CACHE_CONTROL_NO_TRANSFORM] = SELF::CACHE_CONTROL_NO_TRANSFORM; + $this->request[static::REQUEST_CACHE_CONTROL]['defined'] = TRUE; + $this->request[static::REQUEST_CACHE_CONTROL]['data']['methods'][SELF::CACHE_CONTROL_NO_TRANSFORM] = SELF::CACHE_CONTROL_NO_TRANSFORM; } elseif ($cleaned_up == 'only-if-cached') { - $this->request[self::REQUEST_CACHE_CONTROL]['defined'] = TRUE; - $this->request[self::REQUEST_CACHE_CONTROL]['data']['methods'][SELF::CACHE_CONTROL_ONLY_IF_CACHED] = SELF::CACHE_CONTROL_ONLY_IF_CACHED; + $this->request[static::REQUEST_CACHE_CONTROL]['defined'] = TRUE; + $this->request[static::REQUEST_CACHE_CONTROL]['data']['methods'][SELF::CACHE_CONTROL_ONLY_IF_CACHED] = SELF::CACHE_CONTROL_ONLY_IF_CACHED; } else { foreach ($integer_types as $type_id => $type_string) { @@ -5847,13 +5857,13 @@ class c_base_http extends c_base_rfc_string { $pieces = mb_split('=', $cleaned_up); if (!isset($pieces[1]) || !is_numeric($pieces[1]) || count($pieces) > 2) { - $this->request[self::REQUEST_CACHE_CONTROL]['invalid'] = TRUE; + $this->request[static::REQUEST_CACHE_CONTROL]['invalid'] = TRUE; unset($pieces); continue; } - $this->request[self::REQUEST_CACHE_CONTROL]['defined'] = TRUE; - $this->request[self::REQUEST_CACHE_CONTROL]['data']['methods'][$type_id] = (int) $pieces[1]; + $this->request[static::REQUEST_CACHE_CONTROL]['defined'] = TRUE; + $this->request[static::REQUEST_CACHE_CONTROL]['data']['methods'][$type_id] = (int) $pieces[1]; unset($pieces); } @@ -5868,7 +5878,7 @@ class c_base_http extends c_base_rfc_string { unset($parts); unset($cache_control); - $this->request[self::REQUEST_CACHE_CONTROL]['invalid'] = FALSE; + $this->request[static::REQUEST_CACHE_CONTROL]['invalid'] = FALSE; } /** @@ -5880,34 +5890,34 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_connection() { if (empty($this->headers['connection'])) { - $this->request[self::REQUEST_CONNECTION]['invalid'] = TRUE; + $this->request[static::REQUEST_CONNECTION]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['connection']); if ($text['invalid']) { - $this->request[self::REQUEST_CONNECTION]['invalid'] = TRUE; + $this->request[static::REQUEST_CONNECTION]['invalid'] = TRUE; unset($text); return; } - $this->request[self::REQUEST_CONNECTION]['data'] = $this->pr_rfc_string_is_commad_token($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_CONNECTION]['data'] = $this->pr_rfc_string_is_commad_token($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_CONNECTION]['data']['invalid']) { - $this->request[self::REQUEST_CONNECTION]['invalid'] = TRUE; + if ($this->request[static::REQUEST_CONNECTION]['data']['invalid']) { + $this->request[static::REQUEST_CONNECTION]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_CONNECTION]['defined'] = TRUE; + $this->request[static::REQUEST_CONNECTION]['defined'] = TRUE; // rename 'tokens' array key to 'connection'. - $this->request[self::REQUEST_CONNECTION]['data']['connection'] = $this->request[self::REQUEST_CONNECTION]['data']['tokens']; - unset($this->request[self::REQUEST_CONNECTION]['data']['text']); + $this->request[static::REQUEST_CONNECTION]['data']['connection'] = $this->request[static::REQUEST_CONNECTION]['data']['tokens']; + unset($this->request[static::REQUEST_CONNECTION]['data']['text']); } - unset($this->request[self::REQUEST_CONNECTION]['data']['invalid']); - unset($this->request[self::REQUEST_CONNECTION]['data']['current']); + unset($this->request[static::REQUEST_CONNECTION]['data']['invalid']); + unset($this->request[static::REQUEST_CONNECTION]['data']['current']); - $this->request[self::REQUEST_CONNECTION]['invalid'] = FALSE; + $this->request[static::REQUEST_CONNECTION]['invalid'] = FALSE; } /** @@ -5919,7 +5929,7 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7234#section-5.4 */ private function p_load_request_pragma() { - if ($this->request[self::REQUEST_CACHE_CONTROL]['defined']) { + if ($this->request[static::REQUEST_CACHE_CONTROL]['defined']) { // this is a conflict, favor 'cache-control' over 'pragma'. return; } @@ -5933,13 +5943,13 @@ class c_base_http extends c_base_rfc_string { $cleaned_up = c_base_utf8::s_lowercase(preg_replace('/(^\s+)|(\s+$)/us', '', $pragma))->get_value_exact(); if ($cleaned_up == 'no-cache') { - $this->request[self::REQUEST_CACHE_CONTROL]['defined'] = TRUE; - $this->request[self::REQUEST_CACHE_CONTROL]['data'][SELF::CACHE_CONTROL_NO_CACHE] = SELF::CACHE_CONTROL_NO_CACHE; + $this->request[static::REQUEST_CACHE_CONTROL]['defined'] = TRUE; + $this->request[static::REQUEST_CACHE_CONTROL]['data'][SELF::CACHE_CONTROL_NO_CACHE] = SELF::CACHE_CONTROL_NO_CACHE; } unset($cleaned_up); unset($pragma); - $this->request[self::REQUEST_CACHE_CONTROL]['invalid'] = FALSE; + $this->request[static::REQUEST_CACHE_CONTROL]['invalid'] = FALSE; } /** @@ -5948,7 +5958,7 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc6265 */ private function p_load_request_cookies() { - $this->request[self::REQUEST_COOKIE]['data'] = array(); + $this->request[static::REQUEST_COOKIE]['data'] = array(); foreach ($_COOKIE as $cookie_name => $cookie_values) { $cookie = new c_base_cookie(); @@ -5961,14 +5971,14 @@ class c_base_http extends c_base_rfc_string { } $cookie->do_pull(); - $this->request[self::REQUEST_COOKIE]['data'][$cookie_name] = $cookie; - $this->request[self::REQUEST_COOKIE]['defined'] = TRUE; + $this->request[static::REQUEST_COOKIE]['data'][$cookie_name] = $cookie; + $this->request[static::REQUEST_COOKIE]['defined'] = TRUE; unset($cookie); } unset($cookie_name); unset($cookie_values); - $this->request[self::REQUEST_COOKIE]['invalid'] = FALSE; + $this->request[static::REQUEST_COOKIE]['invalid'] = FALSE; } /** @@ -5981,14 +5991,14 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_content_length() { if (is_int($this->headers['content-length'])) { - $this->request[self::REQUEST_CONTENT_LENGTH]['defined'] = TRUE; - $this->request[self::REQUEST_CONTENT_LENGTH]['data'] = (int) $this->headers['content-length']; + $this->request[static::REQUEST_CONTENT_LENGTH]['defined'] = TRUE; + $this->request[static::REQUEST_CONTENT_LENGTH]['data'] = (int) $this->headers['content-length']; return; } $text = $this->pr_rfc_string_prepare($this->headers['content-length']); if ($text['invalid']) { - $this->request[self::REQUEST_CONTENT_LENGTH]['invalid'] = TRUE; + $this->request[static::REQUEST_CONTENT_LENGTH]['invalid'] = TRUE; unset($text); return; } @@ -5997,16 +6007,16 @@ class c_base_http extends c_base_rfc_string { unset($text); if ($parsed['invalid']) { - $this->request[self::REQUEST_CONTENT_LENGTH]['invalid'] = TRUE; + $this->request[static::REQUEST_CONTENT_LENGTH]['invalid'] = TRUE; unset($parsed); return; } - $this->request[self::REQUEST_CONTENT_LENGTH]['defined'] = TRUE; - $this->request[self::REQUEST_CONTENT_LENGTH]['data'] = intval($parsed['text']); + $this->request[static::REQUEST_CONTENT_LENGTH]['defined'] = TRUE; + $this->request[static::REQUEST_CONTENT_LENGTH]['data'] = intval($parsed['text']); unset($parsed); - $this->request[self::REQUEST_CONTENT_LENGTH]['invalid'] = FALSE; + $this->request[static::REQUEST_CONTENT_LENGTH]['invalid'] = FALSE; } /** @@ -6017,7 +6027,7 @@ class c_base_http extends c_base_rfc_string { private function p_load_request_content_type() { $content_type = $this->headers['content-type']; if (empty($content_type)) { - $this->request[self::REQUEST_CONTENT_TYPE]['invalid'] = TRUE; + $this->request[static::REQUEST_CONTENT_TYPE]['invalid'] = TRUE; unset($content_type); return; } @@ -6025,14 +6035,14 @@ class c_base_http extends c_base_rfc_string { $content_type_parts = mb_split(';', $content_type); $content_type_part = c_base_utf8::s_lowercase(preg_replace('/(^\s+)|(\s+$)/us', '', $content_type_parts[0]))->get_value_exact(); - $this->request[self::REQUEST_CONTENT_TYPE]['defined'] = TRUE; - $this->request[self::REQUEST_CONTENT_TYPE]['data'] = $content_type_part; + $this->request[static::REQUEST_CONTENT_TYPE]['defined'] = TRUE; + $this->request[static::REQUEST_CONTENT_TYPE]['data'] = $content_type_part; unset($content_type_part); unset($content_type_parts); unset($content_type); - $this->request[self::REQUEST_CONTENT_TYPE]['invalid'] = FALSE; + $this->request[static::REQUEST_CONTENT_TYPE]['invalid'] = FALSE; } /** @@ -6042,23 +6052,23 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_date() { if (p_validate_date_is_valid_rfc($this->headers['date']) === FALSE) { - $this->request[self::REQUEST_DATE]['invalid'] = TRUE; + $this->request[static::REQUEST_DATE]['invalid'] = TRUE; return; } $timestamp = strtotime($this->headers['date']); if ($timestamp === FALSE) { - $this->request[self::REQUEST_DATE]['invalid'] = TRUE; + $this->request[static::REQUEST_DATE]['invalid'] = TRUE; unset($timestamp); return; } - $this->request[self::REQUEST_DATE]['defined'] = TRUE; - $this->request[self::REQUEST_DATE]['data'] = $timestamp; + $this->request[static::REQUEST_DATE]['defined'] = TRUE; + $this->request[static::REQUEST_DATE]['data'] = $timestamp; unset($timestamp); - $this->request[self::REQUEST_DATE]['invalid'] = FALSE; + $this->request[static::REQUEST_DATE]['invalid'] = FALSE; } /** @@ -6076,17 +6086,17 @@ class c_base_http extends c_base_rfc_string { private function p_load_request_expect() { $expect = $this->headers['expect']; if (empty($expect)) { - $this->request[self::REQUEST_EXPECT]['invalid'] = TRUE; + $this->request[static::REQUEST_EXPECT]['invalid'] = TRUE; unset($expect); return; } - $this->request[self::REQUEST_EXPECT]['defined'] = TRUE; - $this->request[self::REQUEST_EXPECT]['data'] = $expect; + $this->request[static::REQUEST_EXPECT]['defined'] = TRUE; + $this->request[static::REQUEST_EXPECT]['data'] = $expect; unset($expect); - $this->request[self::REQUEST_EXPECT]['invalid'] = FALSE; + $this->request[static::REQUEST_EXPECT]['invalid'] = FALSE; } /** @@ -6099,17 +6109,17 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_from() { if (empty($this->headers['from'])) { - $this->request[self::REQUEST_FROM]['invalid'] = TRUE; + $this->request[static::REQUEST_FROM]['invalid'] = TRUE; return; } // @todo: write a custom validation to ensure that the from email address is valid. - $this->request[self::REQUEST_FROM]['defined'] = TRUE; - $this->request[self::REQUEST_FROM]['data'] = $this->headers['from']; + $this->request[static::REQUEST_FROM]['defined'] = TRUE; + $this->request[static::REQUEST_FROM]['data'] = $this->headers['from']; unset($from); - $this->request[self::REQUEST_FROM]['invalid'] = FALSE; + $this->request[static::REQUEST_FROM]['invalid'] = FALSE; } /** @@ -6120,7 +6130,7 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_host() { if (empty($this->headers['host'])) { - $this->request[self::REQUEST_HOST]['invalid'] = TRUE; + $this->request[static::REQUEST_HOST]['invalid'] = TRUE; return; } @@ -6128,22 +6138,22 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $this->request[self::REQUEST_HOST]['invalid'] = TRUE; + $this->request[static::REQUEST_HOST]['invalid'] = TRUE; return; } - $this->request[self::REQUEST_HOST]['data'] = $this->pr_rfc_string_is_uri($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_HOST]['data'] = $this->pr_rfc_string_is_uri($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_HOST]['data']['invalid']) { - $this->request[self::REQUEST_HOST]['invalid'] = TRUE; + if ($this->request[static::REQUEST_HOST]['data']['invalid']) { + $this->request[static::REQUEST_HOST]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_HOST]['defined'] = TRUE; + $this->request[static::REQUEST_HOST]['defined'] = TRUE; } - unset($this->request[self::REQUEST_HOST]['data']['invalid']); + unset($this->request[static::REQUEST_HOST]['data']['invalid']); - $this->request[self::REQUEST_HOST]['invalid'] = FALSE; + $this->request[static::REQUEST_HOST]['invalid'] = FALSE; } /** @@ -6155,22 +6165,22 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_if_match() { if (empty($this->headers['if-match'])) { - $this->request[self::REQUEST_IF_MATCH]['invalid'] = TRUE; + $this->request[static::REQUEST_IF_MATCH]['invalid'] = TRUE; return; } - $this->request[self::REQUEST_IF_MATCH]['data'] = $this->p_parse_if_entity_tag($this->headers['if-match']); + $this->request[static::REQUEST_IF_MATCH]['data'] = $this->p_parse_if_entity_tag($this->headers['if-match']); - if ($this->request[self::REQUEST_IF_MATCH]['data']['invalid']) { - $this->request[self::REQUEST_IF_MATCH]['invalid'] = TRUE; + if ($this->request[static::REQUEST_IF_MATCH]['data']['invalid']) { + $this->request[static::REQUEST_IF_MATCH]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_IF_MATCH]['defined'] = TRUE; + $this->request[static::REQUEST_IF_MATCH]['defined'] = TRUE; } - unset($this->request[self::REQUEST_IF_MATCH]['data']['current']); - unset($this->request[self::REQUEST_IF_MATCH]['data']['invalid']); + unset($this->request[static::REQUEST_IF_MATCH]['data']['current']); + unset($this->request[static::REQUEST_IF_MATCH]['data']['invalid']); - $this->request[self::REQUEST_IF_MATCH]['invalid'] = FALSE; + $this->request[static::REQUEST_IF_MATCH]['invalid'] = FALSE; } /** @@ -6182,21 +6192,21 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_if_none_match() { if (empty($this->headers['if-none-match'])) { - $this->request[self::REQUEST_IF_NONE_MATCH]['invalid'] = TRUE; + $this->request[static::REQUEST_IF_NONE_MATCH]['invalid'] = TRUE; return; } - $this->request[self::REQUEST_IF_NONE_MATCH]['data'] = $this->p_parse_if_entity_tag_and_weak($this->headers['if-none-match']); + $this->request[static::REQUEST_IF_NONE_MATCH]['data'] = $this->p_parse_if_entity_tag_and_weak($this->headers['if-none-match']); - if ($this->request[self::REQUEST_IF_NONE_MATCH]['data']['invalid']) { - $this->request[self::REQUEST_IF_NONE_MATCH]['invalid'] = TRUE; + if ($this->request[static::REQUEST_IF_NONE_MATCH]['data']['invalid']) { + $this->request[static::REQUEST_IF_NONE_MATCH]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_IF_NONE_MATCH]['defined'] = TRUE; + $this->request[static::REQUEST_IF_NONE_MATCH]['defined'] = TRUE; } - unset($this->request[self::REQUEST_IF_NONE_MATCH]['data']['invalid']); + unset($this->request[static::REQUEST_IF_NONE_MATCH]['data']['invalid']); - $this->request[self::REQUEST_IF_NONE_MATCH]['invalid'] = FALSE; + $this->request[static::REQUEST_IF_NONE_MATCH]['invalid'] = FALSE; } /** @@ -6206,23 +6216,23 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_if_modified_since() { if ($this->p_validate_date_is_valid_rfc($this->headers['if-modified-since']) === FALSE) { - $this->request[self::REQUEST_IF_MODIFIED_SINCE]['invalid'] = TRUE; + $this->request[static::REQUEST_IF_MODIFIED_SINCE]['invalid'] = TRUE; return; } $timestamp = strtotime($this->headers['if-modified-since']); if ($timestamp === FALSE) { - $this->request[self::REQUEST_IF_MODIFIED_SINCE]['invalid'] = TRUE; + $this->request[static::REQUEST_IF_MODIFIED_SINCE]['invalid'] = TRUE; unset($timestamp); return; } - $this->request[self::REQUEST_IF_MODIFIED_SINCE]['defined'] = TRUE; - $this->request[self::REQUEST_IF_MODIFIED_SINCE]['data'] = $timestamp; + $this->request[static::REQUEST_IF_MODIFIED_SINCE]['defined'] = TRUE; + $this->request[static::REQUEST_IF_MODIFIED_SINCE]['data'] = $timestamp; unset($timestamp); - $this->request[self::REQUEST_IF_MODIFIED_SINCE]['invalid'] = FALSE; + $this->request[static::REQUEST_IF_MODIFIED_SINCE]['invalid'] = FALSE; } /** @@ -6232,23 +6242,23 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_if_unmodified_since() { if (p_validate_date_is_valid_rfc($this->headers['if-unmodified-since']) === FALSE) { - $this->request[self::REQUEST_IF_UNMODIFIED_SINCE]['invalid'] = TRUE; + $this->request[static::REQUEST_IF_UNMODIFIED_SINCE]['invalid'] = TRUE; return; } $timestamp = strtotime($this->headers['if-unmodified-since']); if ($timestamp === FALSE) { - $this->request[self::REQUEST_IF_UNMODIFIED_SINCE]['invalid'] = TRUE; + $this->request[static::REQUEST_IF_UNMODIFIED_SINCE]['invalid'] = TRUE; unset($timestamp); return; } - $this->request[self::REQUEST_IF_UNMODIFIED_SINCE]['defined'] = TRUE; - $this->request[self::REQUEST_IF_UNMODIFIED_SINCE]['data'] = $timestamp; + $this->request[static::REQUEST_IF_UNMODIFIED_SINCE]['defined'] = TRUE; + $this->request[static::REQUEST_IF_UNMODIFIED_SINCE]['data'] = $timestamp; unset($timestamp); - $this->request[self::REQUEST_IF_UNMODIFIED_SINCE]['invalid'] = FALSE; + $this->request[static::REQUEST_IF_UNMODIFIED_SINCE]['invalid'] = FALSE; } /** @@ -6263,16 +6273,16 @@ class c_base_http extends c_base_rfc_string { if (p_validate_date_is_valid_rfc($this->headers['if-range'])) { $timestamp = strtotime($this->headers['if-range']); if ($timestamp === FALSE) { - $this->request[self::REQUEST_IF_RANGE]['invalid'] = TRUE; - $this->request[self::REQUEST_IF_RANGE]['data'] = array( + $this->request[static::REQUEST_IF_RANGE]['invalid'] = TRUE; + $this->request[static::REQUEST_IF_RANGE]['data'] = array( 'is_date' => TRUE, ); unset($timestamp); return; } - $this->request[self::REQUEST_IF_RANGE]['defined'] = TRUE; - $this->request[self::REQUEST_IF_RANGE]['data'] = array( + $this->request[static::REQUEST_IF_RANGE]['defined'] = TRUE; + $this->request[static::REQUEST_IF_RANGE]['data'] = array( 'range' => $timestamp, 'is_date' => TRUE, ); @@ -6284,26 +6294,26 @@ class c_base_http extends c_base_rfc_string { // at this point, assume the if-range is an entity tag. $if_range = $this->headers['if-range']; if (empty($if_range)) { - $this->request[self::REQUEST_IF_RANGE]['if-range'] = TRUE; - $this->request[self::REQUEST_IF_RANGE]['data']['is_date'] = FALSE; + $this->request[static::REQUEST_IF_RANGE]['if-range'] = TRUE; + $this->request[static::REQUEST_IF_RANGE]['data']['is_date'] = FALSE; unset($if_range); return; } - $this->request[self::REQUEST_IF_RANGE]['data'] = $this->p_parse_if_entity_tag_and_weak($if_range); - $this->request[self::REQUEST_IF_RANGE]['data']['is_date'] = FALSE; + $this->request[static::REQUEST_IF_RANGE]['data'] = $this->p_parse_if_entity_tag_and_weak($if_range); + $this->request[static::REQUEST_IF_RANGE]['data']['is_date'] = FALSE; - if ($this->request[self::REQUEST_IF_RANGE]['data']['invalid']) { - $this->request[self::REQUEST_IF_RANGE]['invalid'] = TRUE; + if ($this->request[static::REQUEST_IF_RANGE]['data']['invalid']) { + $this->request[static::REQUEST_IF_RANGE]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_IF_RANGE]['defined'] = TRUE; + $this->request[static::REQUEST_IF_RANGE]['defined'] = TRUE; } - unset($this->request[self::REQUEST_IF_RANGE]['data']['invalid']); + unset($this->request[static::REQUEST_IF_RANGE]['data']['invalid']); unset($if_range); - $this->request[self::REQUEST_IF_RANGE]['invalid'] = FALSE; + $this->request[static::REQUEST_IF_RANGE]['invalid'] = FALSE; } /** @@ -6313,29 +6323,29 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_range() { if (empty($this->headers['range'])) { - $this->request[self::REQUEST_RANGE]['invalid'] = TRUE; + $this->request[static::REQUEST_RANGE]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['range']); if ($text['invalid']) { - $this->request[self::REQUEST_RANGE]['invalid'] = TRUE; + $this->request[static::REQUEST_RANGE]['invalid'] = TRUE; unset($text); return; } - $this->request[self::REQUEST_RANGE]['data'] = $this->pr_rfc_string_is_range($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_RANGE]['data'] = $this->pr_rfc_string_is_range($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_RANGE]['data']['invalid']) { - $this->request[self::REQUEST_RANGE]['invalid'] = TRUE; + if ($this->request[static::REQUEST_RANGE]['data']['invalid']) { + $this->request[static::REQUEST_RANGE]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_RANGE]['defined'] = TRUE; + $this->request[static::REQUEST_RANGE]['defined'] = TRUE; } - unset($this->request[self::REQUEST_RANGE]['data']['invalid']); + unset($this->request[static::REQUEST_RANGE]['data']['invalid']); - $this->request[self::REQUEST_RANGE]['invalid'] = FALSE; + $this->request[static::REQUEST_RANGE]['invalid'] = FALSE; } /** @@ -6345,13 +6355,13 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_max_forwards() { if (is_int($this->headers['max-forwards'])) { - $this->request[self::REQUEST_MAX_FORWARDS]['defined'] = TRUE; - $this->request[self::REQUEST_MAX_FORWARDS]['data'] = (int) $this->headers['max-forwards']; + $this->request[static::REQUEST_MAX_FORWARDS]['defined'] = TRUE; + $this->request[static::REQUEST_MAX_FORWARDS]['data'] = (int) $this->headers['max-forwards']; } $text = $this->pr_rfc_string_prepare($this->headers['max-forwards']); if ($text['invalid']) { - $this->request[self::REQUEST_MAX_FORWARDS]['invalid'] = TRUE; + $this->request[static::REQUEST_MAX_FORWARDS]['invalid'] = TRUE; unset($text); return; } @@ -6360,17 +6370,17 @@ class c_base_http extends c_base_rfc_string { unset($text); if ($parsed['invalid']) { - $this->request[self::REQUEST_MAX_FORWARDS]['invalid'] = TRUE; + $this->request[static::REQUEST_MAX_FORWARDS]['invalid'] = TRUE; unset($parsed); return; } - $this->request[self::REQUEST_MAX_FORWARDS]['defined'] = TRUE; - $this->request[self::REQUEST_MAX_FORWARDS]['data'] = intval($parsed['text']); + $this->request[static::REQUEST_MAX_FORWARDS]['defined'] = TRUE; + $this->request[static::REQUEST_MAX_FORWARDS]['data'] = intval($parsed['text']); unset($parsed); - $this->request[self::REQUEST_MAX_FORWARDS]['invalid'] = FALSE; + $this->request[static::REQUEST_MAX_FORWARDS]['invalid'] = FALSE; } /** @@ -6379,49 +6389,49 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc2616#section-5.1.1 */ private function p_load_request_method() { - $this->request[self::REQUEST_METHOD]['defined'] = TRUE; + $this->request[static::REQUEST_METHOD]['defined'] = TRUE; $method_string = c_base_utf8::s_lowercase($_SERVER['REQUEST_METHOD'])->get_value_exact(); if ($method_string == 'get') { - $this->request[self::REQUEST_METHOD]['data'] = self::HTTP_METHOD_GET; + $this->request[static::REQUEST_METHOD]['data'] = static::HTTP_METHOD_GET; } elseif ($method_string == 'head') { - $this->request[self::REQUEST_METHOD]['data'] = self::HTTP_METHOD_HEAD; + $this->request[static::REQUEST_METHOD]['data'] = static::HTTP_METHOD_HEAD; } elseif ($method_string == 'post') { - $this->request[self::REQUEST_METHOD]['data'] = self::HTTP_METHOD_POST; + $this->request[static::REQUEST_METHOD]['data'] = static::HTTP_METHOD_POST; } elseif ($method_string == 'put') { - $this->request[self::REQUEST_METHOD]['data'] = self::HTTP_METHOD_PUT; + $this->request[static::REQUEST_METHOD]['data'] = static::HTTP_METHOD_PUT; } elseif ($method_string == 'delete') { - $this->request[self::REQUEST_METHOD]['data'] = self::HTTP_METHOD_DELETE; + $this->request[static::REQUEST_METHOD]['data'] = static::HTTP_METHOD_DELETE; } elseif ($method_string == 'trace') { - $this->request[self::REQUEST_METHOD]['data'] = self::HTTP_METHOD_TRACE; + $this->request[static::REQUEST_METHOD]['data'] = static::HTTP_METHOD_TRACE; } elseif ($method_string == 'options') { - $this->request[self::REQUEST_METHOD]['data'] = self::HTTP_METHOD_OPTIONS; + $this->request[static::REQUEST_METHOD]['data'] = static::HTTP_METHOD_OPTIONS; } elseif ($method_string == 'connect') { - $this->request[self::REQUEST_METHOD]['data'] = self::HTTP_METHOD_CONNECT; + $this->request[static::REQUEST_METHOD]['data'] = static::HTTP_METHOD_CONNECT; } elseif ($method_string == 'patch') { - $this->request[self::REQUEST_METHOD]['data'] = self::HTTP_METHOD_PATCH; + $this->request[static::REQUEST_METHOD]['data'] = static::HTTP_METHOD_PATCH; } elseif ($method_string == 'track') { - $this->request[self::REQUEST_METHOD]['data'] = self::HTTP_METHOD_TRACK; + $this->request[static::REQUEST_METHOD]['data'] = static::HTTP_METHOD_TRACK; } elseif ($method_string == 'debug') { - $this->request[self::REQUEST_METHOD]['data'] = self::HTTP_METHOD_DEBUG; + $this->request[static::REQUEST_METHOD]['data'] = static::HTTP_METHOD_DEBUG; } else { // use 'none' to represent all unknown methods. - $this->request[self::REQUEST_METHOD]['data'] = self::HTTP_METHOD_NONE; + $this->request[static::REQUEST_METHOD]['data'] = static::HTTP_METHOD_NONE; } unset($method_string); - $this->request[self::REQUEST_METHOD]['invalid'] = FALSE; + $this->request[static::REQUEST_METHOD]['invalid'] = FALSE; } /** @@ -6437,7 +6447,7 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_origin() { if (empty($this->headers['origin'])) { - $this->request[self::REQUEST_ORIGIN]['invalid'] = TRUE; + $this->request[static::REQUEST_ORIGIN]['invalid'] = TRUE; return; } @@ -6445,22 +6455,22 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $this->request[self::REQUEST_ORIGIN]['invalid'] = TRUE; + $this->request[static::REQUEST_ORIGIN]['invalid'] = TRUE; return; } - $this->request[self::REQUEST_ORIGIN]['data'] = $this->pr_rfc_string_is_uri($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_ORIGIN]['data'] = $this->pr_rfc_string_is_uri($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_ORIGIN]['data']['invalid']) { - $this->request[self::REQUEST_ORIGIN]['invalid'] = TRUE; + if ($this->request[static::REQUEST_ORIGIN]['data']['invalid']) { + $this->request[static::REQUEST_ORIGIN]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_ORIGIN]['defined'] = TRUE; + $this->request[static::REQUEST_ORIGIN]['defined'] = TRUE; } - unset($this->request[self::REQUEST_ORIGIN]['data']['invalid']); + unset($this->request[static::REQUEST_ORIGIN]['data']['invalid']); - $this->request[self::REQUEST_ORIGIN]['invalid'] = FALSE; + $this->request[static::REQUEST_ORIGIN]['invalid'] = FALSE; } /** @@ -6472,30 +6482,30 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_proxy_authorization() { if (empty($this->headers['proxy-authorization'])) { - $this->request[self::REQUEST_PROXY_AUTHORIZATION]['invalid'] = TRUE; + $this->request[static::REQUEST_PROXY_AUTHORIZATION]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['proxy-authorization']); if ($text['invalid']) { - $this->request[self::REQUEST_PROXY_AUTHORIZATION]['invalid'] = TRUE; + $this->request[static::REQUEST_PROXY_AUTHORIZATION]['invalid'] = TRUE; unset($text); return; } - $this->request[self::REQUEST_PROXY_AUTHORIZATION]['data'] = $this->pr_rfc_string_is_credentials($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_PROXY_AUTHORIZATION]['data'] = $this->pr_rfc_string_is_credentials($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_PROXY_AUTHORIZATION]['data']['invalid']) { - $this->request[self::REQUEST_PROXY_AUTHORIZATION]['invalid'] = TRUE; + if ($this->request[static::REQUEST_PROXY_AUTHORIZATION]['data']['invalid']) { + $this->request[static::REQUEST_PROXY_AUTHORIZATION]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_PROXY_AUTHORIZATION]['defined'] = TRUE; + $this->request[static::REQUEST_PROXY_AUTHORIZATION]['defined'] = TRUE; } - unset($this->request[self::REQUEST_PROXY_AUTHORIZATION]['data']['invalid']); - unset($this->request[self::REQUEST_PROXY_AUTHORIZATION]['data']['current']); + unset($this->request[static::REQUEST_PROXY_AUTHORIZATION]['data']['invalid']); + unset($this->request[static::REQUEST_PROXY_AUTHORIZATION]['data']['current']); - $this->request[self::REQUEST_PROXY_AUTHORIZATION]['invalid'] = FALSE; + $this->request[static::REQUEST_PROXY_AUTHORIZATION]['invalid'] = FALSE; } /** @@ -6505,7 +6515,7 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_referer() { if (empty($this->headers['referer'])) { - $this->request[self::REQUEST_REFERER]['invalid'] = TRUE; + $this->request[static::REQUEST_REFERER]['invalid'] = TRUE; return; } @@ -6513,22 +6523,22 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $this->request[self::REQUEST_REFERER]['invalid'] = TRUE; + $this->request[static::REQUEST_REFERER]['invalid'] = TRUE; return; } - $this->request[self::REQUEST_REFERER]['data'] = $this->pr_rfc_string_is_uri($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_REFERER]['data'] = $this->pr_rfc_string_is_uri($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_REFERER]['data']['invalid']) { - $this->request[self::REQUEST_REFERER]['invalid'] = TRUE; + if ($this->request[static::REQUEST_REFERER]['data']['invalid']) { + $this->request[static::REQUEST_REFERER]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_REFERER]['defined'] = TRUE; + $this->request[static::REQUEST_REFERER]['defined'] = TRUE; } - unset($this->request[self::REQUEST_REFERER]['data']['invalid']); + unset($this->request[static::REQUEST_REFERER]['data']['invalid']); - $this->request[self::REQUEST_REFERER]['invalid'] = FALSE; + $this->request[static::REQUEST_REFERER]['invalid'] = FALSE; } /** @@ -6538,59 +6548,59 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_te() { if (empty($this->headers['te'])) { - $this->request[self::REQUEST_TE]['te'] = TRUE; + $this->request[static::REQUEST_TE]['te'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['te']); if ($text['invalid']) { - $this->request[self::REQUEST_TE]['invalid'] = TRUE; + $this->request[static::REQUEST_TE]['invalid'] = TRUE; unset($text); return; } - $this->request[self::REQUEST_TE]['data'] = $this->pr_rfc_string_is_negotiation($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_TE]['data'] = $this->pr_rfc_string_is_negotiation($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_TE]['data']['invalid']) { - $this->request[self::REQUEST_TE]['invalid'] = TRUE; + if ($this->request[static::REQUEST_TE]['data']['invalid']) { + $this->request[static::REQUEST_TE]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_TE]['defined'] = TRUE; + $this->request[static::REQUEST_TE]['defined'] = TRUE; // convert the known values into integers for improved processing. - foreach ($this->request[self::REQUEST_TE]['data']['choices'] as $weight => &$choice) { + foreach ($this->request[static::REQUEST_TE]['data']['choices'] as $weight => &$choice) { foreach ($choice as $key => &$c) { $lowercase = c_base_utf8::s_lowercase($c['choice'])->get_value_exact(); if ($c['choice'] == 'compress') { - $c['encoding'] = self::ENCODING_COMPRESS; + $c['encoding'] = static::ENCODING_COMPRESS; } elseif ($c['choice'] == 'deflate') { - $c['encoding'] = self::ENCODING_DEFLATE; + $c['encoding'] = static::ENCODING_DEFLATE; } elseif ($c['choice'] == 'gzip') { - $c['encoding'] = self::ENCODING_GZIP; + $c['encoding'] = static::ENCODING_GZIP; } elseif ($c['choice'] == 'bzip') { - $c['encoding'] = self::ENCODING_BZIP; + $c['encoding'] = static::ENCODING_BZIP; } elseif ($c['choice'] == 'lzo') { - $c['encoding'] = self::ENCODING_LZO; + $c['encoding'] = static::ENCODING_LZO; } elseif ($c['choice'] == 'xz') { - $c['encoding'] = self::ENCODING_XZ; + $c['encoding'] = static::ENCODING_XZ; } elseif ($c['choice'] == 'exit') { - $c['encoding'] = self::ENCODING_EXI; + $c['encoding'] = static::ENCODING_EXI; } elseif ($c['choice'] == 'identity') { - $c['encoding'] = self::ENCODING_IDENTITY; + $c['encoding'] = static::ENCODING_IDENTITY; } elseif ($c['choice'] == 'sdch') { - $c['encoding'] = self::ENCODING_SDCH; + $c['encoding'] = static::ENCODING_SDCH; } elseif ($c['choice'] == 'pg') { - $c['encoding'] = self::ENCODING_PG; + $c['encoding'] = static::ENCODING_PG; } else { $c['encoding'] = NULL; @@ -6599,9 +6609,9 @@ class c_base_http extends c_base_rfc_string { } unset($lowercase); } - unset($this->request[self::REQUEST_TE]['data']['invalid']); + unset($this->request[static::REQUEST_TE]['data']['invalid']); - $this->request[self::REQUEST_TE]['invalid'] = FALSE; + $this->request[static::REQUEST_TE]['invalid'] = FALSE; } /** @@ -6611,13 +6621,13 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_user_agent() { if (empty($this->headers['user-agent'])) { - $this->request[self::REQUEST_USER_AGENT]['invalid'] = TRUE; + $this->request[static::REQUEST_USER_AGENT]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['user-agent']); if ($text['invalid']) { - $this->request[self::REQUEST_USER_AGENT]['invalid'] = TRUE; + $this->request[static::REQUEST_USER_AGENT]['invalid'] = TRUE; unset($text); return; } @@ -6627,23 +6637,23 @@ class c_base_http extends c_base_rfc_string { unset($text); if ($agent['invalid']) { - $this->request[self::REQUEST_USER_AGENT]['invalid'] = TRUE; + $this->request[static::REQUEST_USER_AGENT]['invalid'] = TRUE; unset($agent); return; } - $this->request[self::REQUEST_USER_AGENT]['data'] = $this->p_parse_user_agent($agent['text']); + $this->request[static::REQUEST_USER_AGENT]['data'] = $this->p_parse_user_agent($agent['text']); unset($agent); - if ($this->request[self::REQUEST_USER_AGENT]['data']['invalid']) { - $this->request[self::REQUEST_USER_AGENT]['invalid'] = TRUE; + if ($this->request[static::REQUEST_USER_AGENT]['data']['invalid']) { + $this->request[static::REQUEST_USER_AGENT]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_USER_AGENT]['defined'] = TRUE; + $this->request[static::REQUEST_USER_AGENT]['defined'] = TRUE; } - unset($this->request[self::REQUEST_USER_AGENT]['data']['invalid']); + unset($this->request[static::REQUEST_USER_AGENT]['data']['invalid']); - $this->request[self::REQUEST_USER_AGENT]['invalid'] = FALSE; + $this->request[static::REQUEST_USER_AGENT]['invalid'] = FALSE; } /** @@ -6653,30 +6663,30 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_upgrade() { if (empty($this->headers['upgrade'])) { - $this->request[self::REQUEST_UPGRADE]['invalid'] = TRUE; + $this->request[static::REQUEST_UPGRADE]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['upgrade']); if ($text['invalid']) { - $this->request[self::REQUEST_UPGRADE]['invalid'] = TRUE; + $this->request[static::REQUEST_UPGRADE]['invalid'] = TRUE; unset($text); return; } // @todo: future versions may do something with this, until then just check for text. - $this->request[self::REQUEST_UPGRADE]['data'] = $this->pr_rfc_string_is_basic($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_UPGRADE]['data'] = $this->pr_rfc_string_is_basic($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_UPGRADE]['data']['invalid']) { - $this->request[self::REQUEST_UPGRADE]['invalid'] = TRUE; + if ($this->request[static::REQUEST_UPGRADE]['data']['invalid']) { + $this->request[static::REQUEST_UPGRADE]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_UPGRADE]['defined'] = TRUE; + $this->request[static::REQUEST_UPGRADE]['defined'] = TRUE; } - unset($this->request[self::REQUEST_UPGRADE]['data']['invalid']); + unset($this->request[static::REQUEST_UPGRADE]['data']['invalid']); - $this->request[self::REQUEST_UPGRADE]['invalid'] = FALSE; + $this->request[static::REQUEST_UPGRADE]['invalid'] = FALSE; } /** @@ -6686,7 +6696,7 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_uri() { if (empty($this->headers['uri'])) { - $this->request[self::REQUEST_URI]['invalid'] = TRUE; + $this->request[static::REQUEST_URI]['invalid'] = TRUE; return; } @@ -6706,24 +6716,24 @@ class c_base_http extends c_base_rfc_string { unset($uri); if ($text['invalid']) { - $this->request[self::REQUEST_URI]['invalid'] = TRUE; + $this->request[static::REQUEST_URI]['invalid'] = TRUE; unset($text); return; } - $this->request[self::REQUEST_URI]['data'] = $this->pr_rfc_string_is_uri($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_URI]['data'] = $this->pr_rfc_string_is_uri($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_URI]['data']['invalid']) { - $this->request[self::REQUEST_URI]['invalid'] = TRUE; + if ($this->request[static::REQUEST_URI]['data']['invalid']) { + $this->request[static::REQUEST_URI]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_URI]['defined'] = TRUE; + $this->request[static::REQUEST_URI]['defined'] = TRUE; } - unset($this->request[self::REQUEST_URI]['data']['invalid']); - unset($this->request[self::REQUEST_URI]['data']['current']); + unset($this->request[static::REQUEST_URI]['data']['invalid']); + unset($this->request[static::REQUEST_URI]['data']['current']); - $this->request[self::REQUEST_URI]['invalid'] = FALSE; + $this->request[static::REQUEST_URI]['invalid'] = FALSE; } /** @@ -6733,30 +6743,30 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_via() { if (empty($this->headers['via'])) { - $this->request[self::REQUEST_VIA]['invalid'] = TRUE; + $this->request[static::REQUEST_VIA]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['via']); if ($text['invalid']) { - $this->request[self::REQUEST_VIA]['invalid'] = TRUE; + $this->request[static::REQUEST_VIA]['invalid'] = TRUE; unset($text); return; } // @todo: future versions may do something with this, until then just check for text. - $this->request[self::REQUEST_VIA]['data'] = $this->pr_rfc_string_is_basic($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_VIA]['data'] = $this->pr_rfc_string_is_basic($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_VIA]['data']['invalid']) { - $this->request[self::REQUEST_VIA]['invalid'] = TRUE; + if ($this->request[static::REQUEST_VIA]['data']['invalid']) { + $this->request[static::REQUEST_VIA]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_VIA]['defined'] = TRUE; + $this->request[static::REQUEST_VIA]['defined'] = TRUE; } - unset($this->request[self::REQUEST_VIA]['data']['invalid']); + unset($this->request[static::REQUEST_VIA]['data']['invalid']); - $this->request[self::REQUEST_VIA]['invalid'] = FALSE; + $this->request[static::REQUEST_VIA]['invalid'] = FALSE; } /** @@ -6766,30 +6776,30 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_warning() { if (empty($this->headers['warning'])) { - $this->request[self::REQUEST_WARNING]['invalid'] = TRUE; + $this->request[static::REQUEST_WARNING]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['warning']); if ($text['invalid']) { - $this->request[self::REQUEST_WARNING]['invalid'] = TRUE; + $this->request[static::REQUEST_WARNING]['invalid'] = TRUE; unset($text); return; } // @todo: future versions may do something with this, until then just check for text. - $this->request[self::REQUEST_WARNING]['data'] = $this->pr_rfc_string_is_basic($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_WARNING]['data'] = $this->pr_rfc_string_is_basic($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_WARNING]['data']['invalid']) { - $this->request[self::REQUEST_WARNING]['invalid'] = TRUE; + if ($this->request[static::REQUEST_WARNING]['data']['invalid']) { + $this->request[static::REQUEST_WARNING]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_WARNING]['defined'] = TRUE; + $this->request[static::REQUEST_WARNING]['defined'] = TRUE; } - unset($this->request[self::REQUEST_WARNING]['data']['invalid']); + unset($this->request[static::REQUEST_WARNING]['data']['invalid']); - $this->request[self::REQUEST_WARNING]['invalid'] = FALSE; + $this->request[static::REQUEST_WARNING]['invalid'] = FALSE; } /** @@ -6801,29 +6811,29 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_x_requested_with() { if (empty($this->headers['x-requested-with'])) { - $this->request[self::REQUEST_X_REQUESTED_WITH]['invalid'] = TRUE; + $this->request[static::REQUEST_X_REQUESTED_WITH]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['x-requested-with']); if ($text['invalid']) { - $this->request[self::REQUEST_X_REQUESTED_WITH]['invalid'] = TRUE; + $this->request[static::REQUEST_X_REQUESTED_WITH]['invalid'] = TRUE; unset($text); return; } - $this->request[self::REQUEST_X_REQUESTED_WITH]['data'] = $this->pr_rfc_string_is_token($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_X_REQUESTED_WITH]['data'] = $this->pr_rfc_string_is_token($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_X_REQUESTED_WITH]['data']['invalid']) { - $this->request[self::REQUEST_X_REQUESTED_WITH]['invalid'] = TRUE; + if ($this->request[static::REQUEST_X_REQUESTED_WITH]['data']['invalid']) { + $this->request[static::REQUEST_X_REQUESTED_WITH]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_X_REQUESTED_WITH]['defined'] = TRUE; + $this->request[static::REQUEST_X_REQUESTED_WITH]['defined'] = TRUE; } - unset($this->request[self::REQUEST_X_REQUESTED_WITH]['data']['invalid']); + unset($this->request[static::REQUEST_X_REQUESTED_WITH]['data']['invalid']); - $this->request[self::REQUEST_X_REQUESTED_WITH]['invalid'] = FALSE; + $this->request[static::REQUEST_X_REQUESTED_WITH]['invalid'] = FALSE; } /** @@ -6836,30 +6846,30 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_x_requested_for() { if (empty($this->headers['x-requested-for'])) { - $this->request[self::REQUEST_X_REQUESTED_FOR]['invalid'] = TRUE; + $this->request[static::REQUEST_X_REQUESTED_FOR]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['x-requested-for']); if ($text['invalid']) { - $this->request[self::REQUEST_X_REQUESTED_FOR]['invalid'] = TRUE; + $this->request[static::REQUEST_X_REQUESTED_FOR]['invalid'] = TRUE; unset($text); return; } - $this->request[self::REQUEST_X_REQUESTED_HOST]['data'] = $this->pr_rfc_string_is_token($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_X_REQUESTED_HOST]['data'] = $this->pr_rfc_string_is_token($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_X_REQUESTED_HOST]['data']['invalid']) { - $this->request[self::REQUEST_X_REQUESTED_HOST]['invalid'] = TRUE; + if ($this->request[static::REQUEST_X_REQUESTED_HOST]['data']['invalid']) { + $this->request[static::REQUEST_X_REQUESTED_HOST]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_X_REQUESTED_HOST]['defined'] = TRUE; + $this->request[static::REQUEST_X_REQUESTED_HOST]['defined'] = TRUE; } - unset($this->request[self::REQUEST_X_REQUESTED_HOST]['data']['invalid']); - unset($this->request[self::REQUEST_X_REQUESTED_HOST]['data']['uri']); + unset($this->request[static::REQUEST_X_REQUESTED_HOST]['data']['invalid']); + unset($this->request[static::REQUEST_X_REQUESTED_HOST]['data']['uri']); - $this->request[self::REQUEST_X_REQUESTED_HOST]['invalid'] = FALSE; + $this->request[static::REQUEST_X_REQUESTED_HOST]['invalid'] = FALSE; } /** @@ -6871,30 +6881,30 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_x_requested_host() { if (empty($this->headers['x-requested-host'])) { - $this->request[self::REQUEST_X_REQUESTED_HOST]['invalid'] = TRUE; + $this->request[static::REQUEST_X_REQUESTED_HOST]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['x-requested-host']); if ($text['invalid']) { - $this->request[self::REQUEST_X_REQUESTED_HOST]['invalid'] = TRUE; + $this->request[static::REQUEST_X_REQUESTED_HOST]['invalid'] = TRUE; unset($text); return; } - $this->request[self::REQUEST_X_REQUESTED_HOST]['data'] = $this->pr_rfc_string_is_uri($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_X_REQUESTED_HOST]['data'] = $this->pr_rfc_string_is_uri($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_X_REQUESTED_HOST]['data']['invalid'] || $this->request[self::REQUEST_X_REQUESTED_HOST]['data']['uri'] === FALSE) { - $this->request[self::REQUEST_X_REQUESTED_HOST]['invalid'] = TRUE; + if ($this->request[static::REQUEST_X_REQUESTED_HOST]['data']['invalid'] || $this->request[static::REQUEST_X_REQUESTED_HOST]['data']['uri'] === FALSE) { + $this->request[static::REQUEST_X_REQUESTED_HOST]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_X_REQUESTED_HOST]['defined'] = TRUE; + $this->request[static::REQUEST_X_REQUESTED_HOST]['defined'] = TRUE; } - unset($this->request[self::REQUEST_X_REQUESTED_HOST]['data']['invalid']); - unset($this->request[self::REQUEST_X_REQUESTED_HOST]['data']['uri']); + unset($this->request[static::REQUEST_X_REQUESTED_HOST]['data']['invalid']); + unset($this->request[static::REQUEST_X_REQUESTED_HOST]['data']['uri']); - $this->request[self::REQUEST_X_REQUESTED_HOST]['invalid'] = FALSE; + $this->request[static::REQUEST_X_REQUESTED_HOST]['invalid'] = FALSE; } /** @@ -6906,29 +6916,29 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_x_requested_proto() { if (empty($this->headers['x-requested-proto'])) { - $this->request[self::REQUEST_X_REQUESTED_PROTO]['invalid'] = TRUE; + $this->request[static::REQUEST_X_REQUESTED_PROTO]['invalid'] = TRUE; return; } $text = $this->pr_rfc_string_prepare($this->headers['x-requested-proto']); if ($text['invalid']) { - $this->request[self::REQUEST_X_REQUESTED_PROTO]['invalid'] = TRUE; + $this->request[static::REQUEST_X_REQUESTED_PROTO]['invalid'] = TRUE; unset($text); return; } - $this->request[self::REQUEST_X_REQUESTED_PROTO]['data'] = $this->pr_rfc_string_is_token($text['ordinals'], $text['characters']); + $this->request[static::REQUEST_X_REQUESTED_PROTO]['data'] = $this->pr_rfc_string_is_token($text['ordinals'], $text['characters']); unset($text); - if ($this->request[self::REQUEST_X_REQUESTED_PROTO]['data']['invalid']) { - $this->request[self::REQUEST_X_REQUESTED_PROTO]['invalid'] = TRUE; + if ($this->request[static::REQUEST_X_REQUESTED_PROTO]['data']['invalid']) { + $this->request[static::REQUEST_X_REQUESTED_PROTO]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_X_REQUESTED_PROTO]['defined'] = TRUE; + $this->request[static::REQUEST_X_REQUESTED_PROTO]['defined'] = TRUE; } - unset($this->request[self::REQUEST_X_REQUESTED_PROTO]['data']['invalid']); + unset($this->request[static::REQUEST_X_REQUESTED_PROTO]['data']['invalid']); - $this->request[self::REQUEST_X_REQUESTED_PROTO]['invalid'] = FALSE; + $this->request[static::REQUEST_X_REQUESTED_PROTO]['invalid'] = FALSE; } /** @@ -6951,21 +6961,21 @@ class c_base_http extends c_base_rfc_string { private function p_load_request_checksum_header() { // this requires checksum_headers to be defined. if (empty($this->headers['checksum_header'])) { - $this->request[self::REQUEST_CHECKSUM_HEADER]['invalid'] = TRUE; + $this->request[static::REQUEST_CHECKSUM_HEADER]['invalid'] = TRUE; return; } - $this->request[self::REQUEST_CHECKSUM_HEADER]['data'] = $this->p_parse_checksum($this->headers['checksum_header']); + $this->request[static::REQUEST_CHECKSUM_HEADER]['data'] = $this->p_parse_checksum($this->headers['checksum_header']); - if ($this->request[self::REQUEST_CHECKSUM_HEADER]['data']['invalid']) { - $this->request[self::REQUEST_CHECKSUM_HEADER]['invalid'] = TRUE; + if ($this->request[static::REQUEST_CHECKSUM_HEADER]['data']['invalid']) { + $this->request[static::REQUEST_CHECKSUM_HEADER]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_CHECKSUM_HEADER]['defined'] = TRUE; + $this->request[static::REQUEST_CHECKSUM_HEADER]['defined'] = TRUE; } - unset($this->request[self::REQUEST_CHECKSUM_HEADER]['data']['invalid']); + unset($this->request[static::REQUEST_CHECKSUM_HEADER]['data']['invalid']); - $this->request[self::REQUEST_CHECKSUM_HEADER]['invalid'] = FALSE; + $this->request[static::REQUEST_CHECKSUM_HEADER]['invalid'] = FALSE; } /** @@ -6983,21 +6993,21 @@ class c_base_http extends c_base_rfc_string { private function p_load_request_checksum_headers() { // this requires checksum_header to be defined. if (empty($this->headers['checksum_headers'])) { - $this->request[self::REQUEST_CHECKSUM_HEADERS]['invalid'] = TRUE; + $this->request[static::REQUEST_CHECKSUM_HEADERS]['invalid'] = TRUE; return; } - $this->request[self::REQUEST_CHECKSUM_HEADERS]['data'] = $this->p_parse_checksum_headers($this->headers['checksum_headers']); + $this->request[static::REQUEST_CHECKSUM_HEADERS]['data'] = $this->p_parse_checksum_headers($this->headers['checksum_headers']); - if ($this->request[self::REQUEST_CHECKSUM_HEADERS]['data']['invalid']) { - $this->request[self::REQUEST_CHECKSUM_HEADERS]['invalid'] = TRUE; + if ($this->request[static::REQUEST_CHECKSUM_HEADERS]['data']['invalid']) { + $this->request[static::REQUEST_CHECKSUM_HEADERS]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_CHECKSUM_HEADERS]['defined'] = TRUE; + $this->request[static::REQUEST_CHECKSUM_HEADERS]['defined'] = TRUE; } - unset($this->request[self::REQUEST_CHECKSUM_HEADERS]['data']['invalid']); + unset($this->request[static::REQUEST_CHECKSUM_HEADERS]['data']['invalid']); - $this->request[self::REQUEST_CHECKSUM_HEADERS]['invalid'] = FALSE; + $this->request[static::REQUEST_CHECKSUM_HEADERS]['invalid'] = FALSE; } /** @@ -7019,21 +7029,21 @@ class c_base_http extends c_base_rfc_string { */ private function p_load_request_checksum_content() { if (empty($this->headers['checksum_content'])) { - $this->request[self::REQUEST_CHECKSUM_CONTENT]['invalid'] = TRUE; + $this->request[static::REQUEST_CHECKSUM_CONTENT]['invalid'] = TRUE; return; } - $this->request[self::REQUEST_CHECKSUM_CONTENT]['data'] = $this->p_parse_checksum($this->headers['checksum_content']); + $this->request[static::REQUEST_CHECKSUM_CONTENT]['data'] = $this->p_parse_checksum($this->headers['checksum_content']); - if ($this->request[self::REQUEST_CHECKSUM_CONTENT]['data']['invalid']) { - $this->request[self::REQUEST_CHECKSUM_CONTENT]['invalid'] = TRUE; + if ($this->request[static::REQUEST_CHECKSUM_CONTENT]['data']['invalid']) { + $this->request[static::REQUEST_CHECKSUM_CONTENT]['invalid'] = TRUE; } else { - $this->request[self::REQUEST_CHECKSUM_CONTENT]['defined'] = TRUE; + $this->request[static::REQUEST_CHECKSUM_CONTENT]['defined'] = TRUE; } - unset($this->request[self::REQUEST_CHECKSUM_CONTENT]['data']['invalid']); + unset($this->request[static::REQUEST_CHECKSUM_CONTENT]['data']['invalid']); - $this->request[self::REQUEST_CHECKSUM_CONTENT]['invalid'] = FALSE; + $this->request[static::REQUEST_CHECKSUM_CONTENT]['invalid'] = FALSE; } /** @@ -7123,7 +7133,7 @@ class c_base_http extends c_base_rfc_string { $raw = c_base_utf8::s_lowercase(preg_replace('/(^\s+)|(\s+$)/us', '', $original))->get_value_exact(); // rfc5322 is the preferred/recommended format. - $rfc5322 = c_base_utf8::s_lowercase(preg_replace('/(^\s+)|(\s+$)/us', '', c_base_defaults_global::s_get_date(self::TIMESTAMP_RFC_5322, $timestamp)->get_value_exact()))->get_value_exact(); + $rfc5322 = c_base_utf8::s_lowercase(preg_replace('/(^\s+)|(\s+$)/us', '', c_base_defaults_global::s_get_date(static::TIMESTAMP_RFC_5322, $timestamp)->get_value_exact()))->get_value_exact(); if ($raw == $rfc5322) { unset($raw); unset($timestamp); @@ -7132,7 +7142,7 @@ class c_base_http extends c_base_rfc_string { } unset($rfc5322); - $rfc1123 = c_base_utf8::s_lowercase(preg_replace('/(^\s+)|(\s+$)/us', '', c_base_defaults_global::s_get_date(self::TIMESTAMP_RFC_1123, $timestamp)->get_value_exact()))->get_value_exact(); + $rfc1123 = c_base_utf8::s_lowercase(preg_replace('/(^\s+)|(\s+$)/us', '', c_base_defaults_global::s_get_date(static::TIMESTAMP_RFC_1123, $timestamp)->get_value_exact()))->get_value_exact(); if ($raw == $rfc1123) { unset($raw); unset($timestamp); @@ -7141,7 +7151,7 @@ class c_base_http extends c_base_rfc_string { } unset($rfc1123); - $rfc850 = c_base_utf8::s_lowercase(preg_replace('/(^\s+)|(\s+$)/us', '', c_base_defaults_global::s_get_date(self::TIMESTAMP_RFC_850, $timestamp)->get_value_exact()))->get_value_exact(); + $rfc850 = c_base_utf8::s_lowercase(preg_replace('/(^\s+)|(\s+$)/us', '', c_base_defaults_global::s_get_date(static::TIMESTAMP_RFC_850, $timestamp)->get_value_exact()))->get_value_exact(); if ($raw == $rfc850) { unset($raw); unset($timestamp); @@ -7166,7 +7176,7 @@ class c_base_http extends c_base_rfc_string { * The priority to be returned. */ private function p_process_accept_parts_sub($super, &$value, &$priority) { - $parts_sub = mb_split(self::DELIMITER_ACCEPT_SUB, $super); + $parts_sub = mb_split(static::DELIMITER_ACCEPT_SUB, $super); $part_sub_value = c_base_utf8::s_lowercase(preg_replace('/(^\s+)|(\s+$)/us', '', $parts_sub[0]))->get_value_exact(); $part_sub_priority = NULL; @@ -7175,7 +7185,7 @@ class c_base_http extends c_base_rfc_string { } if (self::p_length_string($part_sub_value) > 2) { - if ($part_sub_value[0] == self::DELIMITER_ACCEPT_SUB_0 && $part_sub_value[1] == self::DELIMITER_ACCEPT_SUB_1) { + if ($part_sub_value[0] == static::DELIMITER_ACCEPT_SUB_0 && $part_sub_value[1] == static::DELIMITER_ACCEPT_SUB_1) { $value = $part_sub_priority; $parts_sub_priority = $part_sub_value; } @@ -7186,7 +7196,7 @@ class c_base_http extends c_base_rfc_string { unset($part_sub_value); if (!is_null($part_sub_priority) && self::p_length_string($part_sub_priority) > 2 && $part_sub_priority == 'q' && $part_sub_priority == '=') { - $part = preg_replace('/(^\s+)|(\s+$)/us', '', str_replace(self::DELIMITER_ACCEPT_SUB_0 . self::DELIMITER_ACCEPT_SUB_1, '', $part_sub_priority)); + $part = preg_replace('/(^\s+)|(\s+$)/us', '', str_replace(static::DELIMITER_ACCEPT_SUB_0 . static::DELIMITER_ACCEPT_SUB_1, '', $part_sub_priority)); if (is_numeric($part)) { $priority = sprintf('%.1f', (float) $part); @@ -7258,7 +7268,7 @@ class c_base_http extends c_base_rfc_string { } while ($current < $stop) { - $parsed = $this->pr_rfc_string_is_quoted_string($text['ordinals'], $text['characters'], $current, self::STOP_AT_CLOSING_CHARACTER); + $parsed = $this->pr_rfc_string_is_quoted_string($text['ordinals'], $text['characters'], $current, static::STOP_AT_CLOSING_CHARACTER); $current = $parsed['current']; if ($parsed['invalid']) { @@ -7996,10 +8006,10 @@ class c_base_http extends c_base_rfc_string { } if ($parsed['text'] == 'partial') { - $result['what'] = self::CHECKSUM_WHAT_FULL; + $result['what'] = static::CHECKSUM_WHAT_FULL; } elseif ($parsed['text'] == 'complete') { - $result['what'] = self::CHECKSUM_WHAT_COMPLETE; + $result['what'] = static::CHECKSUM_WHAT_COMPLETE; } else { $result['invalid'] = TRUE; @@ -8030,34 +8040,34 @@ class c_base_http extends c_base_rfc_string { } if ($parsed['text'] == 'md2') { - $result['type'] = self::CHECKSUM_MD2; + $result['type'] = static::CHECKSUM_MD2; } elseif ($parsed['text'] == 'md4') { - $result['type'] = self::CHECKSUM_MD4; + $result['type'] = static::CHECKSUM_MD4; } elseif ($parsed['text'] == 'md5') { - $result['type'] = self::CHECKSUM_MD5; + $result['type'] = static::CHECKSUM_MD5; } elseif ($parsed['text'] == 'sha1') { - $result['type'] = self::CHECKSUM_SHA1; + $result['type'] = static::CHECKSUM_SHA1; } elseif ($parsed['text'] == 'sha224') { - $result['type'] = self::CHECKSUM_SHA224; + $result['type'] = static::CHECKSUM_SHA224; } elseif ($parsed['text'] == 'sha256') { - $result['type'] = self::CHECKSUM_SHA256; + $result['type'] = static::CHECKSUM_SHA256; } elseif ($parsed['text'] == 'sha384') { - $result['type'] = self::CHECKSUM_SHA384; + $result['type'] = static::CHECKSUM_SHA384; } elseif ($parsed['text'] == 'sha512') { - $result['type'] = self::CHECKSUM_SHA512; + $result['type'] = static::CHECKSUM_SHA512; } elseif ($parsed['text'] == 'crc32') { - $result['type'] = self::CHECKSUM_CRC32; + $result['type'] = static::CHECKSUM_CRC32; } elseif ($parsed['text'] == 'crc32b') { - $result['type'] = self::CHECKSUM_CRC32B; + $result['type'] = static::CHECKSUM_CRC32B; } else { $result['invalid'] = TRUE; @@ -8280,46 +8290,46 @@ class c_base_http extends c_base_rfc_string { */ private function p_get_header_request_mapping() { return array( - 'accept' => self::REQUEST_ACCEPT, - 'accept-charset' => self::REQUEST_ACCEPT_CHARSET, - 'accept-encoding' => self::REQUEST_ACCEPT_ENCODING, - 'accept-language' => self::REQUEST_ACCEPT_LANGUAGE, - 'accept-datetime' => self::REQUEST_ACCEPT_DATETIME, - 'access-control-request-method' => self::REQUEST_ACCESS_CONTROL_REQUEST_METHOD, - 'access-control-request-headers' => self::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS, - 'authorization' => self::REQUEST_AUTHORIZATION, - 'cache-control' => self::REQUEST_CACHE_CONTROL, - 'connection' => self::REQUEST_CONNECTION, - 'cookie' => self::REQUEST_COOKIE, - 'content-length' => self::REQUEST_CONTENT_LENGTH, - 'content-type' => self::REQUEST_CONTENT_TYPE, - 'date' => self::REQUEST_DATE, - 'expect' => self::REQUEST_EXPECT, - 'from' => self::REQUEST_FROM, - 'host' => self::REQUEST_HOST, - 'if-match' => self::REQUEST_IF_MATCH, - 'if-modified-since' => self::REQUEST_IF_MODIFIED_SINCE, - 'if-none-match' => self::REQUEST_IF_NONE_MATCH, - 'if-range' => self::REQUEST_IF_RANGE, - 'if-unmodified-since' => self::REQUEST_IF_UNMODIFIED_SINCE, - 'max-forwards' => self::REQUEST_MAX_FORWARDS, - 'origin' => self::REQUEST_ORIGIN, - 'pragma' => self::REQUEST_PRAGMA, - 'proxy-authorization' => self::REQUEST_PROXY_AUTHORIZATION, - 'request-range' => self::REQUEST_RANGE, - 'referer' => self::REQUEST_REFERER, - 'te' => self::REQUEST_TE, - 'user-agent' => self::REQUEST_USER_AGENT, - 'upgrade' => self::REQUEST_UPGRADE, - 'via' => self::REQUEST_VIA, - 'warning' => self::REQUEST_WARNING, - 'x-requested-with' => self::REQUEST_X_REQUESTED_WITH, - 'x-forwarded-for' => self::REQUEST_X_FORWARDED_FOR, - 'x-forwarded-host' => self::REQUEST_X_FORWARDED_HOST, - 'x-forwarded-proto' => self::REQUEST_X_FORWARDED_PROTO, - 'checksum_header' => self::REQUEST_CHECKSUM_HEADER, - 'checksum_headers' => self::REQUEST_CHECKSUM_HEADERS, - 'checksum_content' => self::REQUEST_CHECKSUM_CONTENT, + 'accept' => static::REQUEST_ACCEPT, + 'accept-charset' => static::REQUEST_ACCEPT_CHARSET, + 'accept-encoding' => static::REQUEST_ACCEPT_ENCODING, + 'accept-language' => static::REQUEST_ACCEPT_LANGUAGE, + 'accept-datetime' => static::REQUEST_ACCEPT_DATETIME, + 'access-control-request-method' => static::REQUEST_ACCESS_CONTROL_REQUEST_METHOD, + 'access-control-request-headers' => static::REQUEST_ACCESS_CONTROL_REQUEST_HEADERS, + 'authorization' => static::REQUEST_AUTHORIZATION, + 'cache-control' => static::REQUEST_CACHE_CONTROL, + 'connection' => static::REQUEST_CONNECTION, + 'cookie' => static::REQUEST_COOKIE, + 'content-length' => static::REQUEST_CONTENT_LENGTH, + 'content-type' => static::REQUEST_CONTENT_TYPE, + 'date' => static::REQUEST_DATE, + 'expect' => static::REQUEST_EXPECT, + 'from' => static::REQUEST_FROM, + 'host' => static::REQUEST_HOST, + 'if-match' => static::REQUEST_IF_MATCH, + 'if-modified-since' => static::REQUEST_IF_MODIFIED_SINCE, + 'if-none-match' => static::REQUEST_IF_NONE_MATCH, + 'if-range' => static::REQUEST_IF_RANGE, + 'if-unmodified-since' => static::REQUEST_IF_UNMODIFIED_SINCE, + 'max-forwards' => static::REQUEST_MAX_FORWARDS, + 'origin' => static::REQUEST_ORIGIN, + 'pragma' => static::REQUEST_PRAGMA, + 'proxy-authorization' => static::REQUEST_PROXY_AUTHORIZATION, + 'request-range' => static::REQUEST_RANGE, + 'referer' => static::REQUEST_REFERER, + 'te' => static::REQUEST_TE, + 'user-agent' => static::REQUEST_USER_AGENT, + 'upgrade' => static::REQUEST_UPGRADE, + 'via' => static::REQUEST_VIA, + 'warning' => static::REQUEST_WARNING, + 'x-requested-with' => static::REQUEST_X_REQUESTED_WITH, + 'x-forwarded-for' => static::REQUEST_X_FORWARDED_FOR, + 'x-forwarded-host' => static::REQUEST_X_FORWARDED_HOST, + 'x-forwarded-proto' => static::REQUEST_X_FORWARDED_PROTO, + 'checksum_header' => static::REQUEST_CHECKSUM_HEADER, + 'checksum_headers' => static::REQUEST_CHECKSUM_HEADERS, + 'checksum_content' => static::REQUEST_CHECKSUM_CONTENT, ); } @@ -8339,106 +8349,106 @@ class c_base_http extends c_base_rfc_string { private function p_get_header_response_mapping($case_first = FALSE) { if ($case_first) { return array( - self::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN => 'Access-Control-Allow-Origin', - self::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS => 'Access-Control-Allow-Credentials', - self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS => 'Access-Control-Expose-Headers', - self::RESPONSE_ACCESS_CONTROL_MAX_AGE => 'Access-Control-Max-Age', - self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS => 'Access-Control-Allow-Methods', - self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS => 'Access-Control-Allow-Headers', - self::RESPONSE_ACCEPT_PATCH => 'Accept-Patch', - self::RESPONSE_ACCEPT_RANGES => 'Accept-Ranges', - self::RESPONSE_AGE => 'Age', - self::RESPONSE_ALLOW => 'Allow', - self::RESPONSE_CACHE_CONTROL => 'Cache-Control', - self::RESPONSE_CHECKSUM_CONTENT => 'Checksum_Content', - self::RESPONSE_CHECKSUM_HEADER => 'Checksum_Header', - self::RESPONSE_CHECKSUM_HEADERS => 'Checksum_Headers', - self::RESPONSE_CONNECTION => 'Connection', - self::RESPONSE_CONTENT_DISPOSITION => 'Content-Disposition', - self::RESPONSE_CONTENT_ENCODING => 'Content-Encoding', - self::RESPONSE_CONTENT_LANGUAGE => 'Content-Language', - self::RESPONSE_CONTENT_LENGTH => 'Content-Length', - self::RESPONSE_CONTENT_LOCATION => 'Content-Location', - self::RESPONSE_CONTENT_RANGE => 'Content-Range', - self::RESPONSE_CONTENT_REVISION => 'Content_Revision', - self::RESPONSE_CONTENT_SECURITY_POLICY => 'Content-Security-Policy', - self::RESPONSE_CONTENT_TYPE => 'Content-Type', - self::RESPONSE_DATE => 'Date', - self::RESPONSE_DATE_ACTUAL => 'Date_Actual', - self::RESPONSE_ETAG => 'Etag', - self::RESPONSE_EXPIRES => 'Expires', - self::RESPONSE_LAST_MODIFIED => 'Last-Modified', - self::RESPONSE_LINK => 'Link', - self::RESPONSE_LOCATION => 'Location', - self::RESPONSE_PRAGMA => 'Pragma', - self::RESPONSE_PROXY_AUTHENTICATE => 'Proxy-Authenticate', - self::RESPONSE_PUBLIC_KEY_PINS => 'Public-Key-Pins', - self::RESPONSE_REFRESH => 'Refresh', - self::RESPONSE_RETRY_AFTER => 'Retry-After', - self::RESPONSE_SERVER => 'Server', - self::RESPONSE_SET_COOKIE => 'Set-Cookie', - self::RESPONSE_STATUS => 'Status', - self::RESPONSE_STRICT_TRANSPORT_SECURITY => 'Strict-Transport-Security', - self::RESPONSE_TRAILER => 'Trailer', - self::RESPONSE_TRANSFER_ENCODING => 'Transfer-Encoding', - self::RESPONSE_UPGRADE => 'Upgrade', - self::RESPONSE_VARY => 'Vary', - self::RESPONSE_WARNING => 'Warning', - self::RESPONSE_WWW_AUTHENTICATE => 'Www-Authenticate', - self::RESPONSE_X_CONTENT_TYPE_OPTIONS => 'X-Content-Type-Options', - self::RESPONSE_X_UA_COMPATIBLE => 'X-UA-Compatible', + static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN => 'Access-Control-Allow-Origin', + static::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS => 'Access-Control-Allow-Credentials', + static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS => 'Access-Control-Expose-Headers', + static::RESPONSE_ACCESS_CONTROL_MAX_AGE => 'Access-Control-Max-Age', + static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS => 'Access-Control-Allow-Methods', + static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS => 'Access-Control-Allow-Headers', + static::RESPONSE_ACCEPT_PATCH => 'Accept-Patch', + static::RESPONSE_ACCEPT_RANGES => 'Accept-Ranges', + static::RESPONSE_AGE => 'Age', + static::RESPONSE_ALLOW => 'Allow', + static::RESPONSE_CACHE_CONTROL => 'Cache-Control', + static::RESPONSE_CHECKSUM_CONTENT => 'Checksum_Content', + static::RESPONSE_CHECKSUM_HEADER => 'Checksum_Header', + static::RESPONSE_CHECKSUM_HEADERS => 'Checksum_Headers', + static::RESPONSE_CONNECTION => 'Connection', + static::RESPONSE_CONTENT_DISPOSITION => 'Content-Disposition', + static::RESPONSE_CONTENT_ENCODING => 'Content-Encoding', + static::RESPONSE_CONTENT_LANGUAGE => 'Content-Language', + static::RESPONSE_CONTENT_LENGTH => 'Content-Length', + static::RESPONSE_CONTENT_LOCATION => 'Content-Location', + static::RESPONSE_CONTENT_RANGE => 'Content-Range', + static::RESPONSE_CONTENT_REVISION => 'Content_Revision', + static::RESPONSE_CONTENT_SECURITY_POLICY => 'Content-Security-Policy', + static::RESPONSE_CONTENT_TYPE => 'Content-Type', + static::RESPONSE_DATE => 'Date', + static::RESPONSE_DATE_ACTUAL => 'Date_Actual', + static::RESPONSE_ETAG => 'Etag', + static::RESPONSE_EXPIRES => 'Expires', + static::RESPONSE_LAST_MODIFIED => 'Last-Modified', + static::RESPONSE_LINK => 'Link', + static::RESPONSE_LOCATION => 'Location', + static::RESPONSE_PRAGMA => 'Pragma', + static::RESPONSE_PROXY_AUTHENTICATE => 'Proxy-Authenticate', + static::RESPONSE_PUBLIC_KEY_PINS => 'Public-Key-Pins', + static::RESPONSE_REFRESH => 'Refresh', + static::RESPONSE_RETRY_AFTER => 'Retry-After', + static::RESPONSE_SERVER => 'Server', + static::RESPONSE_SET_COOKIE => 'Set-Cookie', + static::RESPONSE_STATUS => 'Status', + static::RESPONSE_STRICT_TRANSPORT_SECURITY => 'Strict-Transport-Security', + static::RESPONSE_TRAILER => 'Trailer', + static::RESPONSE_TRANSFER_ENCODING => 'Transfer-Encoding', + static::RESPONSE_UPGRADE => 'Upgrade', + static::RESPONSE_VARY => 'Vary', + static::RESPONSE_WARNING => 'Warning', + static::RESPONSE_WWW_AUTHENTICATE => 'Www-Authenticate', + static::RESPONSE_X_CONTENT_TYPE_OPTIONS => 'X-Content-Type-Options', + static::RESPONSE_X_UA_COMPATIBLE => 'X-UA-Compatible', ); } return array( - self::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN => 'access-control-allow-origin', - self::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS => 'access-control-allow-credentials', - self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS => 'access-control-expose-headers', - self::RESPONSE_ACCESS_CONTROL_MAX_AGE => 'access-control-max-age', - self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS => 'access-control-allow-methods', - self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS => 'access-control-allow-headers', - self::RESPONSE_ACCEPT_PATCH => 'accept-patch', - self::RESPONSE_ACCEPT_RANGES => 'accept-ranges', - self::RESPONSE_AGE => 'age', - self::RESPONSE_ALLOW => 'allow', - self::RESPONSE_CACHE_CONTROL => 'cache-control', - self::RESPONSE_CHECKSUM_CONTENT => 'checksum_content', - self::RESPONSE_CHECKSUM_HEADER => 'checksum_header', - self::RESPONSE_CHECKSUM_HEADERS => 'checksum_headers', - self::RESPONSE_CONNECTION => 'connection', - self::RESPONSE_CONTENT_DISPOSITION => 'content-disposition', - self::RESPONSE_CONTENT_ENCODING => 'content-encoding', - self::RESPONSE_CONTENT_LANGUAGE => 'content-language', - self::RESPONSE_CONTENT_LENGTH => 'content-length', - self::RESPONSE_CONTENT_LOCATION => 'content-location', - self::RESPONSE_CONTENT_RANGE => 'content-range', - self::RESPONSE_CONTENT_REVISION => 'content_revision', - self::RESPONSE_CONTENT_SECURITY_POLICY => 'x-content-security-policy', - self::RESPONSE_CONTENT_TYPE => 'content-type', - self::RESPONSE_DATE => 'date', - self::RESPONSE_DATE_ACTUAL => 'date_actual', - self::RESPONSE_ETAG => 'etag', - self::RESPONSE_EXPIRES => 'expires', - self::RESPONSE_LAST_MODIFIED => 'last-modified', - self::RESPONSE_LINK => 'link', - self::RESPONSE_LOCATION => 'location', - self::RESPONSE_PRAGMA => 'pragma', - self::RESPONSE_PROXY_AUTHENTICATE => 'proxy-authenticate', - self::RESPONSE_PUBLIC_KEY_PINS => 'public-key-pins', - self::RESPONSE_REFRESH => 'refresh', - self::RESPONSE_RETRY_AFTER => 'retry-after', - self::RESPONSE_SERVER => 'server', - self::RESPONSE_SET_COOKIE => 'set-cookie', - self::RESPONSE_STATUS => 'status', - self::RESPONSE_STRICT_TRANSPORT_SECURITY => 'strict-transport-security', - self::RESPONSE_TRAILER => 'trailer', - self::RESPONSE_TRANSFER_ENCODING => 'transfer-encoding', - self::RESPONSE_UPGRADE => 'upgrade', - self::RESPONSE_VARY => 'vary', - self::RESPONSE_WARNING => 'warning', - self::RESPONSE_WWW_AUTHENTICATE => 'www-authenticate', - self::RESPONSE_X_CONTENT_TYPE_OPTIONS => 'x-content-type-options', - self::RESPONSE_X_UA_COMPATIBLE => 'x-ua-compatible', + static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN => 'access-control-allow-origin', + static::RESPONSE_ACCESS_CONTROL_ALLOW_CREDENTIALS => 'access-control-allow-credentials', + static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS => 'access-control-expose-headers', + static::RESPONSE_ACCESS_CONTROL_MAX_AGE => 'access-control-max-age', + static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS => 'access-control-allow-methods', + static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS => 'access-control-allow-headers', + static::RESPONSE_ACCEPT_PATCH => 'accept-patch', + static::RESPONSE_ACCEPT_RANGES => 'accept-ranges', + static::RESPONSE_AGE => 'age', + static::RESPONSE_ALLOW => 'allow', + static::RESPONSE_CACHE_CONTROL => 'cache-control', + static::RESPONSE_CHECKSUM_CONTENT => 'checksum_content', + static::RESPONSE_CHECKSUM_HEADER => 'checksum_header', + static::RESPONSE_CHECKSUM_HEADERS => 'checksum_headers', + static::RESPONSE_CONNECTION => 'connection', + static::RESPONSE_CONTENT_DISPOSITION => 'content-disposition', + static::RESPONSE_CONTENT_ENCODING => 'content-encoding', + static::RESPONSE_CONTENT_LANGUAGE => 'content-language', + static::RESPONSE_CONTENT_LENGTH => 'content-length', + static::RESPONSE_CONTENT_LOCATION => 'content-location', + static::RESPONSE_CONTENT_RANGE => 'content-range', + static::RESPONSE_CONTENT_REVISION => 'content_revision', + static::RESPONSE_CONTENT_SECURITY_POLICY => 'x-content-security-policy', + static::RESPONSE_CONTENT_TYPE => 'content-type', + static::RESPONSE_DATE => 'date', + static::RESPONSE_DATE_ACTUAL => 'date_actual', + static::RESPONSE_ETAG => 'etag', + static::RESPONSE_EXPIRES => 'expires', + static::RESPONSE_LAST_MODIFIED => 'last-modified', + static::RESPONSE_LINK => 'link', + static::RESPONSE_LOCATION => 'location', + static::RESPONSE_PRAGMA => 'pragma', + static::RESPONSE_PROXY_AUTHENTICATE => 'proxy-authenticate', + static::RESPONSE_PUBLIC_KEY_PINS => 'public-key-pins', + static::RESPONSE_REFRESH => 'refresh', + static::RESPONSE_RETRY_AFTER => 'retry-after', + static::RESPONSE_SERVER => 'server', + static::RESPONSE_SET_COOKIE => 'set-cookie', + static::RESPONSE_STATUS => 'status', + static::RESPONSE_STRICT_TRANSPORT_SECURITY => 'strict-transport-security', + static::RESPONSE_TRAILER => 'trailer', + static::RESPONSE_TRANSFER_ENCODING => 'transfer-encoding', + static::RESPONSE_UPGRADE => 'upgrade', + static::RESPONSE_VARY => 'vary', + static::RESPONSE_WARNING => 'warning', + static::RESPONSE_WWW_AUTHENTICATE => 'www-authenticate', + static::RESPONSE_X_CONTENT_TYPE_OPTIONS => 'x-content-type-options', + static::RESPONSE_X_UA_COMPATIBLE => 'x-ua-compatible', ); } @@ -8450,16 +8460,16 @@ class c_base_http extends c_base_rfc_string { */ private function p_get_http_method_mapping() { return array( - 'get' => self::HTTP_METHOD_GET, - 'head' => self::HTTP_METHOD_HEAD, - 'post' => self::HTTP_METHOD_POST, - 'put' => self::HTTP_METHOD_PUT, - 'delete' => self::HTTP_METHOD_DELETE, - 'trace' => self::HTTP_METHOD_TRACE, - 'options' => self::HTTP_METHOD_OPTIONS, - 'connect' => self::HTTP_METHOD_CONNECT, - 'patch' => self::HTTP_METHOD_PATCH, - 'track' => self::HTTP_METHOD_TRACK, + 'get' => static::HTTP_METHOD_GET, + 'head' => static::HTTP_METHOD_HEAD, + 'post' => static::HTTP_METHOD_POST, + 'put' => static::HTTP_METHOD_PUT, + 'delete' => static::HTTP_METHOD_DELETE, + 'trace' => static::HTTP_METHOD_TRACE, + 'options' => static::HTTP_METHOD_OPTIONS, + 'connect' => static::HTTP_METHOD_CONNECT, + 'patch' => static::HTTP_METHOD_PATCH, + 'track' => static::HTTP_METHOD_TRACK, ); } @@ -8531,18 +8541,18 @@ class c_base_http extends c_base_rfc_string { * @see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Access-Control-Allow-Origin */ private function p_prepare_header_response_access_control_allow_origin($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN, $this->response)) { + if (!array_key_exists(static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN, $this->response)) { return; } - if ($this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN]['wildcard']) { - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN] = $header_name . self::SEPARATOR_HEADER_NAME . '*'; + if ($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN]['wildcard']) { + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN] = $header_name . static::SEPARATOR_HEADER_NAME . '*'; return; } - $combined = pr_rfc_string_combine_uri_array($this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN]); + $combined = pr_rfc_string_combine_uri_array($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN]); if (is_string($combined)) { - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN] = $header_name . self::SEPARATOR_HEADER_NAME . $combined; + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_ORIGIN] = $header_name . static::SEPARATOR_HEADER_NAME . $combined; } unset($combined); } @@ -8560,21 +8570,21 @@ class c_base_http extends c_base_rfc_string { * @see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Access-Control-Expose-Headers */ private function p_prepare_header_response_access_control_expose_headers($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS, $this->response)) { + if (!array_key_exists(static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS, $this->response)) { return; } - $header_output[self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS] = $header_name . self::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS] = $header_name . static::SEPARATOR_HEADER_NAME; - if (!empty($this->response[self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS])) { - $exposed_headers_array = $this->response[self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS]; + if (!empty($this->response[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS])) { + $exposed_headers_array = $this->response[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS]; reset($exposed_headers_array); $exposed_header_name = array_shift($exposed_headers_array); - $header_output[self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS] .= $exposed_header_name; + $header_output[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS] .= $exposed_header_name; foreach ($exposed_headers_array as $exposed_header_name) { - $header_output[self::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS] .= ', ' . $exposed_header_name; + $header_output[static::RESPONSE_ACCESS_CONTROL_EXPOSE_HEADERS] .= ', ' . $exposed_header_name; } unset($exposed_headers_array); unset($exposed_header_name); @@ -8594,64 +8604,64 @@ class c_base_http extends c_base_rfc_string { * @see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Access-Control-Allow-Methods */ private function p_prepare_header_response_access_control_allow_methods($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS, $this->response)) { + if (!array_key_exists(static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS, $this->response)) { return; } - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] = $header_name . self::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] = $header_name . static::SEPARATOR_HEADER_NAME; - $allow_methods_array = $this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS]; + $allow_methods_array = $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS]; reset($allow_methods_array); $methods = array_shift($allow_methods_array); - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= $methods; + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= $methods; foreach ($allow_methods_array as $methods) { - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= ', ' ; + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= ', ' ; switch ($methods) { - case self::HTTP_METHOD_HEAD: - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'HEAD'; + case static::HTTP_METHOD_HEAD: + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'HEAD'; break; - case self::HTTP_METHOD_POST: - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'POST'; + case static::HTTP_METHOD_POST: + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'POST'; break; - case self::HTTP_METHOD_PUT: - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'PUT'; + case static::HTTP_METHOD_PUT: + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'PUT'; break; - case self::HTTP_METHOD_DELETE: - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'DELETE'; + case static::HTTP_METHOD_DELETE: + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'DELETE'; break; - case self::HTTP_METHOD_TRACE: - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'TRACE'; + case static::HTTP_METHOD_TRACE: + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'TRACE'; break; - case self::HTTP_METHOD_OPTIONS: - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'OPTIONS'; + case static::HTTP_METHOD_OPTIONS: + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'OPTIONS'; break; - case self::HTTP_METHOD_CONNECT: - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'CONNECT'; + case static::HTTP_METHOD_CONNECT: + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'CONNECT'; break; - case self::HTTP_METHOD_PATCH: - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'PATCH'; + case static::HTTP_METHOD_PATCH: + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'PATCH'; break; - case self::HTTP_METHOD_TRACK: - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'TRACK'; + case static::HTTP_METHOD_TRACK: + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'TRACK'; break; - case self::HTTP_METHOD_DEBUG: - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'DEBUG'; + case static::HTTP_METHOD_DEBUG: + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= 'DEBUG'; break; } - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= ', ' . $methods; + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_METHODS] .= ', ' . $methods; } unset($allow_methods_array); unset($methods); @@ -8671,24 +8681,24 @@ class c_base_http extends c_base_rfc_string { * @see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Access-Control-Allow-Headers */ private function p_prepare_header_response_access_control_allow_headers($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS, $this->response)) { + if (!array_key_exists(static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS, $this->response)) { return; } - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS] = $header_name . self::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS] = $header_name . static::SEPARATOR_HEADER_NAME; - if (empty($this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS])) { + if (empty($this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS])) { return; } - $allowed_headers_array = $this->response[self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS]; + $allowed_headers_array = $this->response[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS]; reset($allowed_headers_array); $allowed_header_name = array_shift($allowed_headers_array); - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS] .= $allowed_header_name; + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS] .= $allowed_header_name; foreach ($allowed_headers_array as $allowed_header_name) { - $header_output[self::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS] .= ', ' . $allowed_header_name; + $header_output[static::RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS] .= ', ' . $allowed_header_name; } unset($allowed_headers_array); unset($allowed_header_name); @@ -8708,15 +8718,15 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc2616#section-3.12 */ private function p_prepare_header_response_accept_patch($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_ACCEPT_PATCH, $this->response)) { + if (!array_key_exists(static::RESPONSE_ACCEPT_PATCH, $this->response)) { return; } - $header_output[self::RESPONSE_ACCEPT_PATCH] = $header_name . self::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_ACCEPT_PATCH] = $header_name . static::SEPARATOR_HEADER_NAME; - if (!empty($this->response[self::RESPONSE_ACCEPT_PATCH])) { - foreach ($this->response[self::RESPONSE_ACCEPT_PATCH] as $media_type) { - $header_output[self::RESPONSE_ACCEPT_PATCH] .= $media_type['media']; + if (!empty($this->response[static::RESPONSE_ACCEPT_PATCH])) { + foreach ($this->response[static::RESPONSE_ACCEPT_PATCH] as $media_type) { + $header_output[static::RESPONSE_ACCEPT_PATCH] .= $media_type['media']; if (!empty($media_type['parameters'])) { $parameter_value = reset($media_type['parameters']); @@ -8730,7 +8740,7 @@ class c_base_http extends c_base_rfc_string { unset($parameter_name); unset($parameter_value); - $header_output[self::RESPONSE_ACCEPT_PATCH] .= ' ' . $media_parameters; + $header_output[static::RESPONSE_ACCEPT_PATCH] .= ' ' . $media_parameters; unset($media_parameters); } } @@ -8749,27 +8759,27 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-7.4.1 */ private function p_prepare_header_response_allow($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_ALLOW, $this->response)) { + if (!array_key_exists(static::RESPONSE_ALLOW, $this->response)) { return; } - $header_output[self::RESPONSE_ALLOW] = $header_name . self::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_ALLOW] = $header_name . static::SEPARATOR_HEADER_NAME; - if (array_key_exists(self::HTTP_METHOD_NONE, $this->response[self::RESPONSE_ALLOW])) { + if (array_key_exists(static::HTTP_METHOD_NONE, $this->response[static::RESPONSE_ALLOW])) { // An empty Allow field value indicates that the resource allows no methods, which might occur in a 405 response if the resource has been temporarily disabled by configuration. return; } $mapping = array_flip($this->p_get_http_method_mapping()); - $allow = reset($this->response[self::RESPONSE_ALLOW]); - $allow_key = key($this->response[self::RESPONSE_ALLOW]); - unset($this->response[self::RESPONSE_ALLOW][$allow_key]); + $allow = reset($this->response[static::RESPONSE_ALLOW]); + $allow_key = key($this->response[static::RESPONSE_ALLOW]); + unset($this->response[static::RESPONSE_ALLOW][$allow_key]); unset($allow_key); - $header_output[self::RESPONSE_ALLOW] .= $mapping[$allow]; - foreach ($this->response[self::RESPONSE_ALLOW] as $allow) { - $header_output[self::RESPONSE_ALLOW] .= ', ' . $mapping[$allow]; + $header_output[static::RESPONSE_ALLOW] .= $mapping[$allow]; + foreach ($this->response[static::RESPONSE_ALLOW] as $allow) { + $header_output[static::RESPONSE_ALLOW] .= ', ' . $mapping[$allow]; } unset($allow); unset($mapping); @@ -8787,66 +8797,66 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7234#section-5.2.3 */ private function p_prepare_header_response_cache_control($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_CACHE_CONTROL, $this->response) || empty($this->response[self::RESPONSE_CACHE_CONTROL])) { + if (!array_key_exists(static::RESPONSE_CACHE_CONTROL, $this->response) || empty($this->response[static::RESPONSE_CACHE_CONTROL])) { return; } - $header_output[self::RESPONSE_CACHE_CONTROL] = NULL; - foreach ($this->response[self::RESPONSE_CACHE_CONTROL] as $cache_control_directive => $cache_control_value) { - if (is_null($header_output[self::RESPONSE_CACHE_CONTROL])) { - $header_output[self::RESPONSE_CACHE_CONTROL] = $header_name . self::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_CACHE_CONTROL] = NULL; + foreach ($this->response[static::RESPONSE_CACHE_CONTROL] as $cache_control_directive => $cache_control_value) { + if (is_null($header_output[static::RESPONSE_CACHE_CONTROL])) { + $header_output[static::RESPONSE_CACHE_CONTROL] = $header_name . static::SEPARATOR_HEADER_NAME; } else { - $header_output[self::RESPONSE_CACHE_CONTROL] .= ', '; + $header_output[static::RESPONSE_CACHE_CONTROL] .= ', '; } switch ($cache_control_directive) { - case self::CACHE_CONTROL_NO_CACHE: - $header_output[self::RESPONSE_CACHE_CONTROL] .= 'no-cache'; + case static::CACHE_CONTROL_NO_CACHE: + $header_output[static::RESPONSE_CACHE_CONTROL] .= 'no-cache'; break; - case self::CACHE_CONTROL_NO_STORE: - $header_output[self::RESPONSE_CACHE_CONTROL] .= 'no-store'; + case static::CACHE_CONTROL_NO_STORE: + $header_output[static::RESPONSE_CACHE_CONTROL] .= 'no-store'; break; - case self::CACHE_CONTROL_NO_TRANSFORM: - $header_output[self::RESPONSE_CACHE_CONTROL] .= 'no-transform'; + case static::CACHE_CONTROL_NO_TRANSFORM: + $header_output[static::RESPONSE_CACHE_CONTROL] .= 'no-transform'; break; - case self::CACHE_CONTROL_MAX_AGE: - $header_output[self::RESPONSE_CACHE_CONTROL] .= 'max-age'; + case static::CACHE_CONTROL_MAX_AGE: + $header_output[static::RESPONSE_CACHE_CONTROL] .= 'max-age'; break; - case self::CACHE_CONTROL_MAX_AGE_S: - $header_output[self::RESPONSE_CACHE_CONTROL] .= 's-max-age'; + case static::CACHE_CONTROL_MAX_AGE_S: + $header_output[static::RESPONSE_CACHE_CONTROL] .= 's-max-age'; break; - case self::CACHE_CONTROL_MAX_STALE: - $header_output[self::RESPONSE_CACHE_CONTROL] .= 'max-statle'; + case static::CACHE_CONTROL_MAX_STALE: + $header_output[static::RESPONSE_CACHE_CONTROL] .= 'max-statle'; break; - case self::CACHE_CONTROL_MIN_FRESH: - $header_output[self::RESPONSE_CACHE_CONTROL] .= 'min-fresh'; + case static::CACHE_CONTROL_MIN_FRESH: + $header_output[static::RESPONSE_CACHE_CONTROL] .= 'min-fresh'; break; - case self::CACHE_CONTROL_ONLY_IF_CACHED: - $header_output[self::RESPONSE_CACHE_CONTROL] .= 'only-if-cached'; + case static::CACHE_CONTROL_ONLY_IF_CACHED: + $header_output[static::RESPONSE_CACHE_CONTROL] .= 'only-if-cached'; break; - case self::CACHE_CONTROL_PUBLIC: - $header_output[self::RESPONSE_CACHE_CONTROL] .= 'public'; + case static::CACHE_CONTROL_PUBLIC: + $header_output[static::RESPONSE_CACHE_CONTROL] .= 'public'; break; - case self::CACHE_CONTROL_PRIVATE: - $header_output[self::RESPONSE_CACHE_CONTROL] .= 'private'; + case static::CACHE_CONTROL_PRIVATE: + $header_output[static::RESPONSE_CACHE_CONTROL] .= 'private'; break; - case self::CACHE_CONTROL_MUST_REVALIDATE: - $header_output[self::RESPONSE_CACHE_CONTROL] .= 'must-revalidate'; + case static::CACHE_CONTROL_MUST_REVALIDATE: + $header_output[static::RESPONSE_CACHE_CONTROL] .= 'must-revalidate'; break; - case self::CACHE_CONTROL_PROXY_REVALIDATE: - $header_output[self::RESPONSE_CACHE_CONTROL] .= 'proxy-revalidate'; + case static::CACHE_CONTROL_PROXY_REVALIDATE: + $header_output[static::RESPONSE_CACHE_CONTROL] .= 'proxy-revalidate'; break; default: @@ -8854,7 +8864,7 @@ class c_base_http extends c_base_rfc_string { } if (!is_null($cache_control_value)) { - $header_output[self::RESPONSE_CACHE_CONTROL] .= '=' . $cache_control_value; + $header_output[static::RESPONSE_CACHE_CONTROL] .= '=' . $cache_control_value; } } unset($cache_control_directive); @@ -8872,20 +8882,20 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7230#section-6.1 */ private function p_prepare_header_response_connection($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_CONNECTION, $this->response)) { + if (!array_key_exists(static::RESPONSE_CONNECTION, $this->response)) { return; } - $header_output[self::RESPONSE_CONNECTION] = $header_name . self::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_CONNECTION] = $header_name . static::SEPARATOR_HEADER_NAME; - $connection = reset($this->response[self::RESPONSE_CONNECTION]); - $connection_key = key($this->response[self::RESPONSE_CONNECTION]); - unset($this->response[self::RESPONSE_CONNECTION][$connection_key]); + $connection = reset($this->response[static::RESPONSE_CONNECTION]); + $connection_key = key($this->response[static::RESPONSE_CONNECTION]); + unset($this->response[static::RESPONSE_CONNECTION][$connection_key]); unset($connection_key); - $header_output[self::RESPONSE_CONNECTION] .= $connection; - foreach ($this->response[self::RESPONSE_CONNECTION] as $connection) { - $header_output[self::RESPONSE_CONNECTION] .= ', ' . $connection; + $header_output[static::RESPONSE_CONNECTION] .= $connection; + foreach ($this->response[static::RESPONSE_CONNECTION] as $connection) { + $header_output[static::RESPONSE_CONNECTION] .= ', ' . $connection; } unset($connection); } @@ -8908,20 +8918,20 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc6266#section-4 */ private function p_prepare_header_response_content_disposition($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_CONTENT_DISPOSITION, $this->response)) { + if (!array_key_exists(static::RESPONSE_CONTENT_DISPOSITION, $this->response)) { return; } - $header_output[self::RESPONSE_CONTENT_DISPOSITION] = $header_name . self::SEPARATOR_HEADER_NAME; - $header_output[self::RESPONSE_CONTENT_DISPOSITION] .= $this->response[self::RESPONSE_CONTENT_DISPOSITION]['type']; + $header_output[static::RESPONSE_CONTENT_DISPOSITION] = $header_name . static::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_CONTENT_DISPOSITION] .= $this->response[static::RESPONSE_CONTENT_DISPOSITION]['type']; - if (empty($this->response[self::RESPONSE_CONTENT_DISPOSITION]['parameters'])) { + if (empty($this->response[static::RESPONSE_CONTENT_DISPOSITION]['parameters'])) { return; } - $parameter_value = reset($this->response[self::RESPONSE_CONTENT_DISPOSITION]['parameters']); - $parameter_name = key($this->response[self::RESPONSE_CONTENT_DISPOSITION]['parameters']); - unset($this->response[self::RESPONSE_CONTENT_DISPOSITION]['parameters'][$parameter_name]); + $parameter_value = reset($this->response[static::RESPONSE_CONTENT_DISPOSITION]['parameters']); + $parameter_name = key($this->response[static::RESPONSE_CONTENT_DISPOSITION]['parameters']); + unset($this->response[static::RESPONSE_CONTENT_DISPOSITION]['parameters'][$parameter_name]); if (is_null($parameter_value)) { $parameters_string = $parameter_name; } @@ -8929,20 +8939,20 @@ class c_base_http extends c_base_rfc_string { $parameters_string = $parameter_name . '=' . $parameter_value; } - foreach($this->response[self::RESPONSE_CONTENT_DISPOSITION]['parameters'] as $parameter_name => $parameter_value) { - $header_output[self::RESPONSE_CONTENT_DISPOSITION] .= '; '; + foreach($this->response[static::RESPONSE_CONTENT_DISPOSITION]['parameters'] as $parameter_name => $parameter_value) { + $header_output[static::RESPONSE_CONTENT_DISPOSITION] .= '; '; if (is_null($parameter_value)) { - $header_output[self::RESPONSE_CONTENT_DISPOSITION] .= $parameter_name; + $header_output[static::RESPONSE_CONTENT_DISPOSITION] .= $parameter_name; } else { - $header_output[self::RESPONSE_CONTENT_DISPOSITION] .= $parameter_name . '=' . $parameter_value; + $header_output[static::RESPONSE_CONTENT_DISPOSITION] .= $parameter_name . '=' . $parameter_value; } } unset($parameter_name); unset($parameter_value); - $header_output[self::RESPONSE_CONTENT_DISPOSITION] .= $parameters_string; + $header_output[static::RESPONSE_CONTENT_DISPOSITION] .= $parameters_string; unset($parameters_string); } @@ -8957,57 +8967,57 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-3.1.2.2 */ private function p_prepare_header_response_content_encoding($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_CONTENT_ENCODING, $this->response)) { + if (!array_key_exists(static::RESPONSE_CONTENT_ENCODING, $this->response)) { return; } - $header_output[self::RESPONSE_CONTENT_ENCODING] = $header_name . self::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_CONTENT_ENCODING] = $header_name . static::SEPARATOR_HEADER_NAME; $output = NULL; - foreach ($this->response[self::RESPONSE_CONTENT_ENCODING] as $encoding) { + foreach ($this->response[static::RESPONSE_CONTENT_ENCODING] as $encoding) { switch ($encoding) { - case self::ENCODING_CHUNKED: + case static::ENCODING_CHUNKED: $output .= ',chunked'; break; - case self::ENCODING_COMPRESS: + case static::ENCODING_COMPRESS: $output .= ',compress'; break; - case self::ENCODING_DEFLATE: + case static::ENCODING_DEFLATE: $output .= ',deflate'; break; - case self::ENCODING_GZIP: + case static::ENCODING_GZIP: $output .= ',gzip'; break; - case self::ENCODING_BZIP: + case static::ENCODING_BZIP: $output .= ',bzip'; break; - case self::ENCODING_LZO: + case static::ENCODING_LZO: $output .= ',lzo'; break; - case self::ENCODING_XZ: + case static::ENCODING_XZ: $output .= ',xz'; break; - case self::ENCODING_EXI: + case static::ENCODING_EXI: $output .= ',exi'; break; - case self::ENCODING_IDENTITY: + case static::ENCODING_IDENTITY: $output .= ',identity'; break; - case self::ENCODING_SDCH: + case static::ENCODING_SDCH: $output .= ',sdch'; break; - case self::ENCODING_PG: + case static::ENCODING_PG: $output .= ',pg'; break; } } if (is_null($output)) { - unset($header_output[self::RESPONSE_CONTENT_ENCODING]); + unset($header_output[static::RESPONSE_CONTENT_ENCODING]); } else { - $header_output[self::RESPONSE_CONTENT_ENCODING] .= c_base_utf8::s_substring($output, 1)->get_value_exact(); + $header_output[static::RESPONSE_CONTENT_ENCODING] .= c_base_utf8::s_substring($output, 1)->get_value_exact(); } } @@ -9022,12 +9032,12 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-3.1.3.2 */ private function p_prepare_header_response_content_language($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_CONTENT_LANGUAGE, $this->response)) { + if (!array_key_exists(static::RESPONSE_CONTENT_LANGUAGE, $this->response)) { return; } $output = NULL; - foreach ($this->response[self::RESPONSE_CONTENT_LANGUAGE] as $language) { + foreach ($this->response[static::RESPONSE_CONTENT_LANGUAGE] as $language) { $language_array = $this->languages->s_get_aliases_by_id($language); if ($language_array instanceof c_base_return_array) { $language_array = $language_array->get_value_exact(); @@ -9042,7 +9052,7 @@ class c_base_http extends c_base_rfc_string { unset($language); if (!is_null($output)) { - $header_output[self::RESPONSE_CONTENT_LANGUAGE] = $header_name . ': ' . c_base_utf8::s_substring($output, 2)->get_value_exact(); + $header_output[static::RESPONSE_CONTENT_LANGUAGE] = $header_name . ': ' . c_base_utf8::s_substring($output, 2)->get_value_exact(); } unset($output); } @@ -9058,34 +9068,34 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7233#section-4.2 */ private function p_prepare_header_response_content_range($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_CONTENT_RANGE, $this->response)) { + if (!array_key_exists(static::RESPONSE_CONTENT_RANGE, $this->response)) { return; } - $header_output[self::RESPONSE_CONTENT_RANGE] = $header_name . ': ' . $this->response[self::RESPONSE_CONTENT_RANGE]['type'] . ' '; + $header_output[static::RESPONSE_CONTENT_RANGE] = $header_name . ': ' . $this->response[static::RESPONSE_CONTENT_RANGE]['type'] . ' '; - if ($this->response[self::RESPONSE_CONTENT_RANGE]['range'] === FALSE) { - $header_output[self::RESPONSE_CONTENT_RANGE] .= '*/' . $this->response[self::RESPONSE_CONTENT_RANGE]['total']; + if ($this->response[static::RESPONSE_CONTENT_RANGE]['range'] === FALSE) { + $header_output[static::RESPONSE_CONTENT_RANGE] .= '*/' . $this->response[static::RESPONSE_CONTENT_RANGE]['total']; return; } - if (!is_null($this->response[self::RESPONSE_CONTENT_RANGE]['range']['start'])) { - $header_output[self::RESPONSE_CONTENT_RANGE] .= $this->response[self::RESPONSE_CONTENT_RANGE]['range']['start']; + if (!is_null($this->response[static::RESPONSE_CONTENT_RANGE]['range']['start'])) { + $header_output[static::RESPONSE_CONTENT_RANGE] .= $this->response[static::RESPONSE_CONTENT_RANGE]['range']['start']; } - $header_output[self::RESPONSE_CONTENT_RANGE] .= '-'; + $header_output[static::RESPONSE_CONTENT_RANGE] .= '-'; - if (!is_null($this->response[self::RESPONSE_CONTENT_RANGE]['range']['stop'])) { - $header_output[self::RESPONSE_CONTENT_RANGE] .= $this->response[self::RESPONSE_CONTENT_RANGE]['range']['stop']; + if (!is_null($this->response[static::RESPONSE_CONTENT_RANGE]['range']['stop'])) { + $header_output[static::RESPONSE_CONTENT_RANGE] .= $this->response[static::RESPONSE_CONTENT_RANGE]['range']['stop']; } - $header_output[self::RESPONSE_CONTENT_RANGE] .= '/'; + $header_output[static::RESPONSE_CONTENT_RANGE] .= '/'; - if ($this->response[self::RESPONSE_CONTENT_RANGE]['total'] === FALSE) { - $header_output[self::RESPONSE_CONTENT_RANGE] .= '*'; + if ($this->response[static::RESPONSE_CONTENT_RANGE]['total'] === FALSE) { + $header_output[static::RESPONSE_CONTENT_RANGE] .= '*'; } else { - $header_output[self::RESPONSE_CONTENT_RANGE] .= $this->response[self::RESPONSE_CONTENT_RANGE]['total']; + $header_output[static::RESPONSE_CONTENT_RANGE] .= $this->response[static::RESPONSE_CONTENT_RANGE]['total']; } } @@ -9100,15 +9110,15 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-3.1.1.5 */ private function p_prepare_header_response_content_type($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_CONTENT_TYPE, $this->response)) { + if (!array_key_exists(static::RESPONSE_CONTENT_TYPE, $this->response)) { return; } - $header_output[self::RESPONSE_CONTENT_TYPE] = $header_name . ': ' . $this->response[self::RESPONSE_CONTENT_TYPE]['type']; + $header_output[static::RESPONSE_CONTENT_TYPE] = $header_name . ': ' . $this->response[static::RESPONSE_CONTENT_TYPE]['type']; - $encoding_string = c_base_charset::s_to_string($this->response[self::RESPONSE_CONTENT_TYPE]['charset']); + $encoding_string = c_base_charset::s_to_string($this->response[static::RESPONSE_CONTENT_TYPE]['charset']); if ($encoding_string instanceof c_base_return_string) { - $header_output[self::RESPONSE_CONTENT_TYPE] .= '; charset=' . $encoding_string->get_value_exact(); + $header_output[static::RESPONSE_CONTENT_TYPE] .= '; charset=' . $encoding_string->get_value_exact(); } unset($encoding_string); @@ -9125,15 +9135,15 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc6266#section-4 */ private function p_prepare_header_response_etag($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_ETAG, $this->response)) { + if (!array_key_exists(static::RESPONSE_ETAG, $this->response)) { return; } - if ($this->response[self::RESPONSE_ETAG]['weak']) { - $header_output[self::RESPONSE_ETAG] = $header_name . ': W/"' . $this->response[self::RESPONSE_ETAG]['tag'] . '"'; + if ($this->response[static::RESPONSE_ETAG]['weak']) { + $header_output[static::RESPONSE_ETAG] = $header_name . ': W/"' . $this->response[static::RESPONSE_ETAG]['tag'] . '"'; } else { - $header_output[self::RESPONSE_ETAG] = $header_name . ': "' . $this->response[self::RESPONSE_ETAG]['tag'] . '"'; + $header_output[static::RESPONSE_ETAG] = $header_name . ': "' . $this->response[static::RESPONSE_ETAG]['tag'] . '"'; } } @@ -9149,11 +9159,11 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc3986 */ private function p_prepare_header_response_link($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_LINK, $this->response)) { + if (!array_key_exists(static::RESPONSE_LINK, $this->response)) { return; } - foreach ($this->response[self::RESPONSE_LINK] as $uris) { + foreach ($this->response[static::RESPONSE_LINK] as $uris) { $uri = $this->pr_rfc_string_combine_uri_array($uris['uri']); if ($uri === FALSE) { unset($uri); @@ -9161,12 +9171,12 @@ class c_base_http extends c_base_rfc_string { return; } - if (!isset($header_output[self::RESPONSE_LINK])) { - $header_output[self::RESPONSE_LINK] = ''; + if (!isset($header_output[static::RESPONSE_LINK])) { + $header_output[static::RESPONSE_LINK] = ''; } - $header_output[self::RESPONSE_LINK] .= $header_name . self::SEPARATOR_HEADER_NAME; - $header_output[self::RESPONSE_LINK] .= '<' . $uri . '>'; + $header_output[static::RESPONSE_LINK] .= $header_name . static::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_LINK] .= '<' . $uri . '>'; unset($uri); if (!empty($uris['parameters'])) { @@ -9195,7 +9205,7 @@ class c_base_http extends c_base_rfc_string { unset($parameter_name); unset($parameter_value); - $header_output[self::RESPONSE_LINK] .= $parameters_string; + $header_output[static::RESPONSE_LINK] .= $parameters_string; unset($parameters_string); } } @@ -9213,15 +9223,15 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc3986 */ private function p_prepare_header_response_location($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_LOCATION, $this->response)) { + if (!array_key_exists(static::RESPONSE_LOCATION, $this->response)) { return; } - $header_output[self::RESPONSE_LOCATION] = $header_name . self::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_LOCATION] = $header_name . static::SEPARATOR_HEADER_NAME; - $combined = self::pr_rfc_string_combine_uri_array($this->response[self::RESPONSE_LOCATION]); + $combined = self::pr_rfc_string_combine_uri_array($this->response[static::RESPONSE_LOCATION]); if (is_string($combined)) { - $header_output[self::RESPONSE_LOCATION] .= $combined; + $header_output[static::RESPONSE_LOCATION] .= $combined; } unset($combined); } @@ -9238,15 +9248,15 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7234#section-5.4 */ private function p_prepare_header_response_pragma($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_PRAGMA, $this->response)) { + if (!array_key_exists(static::RESPONSE_PRAGMA, $this->response)) { return; } - $header_output[self::RESPONSE_PRAGMA] = $header_name . self::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_PRAGMA] = $header_name . static::SEPARATOR_HEADER_NAME; - $parameter_value = reset($this->response[self::RESPONSE_PRAGMA]); - $parameter_name = key($this->response[self::RESPONSE_PRAGMA]); - unset($this->response[self::RESPONSE_PRAGMA][$parameter_name]); + $parameter_value = reset($this->response[static::RESPONSE_PRAGMA]); + $parameter_name = key($this->response[static::RESPONSE_PRAGMA]); + unset($this->response[static::RESPONSE_PRAGMA][$parameter_name]); if (is_null($parameter_value)) { $parameters_string = $parameter_name; @@ -9255,7 +9265,7 @@ class c_base_http extends c_base_rfc_string { $parameters_string = $parameter_name . '=' . $parameter_value; } - foreach($this->response[self::RESPONSE_PRAGMA] as $parameter_name => $parameter_value) { + foreach($this->response[static::RESPONSE_PRAGMA] as $parameter_name => $parameter_value) { $parameters_string .= ', '; if (is_null($parameter_value)) { @@ -9268,7 +9278,7 @@ class c_base_http extends c_base_rfc_string { unset($parameter_name); unset($parameter_value); - $header_output[self::RESPONSE_PRAGMA] .= $parameters_string; + $header_output[static::RESPONSE_PRAGMA] .= $parameters_string; unset($parameters_string); } @@ -9283,7 +9293,7 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7235#section-4.3 */ private function p_prepare_header_response_proxy_authenticate($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_PROXY_AUTHENTICATE, $this->response)) { + if (!array_key_exists(static::RESPONSE_PROXY_AUTHENTICATE, $this->response)) { return; } @@ -9301,7 +9311,7 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7469 */ private function p_prepare_header_response_public_key_pins($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_PUBLIC_KEY_PINS, $this->response)) { + if (!array_key_exists(static::RESPONSE_PUBLIC_KEY_PINS, $this->response)) { return; } @@ -9320,7 +9330,7 @@ class c_base_http extends c_base_rfc_string { * @see: https://en.wikipedia.org/wiki/List_of_HTTP_header_fields */ private function p_prepare_header_response_refresh($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_REFRESH, $this->response)) { + if (!array_key_exists(static::RESPONSE_REFRESH, $this->response)) { return; } @@ -9338,20 +9348,20 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-7.1.3 */ private function p_prepare_header_response_retry_after($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_RETRY_AFTER, $this->response)) { + if (!array_key_exists(static::RESPONSE_RETRY_AFTER, $this->response)) { return; } - $header_output[self::RESPONSE_RETRY_AFTER] = $header_name . self::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_RETRY_AFTER] = $header_name . static::SEPARATOR_HEADER_NAME; - if ($this->response[self::RESPONSE_RETRY_AFTER]['is_seconds']) { - $header_output[self::RESPONSE_RETRY_AFTER] .= $this->response[self::RESPONSE_RETRY_AFTER]['is_seconds']; + if ($this->response[static::RESPONSE_RETRY_AFTER]['is_seconds']) { + $header_output[static::RESPONSE_RETRY_AFTER] .= $this->response[static::RESPONSE_RETRY_AFTER]['is_seconds']; } else { $timezone = date_default_timezone_get(); date_default_timezone_set('GMT'); - $header_output[self::RESPONSE_RETRY_AFTER] .= c_base_defaults_global::s_get_date(self::TIMESTAMP_RFC_5322, $this->response[self::RESPONSE_RETRY_AFTER]['value'])->get_value_exact(); + $header_output[static::RESPONSE_RETRY_AFTER] .= c_base_defaults_global::s_get_date(static::TIMESTAMP_RFC_5322, $this->response[static::RESPONSE_RETRY_AFTER]['value'])->get_value_exact(); date_default_timezone_set($timezone); unset($timezone); @@ -9369,19 +9379,19 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc6265 */ private function p_prepare_header_response_set_cookie($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_SET_COOKIE, $this->response) || !is_array($this->response[self::RESPONSE_SET_COOKIE])) { + if (!array_key_exists(static::RESPONSE_SET_COOKIE, $this->response) || !is_array($this->response[static::RESPONSE_SET_COOKIE])) { return; } - $header_output[self::RESPONSE_SET_COOKIE] = array(); - foreach ($this->response[self::RESPONSE_SET_COOKIE] as $cookie) { + $header_output[static::RESPONSE_SET_COOKIE] = array(); + foreach ($this->response[static::RESPONSE_SET_COOKIE] as $cookie) { if (!($cookie instanceof c_base_cookie)) { continue; } $cookie_string = $cookie->get_cookie(); if ($cookie_string instanceof c_base_return_string) { - $header_output[self::RESPONSE_SET_COOKIE][] = $cookie_string->get_value_exact(); + $header_output[static::RESPONSE_SET_COOKIE][] = $cookie_string->get_value_exact(); } unset($cookie_string); } @@ -9399,7 +9409,7 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-7.4.2 */ private function p_prepare_header_response_server($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_SERVER, $this->response)) { + if (!array_key_exists(static::RESPONSE_SERVER, $this->response)) { return; } @@ -9417,7 +9427,7 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc6797#section-6.1 */ private function p_prepare_header_response_strict_transport_security($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_STRICT_TRANSPORT_SECURITY, $this->response)) { + if (!array_key_exists(static::RESPONSE_STRICT_TRANSPORT_SECURITY, $this->response)) { return; } @@ -9440,7 +9450,7 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7230#section-3.3.1 */ private function p_prepare_header_response_trailer($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_TRAILER, $this->response)) { + if (!array_key_exists(static::RESPONSE_TRAILER, $this->response)) { return; } @@ -9458,13 +9468,13 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7230#section-3.3.1 */ private function p_prepare_header_response_transfer_encoding($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_TRANSFER_ENCODING, $this->response)) { + if (!array_key_exists(static::RESPONSE_TRANSFER_ENCODING, $this->response)) { return; } // according to the standard, content-length cannot be specified when transfer-encoding is defined. - if (array_key_exists(self::RESPONSE_CONTENT_LENGTH, $header_output)) { - unset($header_output[self::RESPONSE_CONTENT_LENGTH]); + if (array_key_exists(static::RESPONSE_CONTENT_LENGTH, $header_output)) { + unset($header_output[static::RESPONSE_CONTENT_LENGTH]); } // @todo @@ -9482,7 +9492,7 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-5.5.3 */ private function p_prepare_header_response_upgrade($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_UPGRADE, $this->response)) { + if (!array_key_exists(static::RESPONSE_UPGRADE, $this->response)) { return; } @@ -9500,21 +9510,21 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7231#section-7.1.4 */ private function p_prepare_header_response_vary($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_VARY, $this->response)) { + if (!array_key_exists(static::RESPONSE_VARY, $this->response)) { return; } - $header_output[self::RESPONSE_VARY] = $header_name . self::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_VARY] = $header_name . static::SEPARATOR_HEADER_NAME; - $vary = reset($this->response[self::RESPONSE_VARY]); - $vary_key = key($this->response[self::RESPONSE_VARY]); - unset($this->response[self::RESPONSE_VARY][$vary_key]); + $vary = reset($this->response[static::RESPONSE_VARY]); + $vary_key = key($this->response[static::RESPONSE_VARY]); + unset($this->response[static::RESPONSE_VARY][$vary_key]); unset($vary_key); - $header_output[self::RESPONSE_VARY] .= $vary; + $header_output[static::RESPONSE_VARY] .= $vary; - foreach ($this->response[self::RESPONSE_VARY] as $vary) { - $header_output[self::RESPONSE_VARY] .= ', ' . $vary; + foreach ($this->response[static::RESPONSE_VARY] as $vary) { + $header_output[static::RESPONSE_VARY] .= ', ' . $vary; } unset($vary); } @@ -9530,7 +9540,7 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7234#section-5.5 */ private function p_prepare_header_response_warning($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_WARNING, $this->response)) { + if (!array_key_exists(static::RESPONSE_WARNING, $this->response)) { return; } @@ -9548,7 +9558,7 @@ class c_base_http extends c_base_rfc_string { * @see: https://tools.ietf.org/html/rfc7235#section-4.1 */ private function p_prepare_header_response_www_authenticate($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_WWW_AUTHENTICATE, $this->response)) { + if (!array_key_exists(static::RESPONSE_WWW_AUTHENTICATE, $this->response)) { return; } @@ -9573,15 +9583,15 @@ class c_base_http extends c_base_rfc_string { * @see: https://www.html5rocks.com/en/tutorials/security/content-security-policy/ */ private function p_prepare_header_response_content_security_policy($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_CONTENT_SECURITY_POLICY, $this->response)) { + if (!array_key_exists(static::RESPONSE_CONTENT_SECURITY_POLICY, $this->response)) { return; } - $header_output[self::RESPONSE_CONTENT_SECURITY_POLICY] = $header_name . self::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_CONTENT_SECURITY_POLICY] = $header_name . static::SEPARATOR_HEADER_NAME; - $policy_value = reset($this->response[self::RESPONSE_CONTENT_SECURITY_POLICY]); - $policy_name = key($this->response[self::RESPONSE_CONTENT_SECURITY_POLICY]); - unset($this->response[self::RESPONSE_CONTENT_SECURITY_POLICY][$policy_name]); + $policy_value = reset($this->response[static::RESPONSE_CONTENT_SECURITY_POLICY]); + $policy_name = key($this->response[static::RESPONSE_CONTENT_SECURITY_POLICY]); + unset($this->response[static::RESPONSE_CONTENT_SECURITY_POLICY][$policy_name]); $policy_string = $policy_name; foreach ($policy_values as $policy_value) { @@ -9589,7 +9599,7 @@ class c_base_http extends c_base_rfc_string { } unset($policy_value); - foreach ($this->response[self::RESPONSE_CONTENT_SECURITY_POLICY] as $policy_name => $policy_values) { + foreach ($this->response[static::RESPONSE_CONTENT_SECURITY_POLICY] as $policy_name => $policy_values) { $policy_string .= '; ' . $policy_name; foreach ($policy_values as $policy_value) { $policy_string .= ' ' . $policy_value; @@ -9599,7 +9609,7 @@ class c_base_http extends c_base_rfc_string { unset($policy_name); unset($policy_values); - $header_output[self::RESPONSE_CONTENT_SECURITY_POLICY] .= $policy_string; + $header_output[static::RESPONSE_CONTENT_SECURITY_POLICY] .= $policy_string; unset($policy_string); } @@ -9614,17 +9624,17 @@ class c_base_http extends c_base_rfc_string { * @see: https://en.wikipedia.org/wiki/List_of_HTTP_header_fields */ private function p_prepare_header_response_x_content_type_options($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_X_CONTENT_TYPE_OPTIONS, $this->response)) { + if (!array_key_exists(static::RESPONSE_X_CONTENT_TYPE_OPTIONS, $this->response)) { return; } - $header_output[self::RESPONSE_X_CONTENT_TYPE_OPTIONS] = $header_name . self::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_X_CONTENT_TYPE_OPTIONS] = $header_name . static::SEPARATOR_HEADER_NAME; - if ($this->response[self::RESPONSE_X_CONTENT_TYPE_OPTIONS]) { - $header_output[self::RESPONSE_X_CONTENT_TYPE_OPTIONS] = 'nosniff'; + if ($this->response[static::RESPONSE_X_CONTENT_TYPE_OPTIONS]) { + $header_output[static::RESPONSE_X_CONTENT_TYPE_OPTIONS] = 'nosniff'; } else { - $header_output[self::RESPONSE_X_CONTENT_TYPE_OPTIONS] = 'sniff'; + $header_output[static::RESPONSE_X_CONTENT_TYPE_OPTIONS] = 'sniff'; } } @@ -9639,14 +9649,14 @@ class c_base_http extends c_base_rfc_string { * @see: https://en.wikipedia.org/wiki/List_of_HTTP_header_fields */ private function p_prepare_header_response_x_ua_compatible($header_name, &$header_output) { - if (!array_key_exists(self::RESPONSE_X_UA_COMPATIBLE, $this->response)) { + if (!array_key_exists(static::RESPONSE_X_UA_COMPATIBLE, $this->response)) { return; } // in this case, a new header is created for every single entry. - $header_output[self::RESPONSE_X_UA_COMPATIBLE] = array(); - foreach($this->response[self::RESPONSE_X_UA_COMPATIBLE] as $browser_name => $compatible_version) { - $header_output[self::RESPONSE_X_UA_COMPATIBLE][] = $browser_name . '=' . $compatible_version; + $header_output[static::RESPONSE_X_UA_COMPATIBLE] = array(); + foreach($this->response[static::RESPONSE_X_UA_COMPATIBLE] as $browser_name => $compatible_version) { + $header_output[static::RESPONSE_X_UA_COMPATIBLE][] = $browser_name . '=' . $compatible_version; } unset($browser_name); unset($compatible_version); @@ -9672,31 +9682,31 @@ class c_base_http extends c_base_rfc_string { */ private function p_prepare_header_response_checksum_content($header_name, &$header_output) { // this field is generally auto-populated, so enforce a default. - if (!isset($this->response[self::RESPONSE_CHECKSUM_CONTENT])) { - $this->response[self::RESPONSE_CHECKSUM_CONTENT] = array( + if (!isset($this->response[static::RESPONSE_CHECKSUM_CONTENT])) { + $this->response[static::RESPONSE_CHECKSUM_CONTENT] = array( 'checksum' => NULL, - 'action' => self::CHECKSUM_ACTION_AUTO, - 'what' => self::CHECKSUM_WHAT_FULL, - 'type' => self::CHECKSUM_SHA256, + 'action' => static::CHECKSUM_ACTION_AUTO, + 'what' => static::CHECKSUM_WHAT_FULL, + 'type' => static::CHECKSUM_SHA256, ); } // setting this to none manually disables checksum generation. - if ($this->response[self::RESPONSE_CHECKSUM_CONTENT]['action'] == self::CHECKSUM_ACTION_NONE) { + if ($this->response[static::RESPONSE_CHECKSUM_CONTENT]['action'] == static::CHECKSUM_ACTION_NONE) { return; } $what = NULL; - if ($this->response[self::RESPONSE_CHECKSUM_CONTENT]['what'] == self::CHECKSUM_WHAT_FULL) { + if ($this->response[static::RESPONSE_CHECKSUM_CONTENT]['what'] == static::CHECKSUM_WHAT_FULL) { $what = 'full'; } - elseif ($this->response[self::RESPONSE_CHECKSUM_CONTENT]['what'] == self::CHECKSUM_WHAT_PARTIAL) { + elseif ($this->response[static::RESPONSE_CHECKSUM_CONTENT]['what'] == static::CHECKSUM_WHAT_PARTIAL) { $what = 'partial'; } - elseif ($this->response[self::RESPONSE_CHECKSUM_CONTENT]['what'] == self::CHECKSUM_WHAT_SIGNED) { + elseif ($this->response[static::RESPONSE_CHECKSUM_CONTENT]['what'] == static::CHECKSUM_WHAT_SIGNED) { $what = 'signed'; } - elseif ($this->response[self::RESPONSE_CHECKSUM_CONTENT]['what'] == self::CHECKSUM_WHAT_UNSIGNED) { + elseif ($this->response[static::RESPONSE_CHECKSUM_CONTENT]['what'] == static::CHECKSUM_WHAT_UNSIGNED) { $what = 'unsigned'; } @@ -9707,54 +9717,54 @@ class c_base_http extends c_base_rfc_string { $algorithm = NULL; $use_hash = FALSE; - switch ($this->response[self::RESPONSE_CHECKSUM_CONTENT]['type']) { - case self::CHECKSUM_MD2: + switch ($this->response[static::RESPONSE_CHECKSUM_CONTENT]['type']) { + case static::CHECKSUM_MD2: $algorithm = 'md2'; $use_hash = TRUE; break; - case self::CHECKSUM_MD4: + case static::CHECKSUM_MD4: $algorithm = 'md4'; $use_hash = TRUE; break; - case self::CHECKSUM_MD5: + case static::CHECKSUM_MD5: $algorithm = 'md5'; $use_hash = TRUE; break; - case self::CHECKSUM_SHA1: + case static::CHECKSUM_SHA1: $algorithm = 'sha1'; $use_hash = TRUE; break; - case self::CHECKSUM_SHA224: + case static::CHECKSUM_SHA224: $algorithm = 'sha224'; $use_hash = TRUE; break; - case self::CHECKSUM_SHA256: + case static::CHECKSUM_SHA256: $algorithm = 'sha256'; $use_hash = TRUE; break; - case self::CHECKSUM_SHA384: + case static::CHECKSUM_SHA384: $algorithm = 'sha384'; $use_hash = TRUE; break; - case self::CHECKSUM_SHA512: + case static::CHECKSUM_SHA512: $algorithm = 'sha512'; $use_hash = TRUE; break; - case self::CHECKSUM_CRC32: + case static::CHECKSUM_CRC32: $algorithm = 'crc32'; $use_hash = TRUE; break; - case self::CHECKSUM_CRC32B: + case static::CHECKSUM_CRC32B: $algorithm = 'crc32b'; $use_hash = TRUE; break; - case self::CHECKSUM_PG: + case static::CHECKSUM_PG: $algorithm = 'pg'; break; } // @todo: handle support for other algorithms. - if ($this->response[self::RESPONSE_CHECKSUM_CONTENT]['action'] == self::CHECKSUM_ACTION_AUTO) { + if ($this->response[static::RESPONSE_CHECKSUM_CONTENT]['action'] == static::CHECKSUM_ACTION_AUTO) { if ($this->content_is_file) { if ($use_hash) { $hash = hash_init($algorithm); @@ -9786,29 +9796,29 @@ class c_base_http extends c_base_rfc_string { unset($filename); unset($success); - $header_output[self::RESPONSE_CHECKSUM_CONTENT] = 'Checksum_Content: ' . $what . ':' . $algorithm . ':' . hash_final($hash, FALSE); + $header_output[static::RESPONSE_CHECKSUM_CONTENT] = 'Checksum_Content: ' . $what . ':' . $algorithm . ':' . hash_final($hash, FALSE); unset($hash); } else { // @todo: handle CHECKSUM_PG in this case. - // if ($this->response[self::RESPONSE_CHECKSUM_CONTENT]['type'] == self::CHECKSUM_PG) { + // if ($this->response[static::RESPONSE_CHECKSUM_CONTENT]['type'] == static::CHECKSUM_PG) { // } } } else { if ($use_hash) { - $header_output[self::RESPONSE_CHECKSUM_CONTENT] = 'Checksum_Content: ' . $what . ':' . $algorithm . ':' . hash($algorithm, $this->content); + $header_output[static::RESPONSE_CHECKSUM_CONTENT] = 'Checksum_Content: ' . $what . ':' . $algorithm . ':' . hash($algorithm, $this->content); } else { // @todo: handle CHECKSUM_PG in this case. - // if ($this->response[self::RESPONSE_CHECKSUM_CONTENT]['type'] == self::CHECKSUM_PG) { + // if ($this->response[static::RESPONSE_CHECKSUM_CONTENT]['type'] == static::CHECKSUM_PG) { // } } } } - elseif ($this->response[self::RESPONSE_CHECKSUM_CONTENT]['action'] == self::CHECKSUM_ACTION_MANUAL) { - if (!is_null($this->response[self::RESPONSE_CHECKSUM_CONTENT]['checksum'])) { - $header_output[self::RESPONSE_CHECKSUM_CONTENT] = 'Checksum_Content: ' . $what . ':' . $algorithm . ':' . $this->response[self::RESPONSE_CHECKSUM_CONTENT]['checksum']; + elseif ($this->response[static::RESPONSE_CHECKSUM_CONTENT]['action'] == static::CHECKSUM_ACTION_MANUAL) { + if (!is_null($this->response[static::RESPONSE_CHECKSUM_CONTENT]['checksum'])) { + $header_output[static::RESPONSE_CHECKSUM_CONTENT] = 'Checksum_Content: ' . $what . ':' . $algorithm . ':' . $this->response[static::RESPONSE_CHECKSUM_CONTENT]['checksum']; } } unset($use_hash); @@ -9839,27 +9849,27 @@ class c_base_http extends c_base_rfc_string { */ private function p_prepare_header_response_checksum_header($headers_name, $header_name, &$header_output, $status_string) { // this field is generally auto-populated, so enforce a default. - if (!isset($this->response[self::RESPONSE_CHECKSUM_HEADER])) { - $this->response[self::RESPONSE_CHECKSUM_HEADER] = array( + if (!isset($this->response[static::RESPONSE_CHECKSUM_HEADER])) { + $this->response[static::RESPONSE_CHECKSUM_HEADER] = array( 'checksum' => NULL, - 'action' => self::CHECKSUM_ACTION_AUTO, - 'what' => self::CHECKSUM_WHAT_FULL, - 'type' => self::CHECKSUM_SHA256, + 'action' => static::CHECKSUM_ACTION_AUTO, + 'what' => static::CHECKSUM_WHAT_FULL, + 'type' => static::CHECKSUM_SHA256, ); } // setting this to none manually disables checksum generation. - if ($this->response[self::RESPONSE_CHECKSUM_HEADER]['action'] == self::CHECKSUM_ACTION_NONE) { + if ($this->response[static::RESPONSE_CHECKSUM_HEADER]['action'] == static::CHECKSUM_ACTION_NONE) { return; } // allow for the list of headers to be customized, but if it is not defined, use all available (allowed) headers. - if (array_key_exists(self::RESPONSE_CHECKSUM_HEADERS, $this->response)) { + if (array_key_exists(static::RESPONSE_CHECKSUM_HEADERS, $this->response)) { $header_output_copy = array(); - $header_output[self::RESPONSE_CHECKSUM_HEADERS] = array(); - foreach ($this->response[self::RESPONSE_CHECKSUM_HEADERS] as $header_response_id => $header_response_value) { + $header_output[static::RESPONSE_CHECKSUM_HEADERS] = array(); + foreach ($this->response[static::RESPONSE_CHECKSUM_HEADERS] as $header_response_id => $header_response_value) { $header_output_copy[$header_response_id] = $header_response_id; - $header_output[self::RESPONSE_CHECKSUM_HEADERS][$header_response_id] = $header_response_id; + $header_output[static::RESPONSE_CHECKSUM_HEADERS][$header_response_id] = $header_response_id; } unset($header_response_id); unset($header_response_value); @@ -9877,8 +9887,8 @@ class c_base_http extends c_base_rfc_string { if (empty($header_output_copy)) { // if there are no headers to perform a checksum against, then provide no checksum. unset($header_output_copy); - unset($header_output[self::RESPONSE_CHECKSUM_HEADER]); - unset($header_output[self::RESPONSE_CHECKSUM_HEADERS]); + unset($header_output[static::RESPONSE_CHECKSUM_HEADER]); + unset($header_output[static::RESPONSE_CHECKSUM_HEADERS]); return; } @@ -9902,7 +9912,7 @@ class c_base_http extends c_base_rfc_string { unset($header_output_value); unset($header_mappings); - $header_output[self::RESPONSE_CHECKSUM_HEADERS] = $headers_name . self::SEPARATOR_HEADER_NAME . $header_string; + $header_output[static::RESPONSE_CHECKSUM_HEADERS] = $headers_name . static::SEPARATOR_HEADER_NAME . $header_string; unset($header_string); unset($header_output_copy); @@ -9916,19 +9926,19 @@ class c_base_http extends c_base_rfc_string { $header_string = ''; if (!is_null($status_string)) { - $header_string .= $status_string . self::SEPARATOR_HEADER_LINE; + $header_string .= $status_string . static::SEPARATOR_HEADER_LINE; } foreach ($header_output_copy as $header_output_id => $header_output_value) { if (array_key_exists($header_output_id, $header_output_copy)) { if (is_array($header_output_value)) { foreach ($header_output_value as $sub_header) { - $header_string .= $sub_header . self::SEPARATOR_HEADER_LINE; + $header_string .= $sub_header . static::SEPARATOR_HEADER_LINE; } unset($sub_header); } else { - $header_string .= $header_output_value . self::SEPARATOR_HEADER_LINE; + $header_string .= $header_output_value . static::SEPARATOR_HEADER_LINE; } } } @@ -9938,105 +9948,105 @@ class c_base_http extends c_base_rfc_string { // generate the checksum header based on given parameters when no pre-calculated checksum is given. - if ($this->response[self::RESPONSE_CHECKSUM_HEADER]['action'] == self::CHECKSUM_ACTION_AUTO) { - if ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_MD2) { + if ($this->response[static::RESPONSE_CHECKSUM_HEADER]['action'] == static::CHECKSUM_ACTION_AUTO) { + if ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_MD2) { $checkum_header = hash('md2', $header_string); } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_MD4) { + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_MD4) { $checkum_header = hash('md4', $header_string); } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_MD5) { + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_MD5) { $checkum_header = hash('md5', $header_string); } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_SHA1) { + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_SHA1) { $checkum_header = hash('sha1', $header_string); } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_SHA224) { + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_SHA224) { $checkum_header = hash('sha224', $header_string); } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_SHA256) { + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_SHA256) { $checkum_header = hash('sha256', $header_string); } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_SHA384) { + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_SHA384) { $checkum_header = hash('sha384', $header_string); } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_SHA512) { + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_SHA512) { $checkum_header = hash('sha512', $header_string); } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_CRC32) { + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_CRC32) { $checkum_header = hash('crc32', $header_string); } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_CRC32B) { + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_CRC32B) { $checkum_header = hash('crc32b', $header_string); } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_PG) { + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_PG) { // @todo: #$checkum_header = ; } unset($header_string); } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['action'] == self::CHECKSUM_ACTION_MANUAL) { - $checkum_header = $this->response[self::RESPONSE_CHECKSUM_HEADER]['checksum']; + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['action'] == static::CHECKSUM_ACTION_MANUAL) { + $checkum_header = $this->response[static::RESPONSE_CHECKSUM_HEADER]['checksum']; } else { return; } - $header_output[self::RESPONSE_CHECKSUM_HEADER] = $header_name . self::SEPARATOR_HEADER_NAME; + $header_output[static::RESPONSE_CHECKSUM_HEADER] = $header_name . static::SEPARATOR_HEADER_NAME; - if ($this->response[self::RESPONSE_CHECKSUM_HEADER]['what'] === self::CHECKSUM_WHAT_FULL) { - $header_output[self::RESPONSE_CHECKSUM_HEADER] .= 'full:'; + if ($this->response[static::RESPONSE_CHECKSUM_HEADER]['what'] === static::CHECKSUM_WHAT_FULL) { + $header_output[static::RESPONSE_CHECKSUM_HEADER] .= 'full:'; } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['what'] === self::CHECKSUM_WHAT_PARTIAL) { - $header_output[self::RESPONSE_CHECKSUM_HEADER] .= 'partial:'; - $checkum_header = mt_substr($checkum_header, 0, self::CHECKSUM_LENGTH_SHORTSUM); + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['what'] === static::CHECKSUM_WHAT_PARTIAL) { + $header_output[static::RESPONSE_CHECKSUM_HEADER] .= 'partial:'; + $checkum_header = mt_substr($checkum_header, 0, static::CHECKSUM_LENGTH_SHORTSUM); } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['what'] === self::CHECKSUM_WHAT_SIGNED) { - $header_output[self::RESPONSE_CHECKSUM_HEADER] .= 'signed:'; + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['what'] === static::CHECKSUM_WHAT_SIGNED) { + $header_output[static::RESPONSE_CHECKSUM_HEADER] .= 'signed:'; // @todo } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['what'] === self::CHECKSUM_WHAT_UNSIGNED) { - $header_output[self::RESPONSE_CHECKSUM_HEADER] .= 'unsigned:'; + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['what'] === static::CHECKSUM_WHAT_UNSIGNED) { + $header_output[static::RESPONSE_CHECKSUM_HEADER] .= 'unsigned:'; // @todo } - if ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_MD2) { - $header_output[self::RESPONSE_CHECKSUM_HEADER] .= 'md2:'; + if ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_MD2) { + $header_output[static::RESPONSE_CHECKSUM_HEADER] .= 'md2:'; } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_MD4) { - $header_output[self::RESPONSE_CHECKSUM_HEADER] .= 'md4:'; + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_MD4) { + $header_output[static::RESPONSE_CHECKSUM_HEADER] .= 'md4:'; } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_MD5) { - $header_output[self::RESPONSE_CHECKSUM_HEADER] .= 'md5:'; + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_MD5) { + $header_output[static::RESPONSE_CHECKSUM_HEADER] .= 'md5:'; } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_SHA1) { - $header_output[self::RESPONSE_CHECKSUM_HEADER] .= 'sha1:'; + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_SHA1) { + $header_output[static::RESPONSE_CHECKSUM_HEADER] .= 'sha1:'; } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_SHA224) { - $header_output[self::RESPONSE_CHECKSUM_HEADER] .= 'sha224:'; + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_SHA224) { + $header_output[static::RESPONSE_CHECKSUM_HEADER] .= 'sha224:'; } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_SHA256) { - $header_output[self::RESPONSE_CHECKSUM_HEADER] .= 'sha256:'; + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_SHA256) { + $header_output[static::RESPONSE_CHECKSUM_HEADER] .= 'sha256:'; } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_SHA384) { - $header_output[self::RESPONSE_CHECKSUM_HEADER] .= 'sha384:'; + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_SHA384) { + $header_output[static::RESPONSE_CHECKSUM_HEADER] .= 'sha384:'; } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_SHA512) { - $header_output[self::RESPONSE_CHECKSUM_HEADER] .= 'sha512:'; + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_SHA512) { + $header_output[static::RESPONSE_CHECKSUM_HEADER] .= 'sha512:'; } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_CRC32) { - $header_output[self::RESPONSE_CHECKSUM_HEADER] .= 'crc32:'; + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_CRC32) { + $header_output[static::RESPONSE_CHECKSUM_HEADER] .= 'crc32:'; } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_CRC32B) { - $header_output[self::RESPONSE_CHECKSUM_HEADER] .= 'crc32b:'; + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_CRC32B) { + $header_output[static::RESPONSE_CHECKSUM_HEADER] .= 'crc32b:'; } - elseif ($this->response[self::RESPONSE_CHECKSUM_HEADER]['type'] === self::CHECKSUM_PG) { + elseif ($this->response[static::RESPONSE_CHECKSUM_HEADER]['type'] === static::CHECKSUM_PG) { // @todo: #$checkum_header = ; } - $header_output[self::RESPONSE_CHECKSUM_HEADER] .= $checkum_header; + $header_output[static::RESPONSE_CHECKSUM_HEADER] .= $checkum_header; unset($checkum_header); } @@ -10055,7 +10065,7 @@ class c_base_http extends c_base_rfc_string { return; } - $header_output[$code] = $header_name . self::SEPARATOR_HEADER_NAME . $this->response[$code]; + $header_output[$code] = $header_name . static::SEPARATOR_HEADER_NAME . $this->response[$code]; } /** @@ -10073,7 +10083,7 @@ class c_base_http extends c_base_rfc_string { return; } - $header_output[$code] = $header_name . self::SEPARATOR_HEADER_NAME; + $header_output[$code] = $header_name . static::SEPARATOR_HEADER_NAME; if ($this->response[$code]) { $header_output[$code] .= 'true'; @@ -10103,7 +10113,7 @@ class c_base_http extends c_base_rfc_string { $timezone = date_default_timezone_get(); date_default_timezone_set('GMT'); - $header_output[$code] = $header_name . self::SEPARATOR_HEADER_NAME . c_base_defaults_global::s_get_date(self::TIMESTAMP_RFC_5322, $this->response[$code])->get_value_exact(); + $header_output[$code] = $header_name . static::SEPARATOR_HEADER_NAME . c_base_defaults_global::s_get_date(static::TIMESTAMP_RFC_5322, $this->response[$code])->get_value_exact(); date_default_timezone_set($timezone); unset($timezone); @@ -10116,29 +10126,29 @@ class c_base_http extends c_base_rfc_string { * The encoding to use. */ private function p_determine_response_encoding() { - if (!$this->request[self::REQUEST_ACCEPT_ENCODING]['defined'] || $this->request[self::REQUEST_ACCEPT_ENCODING]['invalid']) { - return self::ENCODING_CHUNKED; + if (!$this->request[static::REQUEST_ACCEPT_ENCODING]['defined'] || $this->request[static::REQUEST_ACCEPT_ENCODING]['invalid']) { + return static::ENCODING_CHUNKED; } - $encoding = self::ENCODING_CHUNKED; - foreach ($this->request[self::REQUEST_ACCEPT_ENCODING]['data']['weight'] as $weight => $choices) { + $encoding = static::ENCODING_CHUNKED; + foreach ($this->request[static::REQUEST_ACCEPT_ENCODING]['data']['weight'] as $weight => $choices) { foreach ($choices as $key => $choice) { if ($key == c_base_http::ENCODING_GZIP) { $encoding = $key; break 2; } - if ($key == self::ENCODING_DEFLATE) { + if ($key == static::ENCODING_DEFLATE) { $encoding = $key; break 2; } - if ($key == self::ENCODING_BZIP) { + if ($key == static::ENCODING_BZIP) { $encoding = $key; break 2; } - if ($key == self::ENCODING_LZO) { + if ($key == static::ENCODING_LZO) { $encoding = $key; break 2; } @@ -10179,7 +10189,7 @@ class c_base_http extends c_base_rfc_string { * @see: https://github.com/choden/php-xz */ private function p_encode_content($content, $encoding, $compression = NULL, $calculate_content_length = TRUE) { - if ($encoding == self::ENCODING_GZIP) { + if ($encoding == static::ENCODING_GZIP) { if (is_null($compression) || $compression < -1) { $compression = -1; } @@ -10189,15 +10199,15 @@ class c_base_http extends c_base_rfc_string { $this->content = gzencode($this->content, $compression, FORCE_GZIP); $this->content_is_file = FALSE; - $this->response[self::RESPONSE_CONTENT_ENCODING] = array($encoding); + $this->response[static::RESPONSE_CONTENT_ENCODING] = array($encoding); if ($calculate_content_length) { - $this->response[self::RESPONSE_CONTENT_LENGTH] = strlen($this->content); + $this->response[static::RESPONSE_CONTENT_LENGTH] = strlen($this->content); } return TRUE; } - elseif ($encoding == self::ENCODING_DEFLATE) { + elseif ($encoding == static::ENCODING_DEFLATE) { if (is_null($compression) || $compression < -1) { $compression = -1; } @@ -10207,15 +10217,15 @@ class c_base_http extends c_base_rfc_string { $this->content = gzencode($content, $compression, FORCE_DEFLATE); $this->content_is_file = FALSE; - $this->response[self::RESPONSE_CONTENT_ENCODING] = array($encoding); + $this->response[static::RESPONSE_CONTENT_ENCODING] = array($encoding); if ($calculate_content_length) { - $this->response[self::RESPONSE_CONTENT_LENGTH] = strlen($this->content); + $this->response[static::RESPONSE_CONTENT_LENGTH] = strlen($this->content); } return TRUE; } - elseif ($encoding == self::ENCODING_BZIP) { + elseif ($encoding == static::ENCODING_BZIP) { if (is_null($compression) || $compression < -1) { $compression = 4; } @@ -10225,15 +10235,15 @@ class c_base_http extends c_base_rfc_string { $this->content = bzcompress($content, $compression); $this->content_is_file = FALSE; - $this->response[self::RESPONSE_CONTENT_ENCODING] = array($encoding); + $this->response[static::RESPONSE_CONTENT_ENCODING] = array($encoding); if ($calculate_content_length) { - $this->response[self::RESPONSE_CONTENT_LENGTH] = strlen($this->content); + $this->response[static::RESPONSE_CONTENT_LENGTH] = strlen($this->content); } return TRUE; } - elseif ($encoding == self::ENCODING_LZO) { + elseif ($encoding == static::ENCODING_LZO) { switch ($compression) { case LZO1X_1: case LZO1_1: @@ -10280,27 +10290,27 @@ class c_base_http extends c_base_rfc_string { $this->content = lzo_compress($content, $compression); $this->content_is_file = FALSE; - $this->response[self::RESPONSE_CONTENT_ENCODING] = array($encoding); + $this->response[static::RESPONSE_CONTENT_ENCODING] = array($encoding); if ($calculate_content_length) { - $this->response[self::RESPONSE_CONTENT_LENGTH] = strlen($this->content); + $this->response[static::RESPONSE_CONTENT_LENGTH] = strlen($this->content); } return TRUE; } - elseif ($encoding == self::ENCODING_XZ) { + elseif ($encoding == static::ENCODING_XZ) { // @fixme: php-xz module is currently not working. } - elseif ($encoding == self::ENCODING_EXI) { + elseif ($encoding == static::ENCODING_EXI) { // @todo, maybe? (cannot seem to find a php library at this time) } - elseif ($encoding == self::ENCODING_IDENTITY) { + elseif ($encoding == static::ENCODING_IDENTITY) { // @todo, maybe? (cannot seem to find a php library at this time) } - elseif ($encoding == self::ENCODING_SDCH) { + elseif ($encoding == static::ENCODING_SDCH) { // @todo, maybe? (cannot seem to find a php library at this time) } - elseif ($encoding == self::ENCODING_PG) { + elseif ($encoding == static::ENCODING_PG) { // @todo, using ascii armor on entire body. // should be a header field containing the public key. } diff --git a/common/base/classes/base_http_status.php b/common/base/classes/base_http_status.php index 7b5a44c..5432d13 100644 --- a/common/base/classes/base_http_status.php +++ b/common/base/classes/base_http_status.php @@ -103,264 +103,264 @@ class c_base_http_status { $string = ""; switch ($status) { - case self::CONTINUE_REQUEST: + case static::CONTINUE_REQUEST: $string = "Continue Request"; break; - case self::SWITCHING_PROTOCOLS: + case static::SWITCHING_PROTOCOLS: $string = "Switching Protocols"; break; - case self::PROCESSING: + case static::PROCESSING: $string = "Processing"; break; - case self::OK: + case static::OK: $string = "OK"; break; - case self::CREATED: + case static::CREATED: $string = "Created"; break; - case self::ACCEPTED: + case static::ACCEPTED: $string = "Accepted"; break; - case self::NON_AUTHORATATIVE: + case static::NON_AUTHORATATIVE: $string = "Non-Authoratative"; break; - case self::NO_CONTENT: + case static::NO_CONTENT: $string = "No Content"; break; - case self::RESET_CONTENT: + case static::RESET_CONTENT: $string = "Reset Content"; break; - case self::PARTIAL_CONTENT: + case static::PARTIAL_CONTENT: $string = "Partial Content"; break; - case self::MULTI_STATUS: + case static::MULTI_STATUS: $string = "Multi-Status"; break; - case self::ALREADY_REPORTED: + case static::ALREADY_REPORTED: $string = "Already Reported"; break; - case self::IM_USED: + case static::IM_USED: $string = "IM Used"; break; - case self::MULTIPLE_CHOICES: + case static::MULTIPLE_CHOICES: $string = "Multiple Choices"; break; - case self::MOVED_PERMANENTLY: + case static::MOVED_PERMANENTLY: $string = "Moved Permanently"; break; - case self::FOUND: + case static::FOUND: $string = "Found"; break; - case self::SEE_OTHER: + case static::SEE_OTHER: $string = "See Other"; break; - case self::NOT_MODIFIED: + case static::NOT_MODIFIED: $string = "Not Modified"; break; - case self::USE_PROXY: + case static::USE_PROXY: $string = "Use Proxy"; break; - case self::SWITCH_PROXY: + case static::SWITCH_PROXY: $string = "Switch Proxy"; break; - case self::TEMPORARY_REDIRECT: + case static::TEMPORARY_REDIRECT: $string = "Temporary Redirect"; break; - case self::PERMANENT_REDIRECT: + case static::PERMANENT_REDIRECT: $string = "Permanent Redirect"; break; - case self::BAD_REQUEST: + case static::BAD_REQUEST: $string = "Bad Request"; break; - case self::UNAUTHORIZED: + case static::UNAUTHORIZED: $string = "Unauthorized"; break; - case self::PAYMENT_REQUIRED: + case static::PAYMENT_REQUIRED: $string = "Payment Required"; break; - case self::FORBIDDEN: + case static::FORBIDDEN: $string = "Forbidden"; break; - case self::NOT_FOUND: + case static::NOT_FOUND: $string = "Not Found"; break; - case self::METHOD_NOT_ALLOWED: + case static::METHOD_NOT_ALLOWED: $string = "Method Not Allowed"; break; - case self::NOT_ACCEPTABLE: + case static::NOT_ACCEPTABLE: $string = "Not Acceptable"; break; - case self::PROXY_AUTHENTICATION_REQUIRED: + case static::PROXY_AUTHENTICATION_REQUIRED: $string = "Proxy Authentication Required"; break; - case self::REQUEST_TIMEOUT: + case static::REQUEST_TIMEOUT: $string = "Request Timeout"; break; - case self::CONFLICT: + case static::CONFLICT: $string = "Conflict"; break; - case self::GONE: + case static::GONE: $string = "Gone"; break; - case self::LENGTH_REQUIRED: + case static::LENGTH_REQUIRED: $string = "Length Required"; break; - case self::PRECONDITION_FAILED: + case static::PRECONDITION_FAILED: $string = "Pre-condition Failed"; break; - case self::PAYLOAD_TOO_LARGE: + case static::PAYLOAD_TOO_LARGE: $string = "Payload Too Large"; break; - case self::REQUEST_URI_TOO_LONG: + case static::REQUEST_URI_TOO_LONG: $string = "Request URI Too Long"; break; - case self::UNSUPPORTED_MEDIA_TYPE: + case static::UNSUPPORTED_MEDIA_TYPE: $string = "Unsupported Media Type"; break; - case self::REQUESTED_RANGE_NOT_SATISFIABLE: + case static::REQUESTED_RANGE_NOT_SATISFIABLE: $string = "Requested Range Not Satisfiable"; break; - case self::EXPECTATION_FAILED: + case static::EXPECTATION_FAILED: $string = "Expectation Failed"; break; - case self::MISDIRECTED_REQUEST: + case static::MISDIRECTED_REQUEST: $string = "Misdirected Request"; break; - case self::LOCKED: + case static::LOCKED: $string = "Locked"; break; - case self::FAILED_DEPENDENCY: + case static::FAILED_DEPENDENCY: $string = "Failed Dependency"; break; - case self::UPGRADE_REQUIRED: + case static::UPGRADE_REQUIRED: $string = "Upgrade Required"; break; - case self::PRECONDITION_REQUIRED: + case static::PRECONDITION_REQUIRED: $string = "Pre-Condition Required"; break; - case self::TOO_MANY_REQUESTS: + case static::TOO_MANY_REQUESTS: $string = "Too Many Requests"; break; - case self::REQUEST_HEADER_FIELDS_TOO_LARGE: + case static::REQUEST_HEADER_FIELDS_TOO_LARGE: $string = "Request Header Fields Too Large"; break; - case self::NO_RESPONSE: + case static::NO_RESPONSE: $string = "No Response"; break; - case self::UNAVAILABLE_FOR_LEGAL_REASONS: + case static::UNAVAILABLE_FOR_LEGAL_REASONS: $string = "Unavailable for Legal Reasons"; break; - case self::SSL_CERTIFICATE_ERROR: + case static::SSL_CERTIFICATE_ERROR: $string = "SSL Certificate Error"; break; - case self::HTTP_REQUEST_SENT_TO_HTTPS: + case static::HTTP_REQUEST_SENT_TO_HTTPS: $string = "HTTP Request Sent to HTTPS Port"; break; - case self::CLIENT_CLOSED_REQUEST: + case static::CLIENT_CLOSED_REQUEST: $string = "Client Closed Request"; break; - case self::INTERNAL_SERVER_ERROR: + case static::INTERNAL_SERVER_ERROR: $string = "Internal Server Error"; break; - case self::NOT_IMPLEMENTED: + case static::NOT_IMPLEMENTED: $string = "Not Implemented"; break; - case self::BAD_GATEWAY: + case static::BAD_GATEWAY: $string = "Bad Gateway"; break; - case self::SERVICE_UNAVAILABLE: + case static::SERVICE_UNAVAILABLE: $string = "Service Unavailable"; break; - case self::GATEWAY_TIMEOUT: + case static::GATEWAY_TIMEOUT: $string = "Gateway Timeout"; break; - case self::HTTP_VERSION_NOT_SUPPORTED: + case static::HTTP_VERSION_NOT_SUPPORTED: $string = "HTTP Version Not Supported"; break; - case self::VARIANT_ALSO_NEGOTIATES: + case static::VARIANT_ALSO_NEGOTIATES: $string = "Variant Also Negotiates"; break; - case self::INSUFFICIENT_STORAGE: + case static::INSUFFICIENT_STORAGE: $string = "Unsufficient Storage"; break; - case self::LOOP_DETECTED: + case static::LOOP_DETECTED: $string = "Loop Detected"; break; - case self::NOT_EXTENDED: + case static::NOT_EXTENDED: $string = "Not Extended"; break; - case self::NETWORK_AUTHENTICATION_REQUIRED: + case static::NETWORK_AUTHENTICATION_REQUIRED: $string = "Network Authentication Required"; break; - case self::UNDEFINED: - case self::UNKNOWN: + case static::UNDEFINED: + case static::UNKNOWN: $string = ""; break; - case self::INVALID: + case static::INVALID: // invalid will not be processed because it is invalid. default: diff --git a/common/base/classes/base_log.php b/common/base/classes/base_log.php index d14bbef..6a783f3 100644 --- a/common/base/classes/base_log.php +++ b/common/base/classes/base_log.php @@ -77,8 +77,8 @@ class c_base_log extends c_base_return_array { public function __construct() { parent::__construct(); - $this->type = self::TYPE_NONE; - $this->type_sub = self::TYPE_NONE; + $this->type = static::TYPE_NONE; + $this->type_sub = static::TYPE_NONE; $this->severity = c_base_error::SEVERITY_NONE; $this->facility = c_base_error::FACILITY_NONE; @@ -209,7 +209,7 @@ class c_base_log extends c_base_return_array { */ public function get_type() { if (!is_int($this->type)) { - $this->type = self::TYPE_NONE; + $this->type = static::TYPE_NONE; } return c_base_return_int::s_new($this->type); @@ -224,7 +224,7 @@ class c_base_log extends c_base_return_array { */ public function get_type_sub() { if (!is_int($this->type_sub)) { - $this->type_sub = self::TYPE_NONE; + $this->type_sub = static::TYPE_NONE; } return c_base_return_int::s_new($this->type_sub); diff --git a/common/base/classes/base_markup.php b/common/base/classes/base_markup.php index 4470eea..ae3510b 100644 --- a/common/base/classes/base_markup.php +++ b/common/base/classes/base_markup.php @@ -552,7 +552,7 @@ class c_base_markup_tag extends c_base_rfc_string { $this->tags = array(); $this->tags_total = 0; $this->text = NULL; - $this->type = self::TYPE_TEXT; + $this->type = static::TYPE_TEXT; } /** @@ -1772,7 +1772,7 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function get_type() { if (!isset($this->type)) { - $this->type = self::TYPE_NONE; + $this->type = static::TYPE_NONE; } return c_base_return_int::s_new($this->type); diff --git a/common/base/classes/base_mime.php b/common/base/classes/base_mime.php index 7e81740..1c02547 100644 --- a/common/base/classes/base_mime.php +++ b/common/base/classes/base_mime.php @@ -286,32 +286,32 @@ class c_base_mime { if (is_null($category)) { $result = NULL; - if (array_key_exists($id, self::$s_names_provided)) { - return c_base_return_array::s_new(self::$s_names_provided[$id]); + if (array_key_exists($id, static::$s_names_provided)) { + return c_base_return_array::s_new(static::$s_names_provided[$id]); } - if (array_key_exists($id, self::$s_names_text)) { - return c_base_return_array::s_new(self::$s_names_text[$id]); + if (array_key_exists($id, static::$s_names_text)) { + return c_base_return_array::s_new(static::$s_names_text[$id]); } - if (array_key_exists($id, self::$s_names_audio)) { - return c_base_return_array::s_new(self::$s_names_audio[$id]); + if (array_key_exists($id, static::$s_names_audio)) { + return c_base_return_array::s_new(static::$s_names_audio[$id]); } - if (array_key_exists($id, self::$s_names_video)) { - return c_base_return_array::s_new(self::$s_names_video[$id]); + if (array_key_exists($id, static::$s_names_video)) { + return c_base_return_array::s_new(static::$s_names_video[$id]); } - if (array_key_exists($id, self::$s_names_document)) { - return c_base_return_array::s_new(self::$s_names_document[$id]); + if (array_key_exists($id, static::$s_names_document)) { + return c_base_return_array::s_new(static::$s_names_document[$id]); } - if (array_key_exists($id, self::$s_names_container)) { - return c_base_return_array::s_new(self::$s_names_container[$id]); + if (array_key_exists($id, static::$s_names_container)) { + return c_base_return_array::s_new(static::$s_names_container[$id]); } - if (array_key_exists($id, self::$s_names_application)) { - return c_base_return_array::s_new(self::$s_names_application[$id]); + if (array_key_exists($id, static::$s_names_application)) { + return c_base_return_array::s_new(static::$s_names_application[$id]); } } else { @@ -320,44 +320,44 @@ class c_base_mime { return c_base_return_error::s_false($error); } - if ($category == self::CATEGORY_PROVIDED) { - if (array_key_exists($id, self::$s_names_provided)) { - return c_base_return_array::s_new(self::$s_names_provided[$id]); + if ($category == static::CATEGORY_PROVIDED) { + if (array_key_exists($id, static::$s_names_provided)) { + return c_base_return_array::s_new(static::$s_names_provided[$id]); } } - elseif ($category == self::CATEGORY_TEXT) { - if (array_key_exists($id, self::$s_names_text)) { - return c_base_return_array::s_new(self::$s_names_text[$id]); + elseif ($category == static::CATEGORY_TEXT) { + if (array_key_exists($id, static::$s_names_text)) { + return c_base_return_array::s_new(static::$s_names_text[$id]); } } - elseif ($category == self::CATEGORY_IMAGE) { - if (array_key_exists($id, self::$s_names_text)) { - return c_base_return_array::s_new(self::$s_names_text[$id]); + elseif ($category == static::CATEGORY_IMAGE) { + if (array_key_exists($id, static::$s_names_text)) { + return c_base_return_array::s_new(static::$s_names_text[$id]); } } - elseif ($category == self::CATEGORY_AUDIO) { - if (array_key_exists($id, self::$s_names_audio)) { - return c_base_return_array::s_new(self::$s_names_audio[$id]); + elseif ($category == static::CATEGORY_AUDIO) { + if (array_key_exists($id, static::$s_names_audio)) { + return c_base_return_array::s_new(static::$s_names_audio[$id]); } } - elseif ($category == self::CATEGORY_VIDEO) { - if (array_key_exists($id, self::$s_names_video)) { - return c_base_return_array::s_new(self::$s_names_video[$id]); + elseif ($category == static::CATEGORY_VIDEO) { + if (array_key_exists($id, static::$s_names_video)) { + return c_base_return_array::s_new(static::$s_names_video[$id]); } } - elseif ($category == self::CATEGORY_DOCUMENT) { - if (array_key_exists($id, self::$s_names_document)) { - return c_base_return_array::s_new(self::$s_names_document[$id]); + elseif ($category == static::CATEGORY_DOCUMENT) { + if (array_key_exists($id, static::$s_names_document)) { + return c_base_return_array::s_new(static::$s_names_document[$id]); } } - elseif ($category == self::CATEGORY_CONTAINER) { - if (array_key_exists($id, self::$s_names_container)) { - return c_base_return_array::s_new(self::$s_names_container[$id]); + elseif ($category == static::CATEGORY_CONTAINER) { + if (array_key_exists($id, static::$s_names_container)) { + return c_base_return_array::s_new(static::$s_names_container[$id]); } } - elseif ($category == self::CATEGORY_APPLICATION) { - if (array_key_exists($id, self::$s_names_application)) { - return c_base_return_array::s_new(self::$s_names_application[$id]); + elseif ($category == static::CATEGORY_APPLICATION) { + if (array_key_exists($id, static::$s_names_application)) { + return c_base_return_array::s_new(static::$s_names_application[$id]); } } } @@ -404,8 +404,8 @@ class c_base_mime { } $information = array( - 'id_category' => self::CATEGORY_PROVIDED, - 'id_type' => self::TYPE_PROVIDED, + 'id_category' => static::CATEGORY_PROVIDED, + 'id_type' => static::TYPE_PROVIDED, 'name_category' => '*', 'name_type' => '*', ); @@ -428,232 +428,232 @@ class c_base_mime { $information['name_type'] = $parts[1]; if ($parts[0] == 'text') { - $information['id_category'] = self::CATEGORY_TEXT; + $information['id_category'] = static::CATEGORY_TEXT; if ($parts[1] == '*') { // nothing to change. } elseif ($parts[1] == 'html') { - $information['id_type'] = self::TYPE_TEXT_HTML; + $information['id_type'] = static::TYPE_TEXT_HTML; } elseif ($parts[1] == 'plain') { - $information['id_type'] = self::TYPE_TEXT_PLAIN; + $information['id_type'] = static::TYPE_TEXT_PLAIN; } elseif ($parts[1] == 'calendar') { - $information['id_type'] = self::TYPE_TEXT_ICAL; + $information['id_type'] = static::TYPE_TEXT_ICAL; } elseif ($parts[1] == 'csv') { - $information['id_type'] = self::TYPE_TEXT_CSV; + $information['id_type'] = static::TYPE_TEXT_CSV; } elseif ($parts[1] == 'xml') { - $information['id_type'] = self::TYPE_TEXT_XML; + $information['id_type'] = static::TYPE_TEXT_XML; } elseif ($parts[1] == 'css') { - $information['id_type'] = self::TYPE_TEXT_CSS; + $information['id_type'] = static::TYPE_TEXT_CSS; } elseif ($parts[1] == 'rtf') { - $information['id_type'] = self::TYPE_TEXT_RICH; + $information['id_type'] = static::TYPE_TEXT_RICH; } elseif ($parts[1] == 'javascript') { - $information['id_type'] = self::TYPE_TEXT_JS; + $information['id_type'] = static::TYPE_TEXT_JS; } else { - $information['id_type'] = self::TYPE_UNKNOWN; + $information['id_type'] = static::TYPE_UNKNOWN; } } elseif ($parts[0] == 'application') { - $information['id_category'] = self::CATEGORY_APPLICATION; + $information['id_category'] = static::CATEGORY_APPLICATION; if ($parts[1] == '*') { // nothing to change. } elseif ($parts[1] == 'octet-stream') { - $information['id_category'] = self::CATEGORY_STREAM; - $information['id_type'] = self::TYPE_STREAM; + $information['id_category'] = static::CATEGORY_STREAM; + $information['id_type'] = static::TYPE_STREAM; } elseif ($parts[1] == 'pdf') { - $information['id_category'] = self::CATEGORY_DOCUMENT; - $information['id_type'] = self::TYPE_APPLICATION_PDF; + $information['id_category'] = static::CATEGORY_DOCUMENT; + $information['id_type'] = static::TYPE_APPLICATION_PDF; } elseif ($parts[1] == 'rss' || $parts[1] == 'rss+xml' || $parts[1] == 'rdf+xml' || $parts[1] == 'atom+xml') { - $information['id_category'] = self::CATEGORY_TEXT; - $information['id_type'] = self::TYPE_TEXT_RSS; + $information['id_category'] = static::CATEGORY_TEXT; + $information['id_type'] = static::TYPE_TEXT_RSS; } elseif ($parts[1] == 'xml') { - $information['id_category'] = self::CATEGORY_TEXT; - $information['id_type'] = self::TYPE_TEXT_XML; + $information['id_category'] = static::CATEGORY_TEXT; + $information['id_type'] = static::TYPE_TEXT_XML; } elseif ($parts[1] == 'javascript') { - $information['id_category'] = self::CATEGORY_TEXT; - $information['id_type'] = self::TYPE_TEXT_JS; + $information['id_category'] = static::CATEGORY_TEXT; + $information['id_type'] = static::TYPE_TEXT_JS; } elseif ($parts[1] == 'json') { - $information['id_category'] = self::CATEGORY_TEXT; - $information['id_type'] = self::TYPE_TEXT_JSON; + $information['id_category'] = static::CATEGORY_TEXT; + $information['id_type'] = static::TYPE_TEXT_JSON; } elseif ($parts[1] == 'xhtml' || $parts[1] == 'xhtml+xml') { - $information['id_category'] = self::CATEGORY_TEXT; - $information['id_type'] = self::TYPE_TEXT_XHTML; + $information['id_category'] = static::CATEGORY_TEXT; + $information['id_type'] = static::TYPE_TEXT_XHTML; } elseif ($parts[1] == 'ps') { - $information['id_category'] = self::CATEGORY_TEXT; - $information['id_type'] = self::TYPE_TEXT_PS; + $information['id_category'] = static::CATEGORY_TEXT; + $information['id_type'] = static::TYPE_TEXT_PS; } elseif ($parts[1] == 'tar') { - $information['id_category'] = self::CATEGORY_CONTAINER; - $information['id_type'] = self::TYPE_CONTAINER_TAR; + $information['id_category'] = static::CATEGORY_CONTAINER; + $information['id_type'] = static::TYPE_CONTAINER_TAR; } elseif ($parts[1] == 'cpio') { - $information['id_category'] = self::CATEGORY_CONTAINER; - $information['id_type'] = self::TYPE_CONTAINER_CPIO; + $information['id_category'] = static::CATEGORY_CONTAINER; + $information['id_type'] = static::TYPE_CONTAINER_CPIO; } elseif ($parts[1] == 'vnd.oasis.opendocument.chart') { - $information['id_category'] = self::CATEGORY_DOCUMENT; - $information['id_type'] = self::TYPE_DOCUMENT_LIBRECHART; + $information['id_category'] = static::CATEGORY_DOCUMENT; + $information['id_type'] = static::TYPE_DOCUMENT_LIBRECHART; } elseif ($parts[1] == 'vnd.oasis.opendocument.formula') { - $information['id_category'] = self::CATEGORY_DOCUMENT; - $information['id_type'] = self::TYPE_DOCUMENT_LIBREFORMULA; + $information['id_category'] = static::CATEGORY_DOCUMENT; + $information['id_type'] = static::TYPE_DOCUMENT_LIBREFORMULA; } elseif ($parts[1] == 'vnd.oasis.opendocument.graphics') { - $information['id_category'] = self::CATEGORY_DOCUMENT; - $information['id_type'] = self::TYPE_DOCUMENT_LIBREGRAPHIC; + $information['id_category'] = static::CATEGORY_DOCUMENT; + $information['id_type'] = static::TYPE_DOCUMENT_LIBREGRAPHIC; } elseif ($parts[1] == 'vnd.oasis.opendocument.presentation') { - $information['id_category'] = self::CATEGORY_DOCUMENT; - $information['id_type'] = self::TYPE_DOCUMENT_LIBREPRESENTATION; + $information['id_category'] = static::CATEGORY_DOCUMENT; + $information['id_type'] = static::TYPE_DOCUMENT_LIBREPRESENTATION; } elseif ($parts[1] == 'vnd.oasis.opendocument.spreadsheet') { - $information['id_category'] = self::CATEGORY_DOCUMENT; - $information['id_type'] = self::TYPE_DOCUMENT_LIBRESPREADSHEET; + $information['id_category'] = static::CATEGORY_DOCUMENT; + $information['id_type'] = static::TYPE_DOCUMENT_LIBRESPREADSHEET; } elseif ($parts[1] == 'vnd.oasis.opendocument.text') { - $information['id_category'] = self::CATEGORY_DOCUMENT; - $information['id_type'] = self::TYPE_DOCUMENT_LIBRETEXT; + $information['id_category'] = static::CATEGORY_DOCUMENT; + $information['id_type'] = static::TYPE_DOCUMENT_LIBRETEXT; } elseif ($parts[1] == 'vnd.oasis.opendocument.text-web') { - $information['id_category'] = self::CATEGORY_DOCUMENT; - $information['id_type'] = self::TYPE_DOCUMENT_LIBREHTML; + $information['id_category'] = static::CATEGORY_DOCUMENT; + $information['id_type'] = static::TYPE_DOCUMENT_LIBREHTML; } elseif ($parts[1] == 'abiword' || $parts[1] == 'abiword-compressed') { - $information['id_category'] = self::CATEGORY_DOCUMENT; - $information['id_type'] = self::TYPE_DOCUMENT_ABIWORD; + $information['id_category'] = static::CATEGORY_DOCUMENT; + $information['id_type'] = static::TYPE_DOCUMENT_ABIWORD; } elseif ($parts[1] == 'msword' || $parts[1] == 'vnd.openxmlformats-officedocument.wordprocessingml.document') { - $information['id_category'] = self::CATEGORY_DOCUMENT; - $information['id_type'] = self::TYPE_DOCUMENT_MSWORD; + $information['id_category'] = static::CATEGORY_DOCUMENT; + $information['id_type'] = static::TYPE_DOCUMENT_MSWORD; } elseif ($parts[1] == 'ms-excel' || $parts[1] == 'vnd.openxmlformats-officedocument.spreadsheetml.sheet') { - $information['id_category'] = self::CATEGORY_DOCUMENT; - $information['id_type'] = self::TYPE_DOCUMENT_MSEXCEL; + $information['id_category'] = static::CATEGORY_DOCUMENT; + $information['id_type'] = static::TYPE_DOCUMENT_MSEXCEL; } elseif ($parts[1] == 'ms-powerpoint' || $parts[1] == 'vnd.openxmlformats-officedocument.presentationml.presentation') { - $information['id_category'] = self::CATEGORY_DOCUMENT; - $information['id_type'] = self::TYPE_DOCUMENT_MSPOWERPOINT; + $information['id_category'] = static::CATEGORY_DOCUMENT; + $information['id_type'] = static::TYPE_DOCUMENT_MSPOWERPOINT; } elseif ($parts[1] == 'java') { - $information['id_category'] = self::CATEGORY_CONTAINER; - $information['id_type'] = self::TYPE_CONTAINER_JAVA; + $information['id_category'] = static::CATEGORY_CONTAINER; + $information['id_type'] = static::TYPE_CONTAINER_JAVA; } elseif ($parts[1] == 'ocsp-request') { - $information['id_category'] = self::CATEGORY_APPLICATION; - $information['id_type'] = self::TYPE_PACKET_OCSP_REQUEST; + $information['id_category'] = static::CATEGORY_APPLICATION; + $information['id_type'] = static::TYPE_PACKET_OCSP_REQUEST; } elseif ($parts[1] == 'ocsp-response') { - $information['id_category'] = self::CATEGORY_APPLICATION; - $information['id_type'] = self::TYPE_PACKET_OCSP_RESPONSE; + $information['id_category'] = static::CATEGORY_APPLICATION; + $information['id_type'] = static::TYPE_PACKET_OCSP_RESPONSE; } else { - $information['id_type'] = self::TYPE_UNKNOWN; + $information['id_type'] = static::TYPE_UNKNOWN; } } elseif ($parts[0] == 'image') { - $information['id_category'] = self::CATEGORY_IMAGE; + $information['id_category'] = static::CATEGORY_IMAGE; if ($parts[1] == '*') { // nothing to change. } elseif ($parts[1] == 'png') { - $information['id_type'] = self::TYPE_IMAGE_PNG; + $information['id_type'] = static::TYPE_IMAGE_PNG; } elseif ($parts[1] == 'jpeg' || $parts[1] == 'jpg' || $parts[1] == 'jpx') { - $information['id_type'] = self::TYPE_IMAGE_JPEG; + $information['id_type'] = static::TYPE_IMAGE_JPEG; } elseif ($parts[1] == 'gif') { - $information['id_type'] = self::TYPE_IMAGE_GIF; + $information['id_type'] = static::TYPE_IMAGE_GIF; } elseif ($parts[1] == 'bmp') { - $information['id_type'] = self::TYPE_IMAGE_BMP; + $information['id_type'] = static::TYPE_IMAGE_BMP; } elseif ($parts[1] == 'svg') { - $information['id_type'] = self::TYPE_IMAGE_SVG; + $information['id_type'] = static::TYPE_IMAGE_SVG; } elseif ($parts[1] == 'tiff' || $parts[1] == 'tiff-fx') { - $information['id_type'] = self::TYPE_IMAGE_TIFF; + $information['id_type'] = static::TYPE_IMAGE_TIFF; } else { - $information['id_type'] = self::TYPE_UNKNOWN; + $information['id_type'] = static::TYPE_UNKNOWN; } } elseif ($parts[0] == 'audio') { - $information['id_category'] = self::CATEGORY_AUDIO; + $information['id_category'] = static::CATEGORY_AUDIO; if ($parts[1] == '*') { // nothing to change. } elseif ($parts[1] == 'ogg') { - $information['id_type'] = self::TYPE_AUDIO_OGG; + $information['id_type'] = static::TYPE_AUDIO_OGG; } elseif ($parts[1] == 'mpeg') { - $information['id_type'] = self::TYPE_AUDIO_MP3; + $information['id_type'] = static::TYPE_AUDIO_MP3; } elseif ($parts[1] == 'mp4') { - $information['id_type'] = self::TYPE_AUDIO_MP4; + $information['id_type'] = static::TYPE_AUDIO_MP4; } elseif ($parts[1] == 'wav') { - $information['id_type'] = self::TYPE_AUDIO_WAV; + $information['id_type'] = static::TYPE_AUDIO_WAV; } elseif ($parts[1] == 'midi') { - $information['id_type'] = self::TYPE_AUDIO_MIDI; + $information['id_type'] = static::TYPE_AUDIO_MIDI; } else { - $information['id_type'] = self::TYPE_UNKNOWN; + $information['id_type'] = static::TYPE_UNKNOWN; } } elseif ($parts[0] == 'video') { - $information['id_category'] = self::CATEGORY_VIDEO; + $information['id_category'] = static::CATEGORY_VIDEO; if ($parts[1] == '*') { // nothing to change. } elseif ($parts[1] == 'mp4' || $parts[1] == 'mpeg') { - $information['id_type'] = self::TYPE_VIDEO_MPEG; + $information['id_type'] = static::TYPE_VIDEO_MPEG; } elseif ($parts[1] == 'ogg') { - $information['id_type'] = self::TYPE_VIDEO_OGG; + $information['id_type'] = static::TYPE_VIDEO_OGG; } elseif ($parts[1] == 'h264') { - $information['id_type'] = self::TYPE_VIDEO_H264; + $information['id_type'] = static::TYPE_VIDEO_H264; } elseif ($parts[1] == 'quicktime') { - $information['id_type'] = self::TYPE_VIDEO_QUICKTIME; + $information['id_type'] = static::TYPE_VIDEO_QUICKTIME; } elseif ($parts[1] == 'dv') { - $information['id_type'] = self::TYPE_VIDEO_DV; + $information['id_type'] = static::TYPE_VIDEO_DV; } elseif ($parts[1] == 'jpeg' || $parts[1] == 'jpeg2000') { - $information['id_type'] = self::TYPE_VIDEO_JPEG; + $information['id_type'] = static::TYPE_VIDEO_JPEG; } elseif ($parts[1] == 'webm') { - $information['id_type'] = self::TYPE_VIDEO_WEBM; + $information['id_type'] = static::TYPE_VIDEO_WEBM; } else { - $information['id_type'] = self::TYPE_UNKNOWN; + $information['id_type'] = static::TYPE_UNKNOWN; } } else { - $information['id_category'] = self::CATEGORY_UNKNOWN; - $information['id_type'] = self::TYPE_UNKNOWN; + $information['id_category'] = static::CATEGORY_UNKNOWN; + $information['id_type'] = static::TYPE_UNKNOWN; } unset($parts); diff --git a/common/base/classes/base_path.php b/common/base/classes/base_path.php index 30feb6f..fc0bacf 100644 --- a/common/base/classes/base_path.php +++ b/common/base/classes/base_path.php @@ -688,7 +688,7 @@ class c_base_path extends c_base_rfc_string { } if (!is_array($this->sanitize_html)) { - $this->sanitize_html = self::DEFAULT_SANITIZE_HTML; + $this->sanitize_html = static::DEFAULT_SANITIZE_HTML; } if (!is_null($flags)) { @@ -939,7 +939,7 @@ class c_base_path extends c_base_rfc_string { */ public function get_allowed_methods() { if (!is_array($this->allowed_methods)) { - $this->allowed_methods = self::DEFAULT_ALLOWED_METHODS; + $this->allowed_methods = static::DEFAULT_ALLOWED_METHODS; } return c_base_return_array::s_new($this->allowed_methods); @@ -956,7 +956,7 @@ class c_base_path extends c_base_rfc_string { */ public function get_sanitize_html() { if (!is_array($this->sanitize_html)) { - $this->sanitize_html = self::DEFAULT_SANITIZE_HTML; + $this->sanitize_html = static::DEFAULT_SANITIZE_HTML; } return c_base_return_array::s_new($this->sanitize_html); diff --git a/common/base/classes/base_rfc_string.php b/common/base/classes/base_rfc_string.php index 7889582..5333f1f 100644 --- a/common/base/classes/base_rfc_string.php +++ b/common/base/classes/base_rfc_string.php @@ -195,7 +195,7 @@ abstract class c_base_rfc_string extends c_base_rfc_char { $stop_at_closing_quote = FALSE; if ($stop < 0) { - if ($stop == self::STOP_AT_CLOSING_CHARACTER) { + if ($stop == static::STOP_AT_CLOSING_CHARACTER) { $stop_at_closing_quote = TRUE; } @@ -734,7 +734,7 @@ abstract class c_base_rfc_string extends c_base_rfc_char { break; } - $parsed = $this->pr_rfc_string_is_quoted_string($ordinals, $characters, $result['current'], self::STOP_AT_CLOSING_CHARACTER); + $parsed = $this->pr_rfc_string_is_quoted_string($ordinals, $characters, $result['current'], static::STOP_AT_CLOSING_CHARACTER); $result['current'] = $parsed['current']; if ($parsed['invalid']) { @@ -907,7 +907,7 @@ abstract class c_base_rfc_string extends c_base_rfc_char { return $result; } - $parsed = $this->pr_rfc_string_is_quoted_string($ordinals, $characters, $result['current'], self::STOP_AT_CLOSING_CHARACTER); + $parsed = $this->pr_rfc_string_is_quoted_string($ordinals, $characters, $result['current'], static::STOP_AT_CLOSING_CHARACTER); $result['current'] = $parsed['current']; if ($parsed['invalid']) { @@ -1786,7 +1786,7 @@ abstract class c_base_rfc_string extends c_base_rfc_char { break; } - $parsed = $this->pr_rfc_string_is_quoted_string($ordinals, $characters, $result['current'], self::STOP_AT_CLOSING_CHARACTER); + $parsed = $this->pr_rfc_string_is_quoted_string($ordinals, $characters, $result['current'], static::STOP_AT_CLOSING_CHARACTER); $result['current'] = $parsed['current']; if ($parsed['invalid']) { @@ -2069,7 +2069,7 @@ abstract class c_base_rfc_string extends c_base_rfc_char { break; } - $parsed = $this->pr_rfc_string_is_quoted_string($ordinals, $characters, $result['current'], self::STOP_AT_CLOSING_CHARACTER); + $parsed = $this->pr_rfc_string_is_quoted_string($ordinals, $characters, $result['current'], static::STOP_AT_CLOSING_CHARACTER); $result['current'] = $parsed['current']; if ($parsed['invalid']) { @@ -2269,7 +2269,7 @@ abstract class c_base_rfc_string extends c_base_rfc_char { break; } - $parsed = $this->pr_rfc_string_is_quoted_string($ordinals, $characters, $result['current'], self::STOP_AT_CLOSING_CHARACTER); + $parsed = $this->pr_rfc_string_is_quoted_string($ordinals, $characters, $result['current'], static::STOP_AT_CLOSING_CHARACTER); $result['current'] = $parsed['current']; if ($parsed['invalid']) { diff --git a/common/base/classes/base_roles.php b/common/base/classes/base_roles.php index 76b160f..9dde111 100644 --- a/common/base/classes/base_roles.php +++ b/common/base/classes/base_roles.php @@ -150,7 +150,7 @@ class c_base_roles extends c_base_return { return c_base_return_error::s_false($error); } - if ($role === self::NONE) { + if ($role === static::NONE) { if ($value) { $this->public = FALSE; $this->system = FALSE; @@ -167,43 +167,43 @@ class c_base_roles extends c_base_return { $this->administer = FALSE; } } - elseif ($role === self::PUBLIC) { + elseif ($role === static::PUBLIC) { $this->public = $value; } - elseif ($role === self::SYSTEM) { + elseif ($role === static::SYSTEM) { $this->system = $value; } - elseif ($role === self::USER) { + elseif ($role === static::USER) { $this->user = $value; } - elseif ($role === self::REQUESTER) { + elseif ($role === static::REQUESTER) { $this->requester = $value; } - elseif ($role === self::DRAFTER) { + elseif ($role === static::DRAFTER) { $this->drafter = $value; } - elseif ($role === self::EDITOR) { + elseif ($role === static::EDITOR) { $this->editer = $value; } - elseif ($role === self::REVIEWER) { + elseif ($role === static::REVIEWER) { $this->reviewer = $value; } - elseif ($role === self::INSURER) { + elseif ($role === static::INSURER) { $this->insurer = $value; } - elseif ($role === self::FINANCER) { + elseif ($role === static::FINANCER) { $this->financer = $value; } - elseif ($role === self::PUBLISHER) { + elseif ($role === static::PUBLISHER) { $this->publisher = $value; } - elseif ($role === self::AUDITOR) { + elseif ($role === static::AUDITOR) { $this->auditor = $value; } - elseif ($role === self::MANAGER) { + elseif ($role === static::MANAGER) { $this->manager = $value; } - elseif ($role === self::ADMINISTER) { + elseif ($role === static::ADMINISTER) { $this->administer = $value; } else { @@ -247,43 +247,43 @@ class c_base_roles extends c_base_return { $this->administer = FALSE; foreach ($roles as $role) { - if ($role === self::PUBLIC) { + if ($role === static::PUBLIC) { $this->public = TRUE; } - elseif ($role === self::SYSTEM) { + elseif ($role === static::SYSTEM) { $this->system = TRUE; } - elseif ($role === self::USER) { + elseif ($role === static::USER) { $this->user = TRUE; } - elseif ($role === self::REQUESTER) { + elseif ($role === static::REQUESTER) { $this->requester = TRUE; } - elseif ($role === self::DRAFTER) { + elseif ($role === static::DRAFTER) { $this->drafter = TRUE; } - elseif ($role === self::EDITOR) { + elseif ($role === static::EDITOR) { $this->editer = TRUE; } - elseif ($role === self::REVIEWER) { + elseif ($role === static::REVIEWER) { $this->reviewer = TRUE; } - elseif ($role === self::INSURER) { + elseif ($role === static::INSURER) { $this->insurer = TRUE; } - elseif ($role === self::FINANCER) { + elseif ($role === static::FINANCER) { $this->financer = TRUE; } - elseif ($role === self::PUBLISHER) { + elseif ($role === static::PUBLISHER) { $this->publisher = TRUE; } - elseif ($role === self::AUDITOR) { + elseif ($role === static::AUDITOR) { $this->auditor = TRUE; } - elseif ($role === self::MANAGER) { + elseif ($role === static::MANAGER) { $this->manager = TRUE; } - elseif ($role === self::ADMINISTER) { + elseif ($role === static::ADMINISTER) { $this->administer = TRUE; } } @@ -312,72 +312,72 @@ class c_base_roles extends c_base_return { return c_base_return_error::s_false($error); } - if ($role === self::NONE) { + if ($role === static::NONE) { if (!($this->public || $this->system || $this->user || $this->requester || $this->drafter || $this->editer || $this->reviewer || $this->publisher || $this->auditor || $this->manager || $this->administer)) { return new c_base_return_true(); } } - elseif ($role === self::PUBLIC) { + elseif ($role === static::PUBLIC) { if ($this->public) { return new c_base_return_true(); } } - elseif ($role === self::SYSTEM) { + elseif ($role === static::SYSTEM) { if ($this->system) { return new c_base_return_true(); } } - elseif ($role === self::USER) { + elseif ($role === static::USER) { if ($this->user) { return new c_base_return_true(); } } - elseif ($role === self::REQUESTER) { + elseif ($role === static::REQUESTER) { if ($this->requester) { return new c_base_return_true(); } } - elseif ($role === self::DRAFTER) { + elseif ($role === static::DRAFTER) { if ($this->drafter) { return new c_base_return_true(); } } - elseif ($role === self::EDITOR) { + elseif ($role === static::EDITOR) { if ($this->editer) { return new c_base_return_true(); } } - elseif ($role === self::REVIEWER) { + elseif ($role === static::REVIEWER) { if ($this->reviewer) { return new c_base_return_true(); } } - elseif ($role === self::FINANCER) { + elseif ($role === static::FINANCER) { if ($this->financer) { return new c_base_return_true(); } } - elseif ($role === self::INSURER) { + elseif ($role === static::INSURER) { if ($this->insurer) { return new c_base_return_true(); } } - elseif ($role === self::PUBLISHER) { + elseif ($role === static::PUBLISHER) { if ($this->publisher) { return new c_base_return_true(); } } - elseif ($role === self::AUDITOR) { + elseif ($role === static::AUDITOR) { if ($this->auditor) { return new c_base_return_true(); } } - elseif ($role === self::MANAGER) { + elseif ($role === static::MANAGER) { if ($this->manager) { return new c_base_return_true(); } } - elseif ($role === self::ADMINISTER) { + elseif ($role === static::ADMINISTER) { if ($this->administer) { return new c_base_return_true(); } @@ -397,55 +397,55 @@ class c_base_roles extends c_base_return { $roles = array(); if ($this->public) { - $roles[self::PUBLIC] = self::PUBLIC; + $roles[static::PUBLIC] = static::PUBLIC; } if ($this->system) { - $roles[self::SYSTEM] = self::SYSTEM; + $roles[static::SYSTEM] = static::SYSTEM; } if ($this->user) { - $roles[self::USER] = self::USER; + $roles[static::USER] = static::USER; } if ($this->requester) { - $roles[self::REQUESTER] = self::REQUESTER; + $roles[static::REQUESTER] = static::REQUESTER; } if ($this->drafter) { - $roles[self::DRAFTER] = self::DRAFTER; + $roles[static::DRAFTER] = static::DRAFTER; } if ($this->editer) { - $roles[self::EDITOR] = self::EDITOR; + $roles[static::EDITOR] = static::EDITOR; } if ($this->reviewer) { - $roles[self::REVIEWER] = self::REVIEWER; + $roles[static::REVIEWER] = static::REVIEWER; } if ($this->financer) { - $roles[self::FINANCER] = self::FINANCER; + $roles[static::FINANCER] = static::FINANCER; } if ($this->insurer) { - $roles[self::INSURER] = self::INSURER; + $roles[static::INSURER] = static::INSURER; } if ($this->publisher) { - $roles[self::PUBLISHER] = self::PUBLISHER; + $roles[static::PUBLISHER] = static::PUBLISHER; } if ($this->auditor) { - $roles[self::AUDITOR] = self::AUDITOR; + $roles[static::AUDITOR] = static::AUDITOR; } if ($this->manager) { - $roles[self::MANAGER] = self::MANAGER; + $roles[static::MANAGER] = static::MANAGER; } if ($this->administer) { - $roles[self::ADMINISTER] = self::ADMINISTER; + $roles[static::ADMINISTER] = static::ADMINISTER; } return c_base_return_array::s_new($roles); diff --git a/common/base/classes/base_session.php b/common/base/classes/base_session.php index 5dfe249..66d151b 100644 --- a/common/base/classes/base_session.php +++ b/common/base/classes/base_session.php @@ -189,7 +189,7 @@ class c_base_session extends c_base_return { // if the directory is changed after the socket path is defined, then update the socket path. if (!is_null($this->socket_path)) { - $this->socket_path = $this->socket_directory . $this->system_name . self::SOCKET_PATH_SUFFIX; + $this->socket_path = $this->socket_directory . $this->system_name . static::SOCKET_PATH_SUFFIX; } return new c_base_return_true(); @@ -236,11 +236,11 @@ class c_base_session extends c_base_return { // make sure the socket directory is defined before assigning the socket path based on the system name. if (is_null($this->socket_directory)) { - $this->socket_directory = self::SOCKET_PATH_PREFIX; + $this->socket_directory = static::SOCKET_PATH_PREFIX; } $this->system_name = basename($system_name); - $this->socket_path = $this->socket_directory . $this->system_name . self::SOCKET_PATH_SUFFIX; + $this->socket_path = $this->socket_directory . $this->system_name . static::SOCKET_PATH_SUFFIX; return new c_base_return_true(); } @@ -656,7 +656,7 @@ class c_base_session extends c_base_return { * @see: gc_collect_cycles() */ public function clear_password() { - $this->password = str_repeat(' ', self::PASSWORD_CLEAR_TEXT_LENGTH); + $this->password = str_repeat(' ', static::PASSWORD_CLEAR_TEXT_LENGTH); unset($this->password); } @@ -1136,7 +1136,7 @@ class c_base_session extends c_base_return { } if (!is_null($this->password)) { - $this->password = str_repeat(' ', self::PASSWORD_CLEAR_TEXT_LENGTH); + $this->password = str_repeat(' ', static::PASSWORD_CLEAR_TEXT_LENGTH); } $this->password = NULL; @@ -1303,7 +1303,7 @@ class c_base_session extends c_base_return { } if (!is_null($this->password)) { - $this->password = str_repeat(' ', self::PASSWORD_CLEAR_TEXT_LENGTH); + $this->password = str_repeat(' ', static::PASSWORD_CLEAR_TEXT_LENGTH); } $this->name = NULL; @@ -1381,7 +1381,7 @@ class c_base_session extends c_base_return { } unset($written); - $json = @socket_read($this->socket, self::PACKET_MAX_LENGTH); + $json = @socket_read($this->socket, static::PACKET_MAX_LENGTH); if (!is_string($json) || mb_strlen($json) == 0) { unset($json); diff --git a/common/base/classes/base_utf8.php b/common/base/classes/base_utf8.php index fc8258a..165f35a 100644 --- a/common/base/classes/base_utf8.php +++ b/common/base/classes/base_utf8.php @@ -79,7 +79,7 @@ class c_base_utf8 { return c_base_return_error::s_false($error); } - if (mb_check_encoding($text, self::UTF_8)) { + if (mb_check_encoding($text, static::UTF_8)) { return new c_base_return_true(); } @@ -534,7 +534,7 @@ class c_base_utf8 { } if (!s_is_bom(substr($text, 0, 3))) { - return c_base_return_string::s_new(self::BOM . $text); + return c_base_return_string::s_new(static::BOM . $text); } return c_base_return_string::s_new($text); @@ -611,7 +611,7 @@ class c_base_utf8 { $search_for = self::p_s_clean($search_for); $target = self::p_s_clean($haystack); - return c_base_return_int::s_new(mb_strpos($target, $search_for, $offset, self::UTF_8)); + return c_base_return_int::s_new(mb_strpos($target, $search_for, $offset, static::UTF_8)); } /** @@ -929,18 +929,18 @@ class c_base_utf8 { return 0; } - if (($ordinal & self::MASK_1) == 0) { + if (($ordinal & static::MASK_1) == 0) { return $ordinal; } - if (($ordinal & self::MASK_2) == 0) { + if (($ordinal & static::MASK_2) == 0) { $high = ($ordinal >> 8); $low = $ordinal - ($high << 8); return ((($high & 0x1f) << 6) | ($low & 0x3f)); } - if (($ordinal & self::MASK_3) == 0) { + if (($ordinal & static::MASK_3) == 0) { $high = ($ordinal >> 16); $medium = ($ordinal - ($high << 16) >> 8); $low = ($ordinal - ($high << 16) - ($medium << 8)); @@ -966,7 +966,7 @@ class c_base_utf8 { // mb_convert_encoding() accepts codepoints, so first convert the ordinal to a codepoint. $codepoint = self::p_s_ordinal_to_codepoint($ordinal); - return mb_convert_encoding('&#' . $codepoint . ';', self::UTF_8, 'HTML-ENTITIES'); + return mb_convert_encoding('&#' . $codepoint . ';', static::UTF_8, 'HTML-ENTITIES'); } /** @@ -999,7 +999,7 @@ class c_base_utf8 { * @see: self::s_length_string() */ private static function p_s_length_string($text) { - return mb_strlen($text, self::UTF_8); + return mb_strlen($text, static::UTF_8); } /** @@ -1016,7 +1016,7 @@ class c_base_utf8 { } if ($remove_bom) { - $sanitized = str_replace(self::BOM, '', $sanitized); + $sanitized = str_replace(static::BOM, '', $sanitized); } return $sanitized; @@ -1093,7 +1093,7 @@ class c_base_utf8 { $sanitized = self::p_s_clean($text); - return mb_substr($sanitized, $start, $length, self::UTF_8); + return mb_substr($sanitized, $start, $length, static::UTF_8); } /** @@ -1146,7 +1146,7 @@ class c_base_utf8 { * @see: self::s_is_bom() */ private static function p_s_is_bom($text) { - if ($text === self::BOM) { + if ($text === static::BOM) { return TRUE; } diff --git a/common/standard/classes/standard_index.php b/common/standard/classes/standard_index.php index dfc8e42..5f646fc 100644 --- a/common/standard/classes/standard_index.php +++ b/common/standard/classes/standard_index.php @@ -288,7 +288,7 @@ class c_standard_index extends c_base_return { $this->http->do_load_request(); // Assign a default response protocol. - $this->http->set_response_protocol(self::HTTP_RESPONSE_PROTOCOL); + $this->http->set_response_protocol(static::HTTP_RESPONSE_PROTOCOL); // Assign a default response status (expected to be overridden by path handlers). $this->http->set_response_status(c_base_http_status::OK); diff --git a/common/standard/classes/standard_menu.php b/common/standard/classes/standard_menu.php index fe62a7a..ef997df 100644 --- a/common/standard/classes/standard_menu.php +++ b/common/standard/classes/standard_menu.php @@ -67,10 +67,10 @@ class c_standard_menu extends c_base_menu { * The created markup tag with error bit set on error. */ protected function pr_create_html_create_menu($name_machine = NULL, $name_human = NULL, $depth = 1) { - $menu = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_NAVIGATION, $name_machine, array(self::CSS_MENU)); + $menu = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_NAVIGATION, $name_machine, array(static::CSS_MENU)); if (is_string($name_human)) { - $wrapper = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, array(self::CSS_MENU_HEADER, self::CSS_MENU_HEADER . '-' . $depth)); + $wrapper = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, array(static::CSS_MENU_HEADER, static::CSS_MENU_HEADER . '-' . $depth)); if ($depth == 1) { $type = c_base_markup_tag::TYPE_H1; @@ -94,17 +94,17 @@ class c_standard_menu extends c_base_menu { $type = c_base_markup_tag::TYPE_HX; } - $header = c_theme_html::s_create_tag($type, NULL, array(self::CSS_MENU_HEADER_TEXT, self::CSS_MENU_HEADER_TEXT . '-' . $depth)); + $header = c_theme_html::s_create_tag($type, NULL, array(static::CSS_MENU_HEADER_TEXT, static::CSS_MENU_HEADER_TEXT . '-' . $depth)); unset($type); if ($depth > 6) { - $header->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, self::CSS_TEXT_HEADING . ((int) $depth)); + $header->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CSS_TEXT_HEADING . ((int) $depth)); } $header->set_text($name_human); $wrapper->set_tag($header); - $wrapper->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, self::CSS_TEXT_HEADINGS); + $wrapper->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CSS_TEXT_HEADINGS); unset($header); $menu->set_tag($wrapper); @@ -128,9 +128,9 @@ class c_standard_menu extends c_base_menu { * Markup tag with error bit set on error. */ protected function pr_create_html_add_menu_item_label($label, $tooltip = NULL) { - $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, array(self::CSS_MENU_ITEM, self::CSS_ITEM_LABEL)); + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, array(static::CSS_MENU_ITEM, static::CSS_ITEM_LABEL)); - $tag_content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SPAN, NULL, array(self::CSS_MENU_ITEM_CONTENT)); + $tag_content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SPAN, NULL, array(static::CSS_MENU_ITEM_CONTENT)); $tag_content->set_text($label); if (is_string($tooltip)) { @@ -162,16 +162,16 @@ class c_standard_menu extends c_base_menu { * Markup tag with error bit set on error. */ protected function pr_create_html_add_menu_item_link($label, $uri, $tooltip = NULL, $local = TRUE) { - $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, array(self::CSS_MENU_ITEM, self::CSS_ITEM_LINK)); + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, array(static::CSS_MENU_ITEM, static::CSS_ITEM_LINK)); if ($local) { - $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, self::CSS_ITEM_LOCAL); + $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CSS_ITEM_LOCAL); } else { - $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, self::CSS_ITEM_REMOTE); + $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CSS_ITEM_REMOTE); } - $tag_content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_A, NULL, array(self::CSS_MENU_ITEM_CONTENT)); + $tag_content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_A, NULL, array(static::CSS_MENU_ITEM_CONTENT)); $tag_content->set_text($label); $tag_content->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $uri); @@ -202,11 +202,11 @@ class c_standard_menu extends c_base_menu { * Markup tag with error bit set on error. */ protected function pr_create_html_add_menu_item_menu($label, $menu, $tooltip = NULL) { - $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, array(self::CSS_MENU_ITEM, self::CSS_ITEM_MENU)); + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, array(static::CSS_MENU_ITEM, static::CSS_ITEM_MENU)); $tag->set_text($label); - $tag_content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SPAN, NULL, array(self::CSS_MENU_ITEM_CONTENT)); + $tag_content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SPAN, NULL, array(static::CSS_MENU_ITEM_CONTENT)); $tag_content->set_tag($menu); if (is_string($tooltip)) { diff --git a/common/standard/classes/standard_path.php b/common/standard/classes/standard_path.php index 7f52e72..20856c6 100644 --- a/common/standard/classes/standard_path.php +++ b/common/standard/classes/standard_path.php @@ -283,12 +283,12 @@ class c_standard_path extends c_base_path { continue; } - require_once($handler_settings['include_directory'] . $handler_settings['include_name'] . self::SCRIPT_EXTENSION); + require_once($handler_settings['include_directory'] . $handler_settings['include_name'] . static::SCRIPT_EXTENSION); $handler = NULL; if (is_string($this->language_alias)) { - @include_once($handler_settings['include_directory'] . $this->language_alias . '/' . $handler_settings['include_name'] . self::SCRIPT_EXTENSION); + @include_once($handler_settings['include_directory'] . $this->language_alias . '/' . $handler_settings['include_name'] . static::SCRIPT_EXTENSION); $handler_class = $handler_settings['handler'] . '_' . $this->language_alias; if (class_exists($handler_class)) { @@ -349,7 +349,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_section($headers = NULL, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_SECTION, self::CSS_AS_SECTION); + $classes = array($this->settings['base_css'] . static::CSS_AS_SECTION, static::CSS_AS_SECTION); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -364,7 +364,7 @@ class c_standard_path extends c_base_path { unset($classes); if (is_array($headers)) { - $header = $this->pr_create_tag_headers($headers, $arguments, NULL, self::CSS_AS_SECTION_HEADERS); + $header = $this->pr_create_tag_headers($headers, $arguments, NULL, static::CSS_AS_SECTION_HEADERS); $tag->set_tag($header); unset($header); } @@ -387,7 +387,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_wrapper($id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_WRAPPER, self::CSS_AS_WRAPPER); + $classes = array($this->settings['base_css'] . static::CSS_AS_WRAPPER, static::CSS_AS_WRAPPER); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -416,7 +416,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_break($id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_BREAK, self::CSS_AS_BREAK); + $classes = array($this->settings['base_css'] . static::CSS_AS_BREAK, static::CSS_AS_BREAK); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -449,7 +449,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_text($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_TEXT, self::CSS_AS_TEXT); + $classes = array($this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -491,7 +491,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_header($text, $header, $arguments = array(), $id = NULL, $extra_class = NULL, $prepend = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_HEADER, self::CSS_AS_HEADER, self::CSS_AS_HEADER . '-' . $header); + $classes = array($this->settings['base_css'] . static::CSS_AS_HEADER, static::CSS_AS_HEADER, static::CSS_AS_HEADER . '-' . $header); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -530,7 +530,7 @@ class c_standard_path extends c_base_path { $tag->set_tag($prepend); } - $tag_text = $this->pr_create_tag_text($text, $arguments, $id, self::CSS_AS_HEADER_TEXT); + $tag_text = $this->pr_create_tag_text($text, $arguments, $id, static::CSS_AS_HEADER_TEXT); $tag->set_tag($tag_text); unset($tag_text); @@ -573,7 +573,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_headers($headers, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_HEADERS, self::CSS_AS_HEADERS); + $classes = array($this->settings['base_css'] . static::CSS_AS_HEADERS, static::CSS_AS_HEADERS); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -650,7 +650,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_paragraph($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_PARAGRAPH, self::CSS_AS_PARAGRAPH); + $classes = array($this->settings['base_css'] . static::CSS_AS_PARAGRAPH, static::CSS_AS_PARAGRAPH); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -688,7 +688,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_text_block($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_TEXT_BLOCK, self::CSS_AS_TEXT_BLOCK); + $classes = array($this->settings['base_css'] . static::CSS_AS_TEXT_BLOCK, static::CSS_AS_TEXT_BLOCK); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -704,10 +704,10 @@ class c_standard_path extends c_base_path { if (!is_null($text)) { if (is_int($text)) { - $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . self::CSS_AS_TEXT, self::CSS_AS_TEXT), $this->pr_get_text($text, $arguments)); + $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT), $this->pr_get_text($text, $arguments)); } else { - $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . self::CSS_AS_TEXT, self::CSS_AS_TEXT), $text); + $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT), $text); } $block->set_tag($tag); @@ -739,7 +739,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_paragraph_block($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_PARAGRAPH_BLOCK, self::CSS_AS_PARAGRAPH_BLOCK); + $classes = array($this->settings['base_css'] . static::CSS_AS_PARAGRAPH_BLOCK, static::CSS_AS_PARAGRAPH_BLOCK); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -755,10 +755,10 @@ class c_standard_path extends c_base_path { if (!is_null($text)) { if (is_int($text)) { - $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . self::CSS_AS_TEXT, self::CSS_AS_TEXT), $this->pr_get_text($text, $arguments)); + $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT), $this->pr_get_text($text, $arguments)); } else { - $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . self::CSS_AS_TEXT, self::CSS_AS_TEXT), $text); + $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT), $text); } $block->set_tag($tag); @@ -795,7 +795,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_link($text, $tooltip, $destination, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_LINK, self::CSS_AS_LINK); + $classes = array($this->settings['base_css'] . static::CSS_AS_LINK, static::CSS_AS_LINK); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -810,10 +810,10 @@ class c_standard_path extends c_base_path { unset($classes); if (is_int($text)) { - $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_A, NULL, array($this->settings['base_css'] . self::CSS_AS_TEXT, self::CSS_AS_TEXT), $this->pr_get_text($text, $arguments)); + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_A, NULL, array($this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT), $this->pr_get_text($text, $arguments)); } else { - $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_A, NULL, array($this->settings['base_css'] . self::CSS_AS_TEXT, self::CSS_AS_TEXT), $text); + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_A, NULL, array($this->settings['base_css'] . static::CSS_AS_TEXT, static::CSS_AS_TEXT), $text); } if (is_array($destination)) { @@ -871,7 +871,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_link_block($text, $tooltip, $destination, $description, $arguments = array(), $header = 0, $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_LINK_BLOCK, self::CSS_AS_LINK_BLOCK); + $classes = array($this->settings['base_css'] . static::CSS_AS_LINK_BLOCK, static::CSS_AS_LINK_BLOCK); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -887,10 +887,10 @@ class c_standard_path extends c_base_path { if (!is_null($text)) { if ($header < 1) { - $wrapper = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, array(self::CSS_AS_TEXT, self::CSS_AS_LINK_BLOCK_NAME)); + $wrapper = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, NULL, array(static::CSS_AS_TEXT, static::CSS_AS_LINK_BLOCK_NAME)); } else { - $header_classes = array($this->settings['base_css'] . self::CSS_AS_HEADER, self::CSS_AS_HEADER, self::CSS_AS_HEADER . '-' . $header, self::CSS_AS_LINK_BLOCK_NAME); + $header_classes = array($this->settings['base_css'] . static::CSS_AS_HEADER, static::CSS_AS_HEADER, static::CSS_AS_HEADER . '-' . $header, static::CSS_AS_LINK_BLOCK_NAME); if ($header == 1) { $type = c_base_markup_tag::TYPE_H1; @@ -924,7 +924,7 @@ class c_standard_path extends c_base_path { } if (!is_null($text)) { - $tag = $this->pr_create_tag_link($text, $tooltip, $destination, $arguments, self::CSS_AS_LINK_BLOCK_LINK); + $tag = $this->pr_create_tag_link($text, $tooltip, $destination, $arguments, static::CSS_AS_LINK_BLOCK_LINK); $wrapper->set_tag($tag); unset($tag); } @@ -934,7 +934,7 @@ class c_standard_path extends c_base_path { } if (!is_null($description)) { - $tag = $this->pr_create_tag_text_block($description, $arguments, self::CSS_AS_LINK_BLOCK_DESCRIPTION); + $tag = $this->pr_create_tag_text_block($description, $arguments, static::CSS_AS_LINK_BLOCK_DESCRIPTION); $block->set_tag($tag); unset($tag); } @@ -946,7 +946,7 @@ class c_standard_path extends c_base_path { * Creates the standard fieldset block, with an optional fieldset legend. * * This does not define the fieldset body, which is left to be defined by the caller. - * The fieldset body is generally assumed to be defined wih self::CSS_AS_FIELD_SET_CONTENT. + * The fieldset body is generally assumed to be defined wih static::CSS_AS_FIELD_SET_CONTENT. * * @param int|string|null $text * The text or the text code to use as the fieldset legend. @@ -965,7 +965,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_fieldset($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_PARAGRAPH_BLOCK, self::CSS_AS_PARAGRAPH_BLOCK); + $classes = array($this->settings['base_css'] . static::CSS_AS_PARAGRAPH_BLOCK, static::CSS_AS_PARAGRAPH_BLOCK); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -981,10 +981,10 @@ class c_standard_path extends c_base_path { if (!is_null($text)) { if (is_int($text)) { - $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . self::CSS_AS_FIELD_SET_LEGEND, self::CSS_AS_FIELD_SET_LEGEND), $this->pr_get_text($text, $arguments)); + $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . static::CSS_AS_FIELD_SET_LEGEND, static::CSS_AS_FIELD_SET_LEGEND), $this->pr_get_text($text, $arguments)); } else { - $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . self::CSS_AS_FIELD_SET_LEGEND, self::CSS_AS_FIELD_SET_LEGEND), $text); + $tag = c_theme_html::s_create_tag($this->text_type, NULL, array($this->settings['base_css'] . static::CSS_AS_FIELD_SET_LEGEND, static::CSS_AS_FIELD_SET_LEGEND), $text); } $block->set_tag($tag); @@ -1017,7 +1017,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_row($value = NULL, $arguments = array(), $id = NULL, $extra_class = NULL, $row = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_ROW, self::CSS_AS_ROW); + $classes = array($this->settings['base_css'] . static::CSS_AS_ROW, static::CSS_AS_ROW); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1029,13 +1029,13 @@ class c_standard_path extends c_base_path { } if (is_int($row)) { - $classes[] = self::CSS_AS_ROW . '-' . $row; + $classes[] = static::CSS_AS_ROW . '-' . $row; } $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, $id, $classes); unset($classes); - $tag_text = $this->pr_create_tag_text($value, $arguments, $id, self::CSS_AS_ROW_VALUE); + $tag_text = $this->pr_create_tag_text($value, $arguments, $id, static::CSS_AS_ROW_VALUE); $tag->set_tag($tag_text); unset($tag_text); @@ -1073,7 +1073,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_field_row($field_name = NULL, $field_value = NULL, $arguments = array(), $id = NULL, $extra_class = NULL, $row = NULL, $spacer = FALSE) { - $classes = array($this->settings['base_css'] . self::CSS_AS_FIELD_ROW, self::CSS_AS_FIELD_ROW); + $classes = array($this->settings['base_css'] . static::CSS_AS_FIELD_ROW, static::CSS_AS_FIELD_ROW); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1085,13 +1085,13 @@ class c_standard_path extends c_base_path { } if (is_int($row)) { - $classes[] = self::CSS_AS_ROW . '-' . $row; + $classes[] = static::CSS_AS_ROW . '-' . $row; } $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, $id, $classes); unset($classes); - $tag_text = $this->pr_create_tag_text($field_name, $arguments, NULL, self::CSS_AS_FIELD_ROW_NAME); + $tag_text = $this->pr_create_tag_text($field_name, $arguments, NULL, static::CSS_AS_FIELD_ROW_NAME); $tag->set_tag($tag_text); unset($tag_text); @@ -1099,7 +1099,7 @@ class c_standard_path extends c_base_path { $this->pr_create_tag_spacer($tag); } - $tag_text = $this->pr_create_tag_text($field_value, $arguments, NULL, self::CSS_AS_FIELD_ROW_VALUE); + $tag_text = $this->pr_create_tag_text($field_value, $arguments, NULL, static::CSS_AS_FIELD_ROW_VALUE); $tag->set_tag($tag_text); unset($tag_text); @@ -1129,7 +1129,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_table($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_TABLE, self::CSS_AS_TABLE); + $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE, static::CSS_AS_TABLE); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1144,10 +1144,10 @@ class c_standard_path extends c_base_path { if (!is_null($text)) { if (is_int($text)) { - $tag_text = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_CAPTION, NULL, array($this->settings['base_css'] . self::CSS_AS_TABLE_CAPTION, self::CSS_AS_TABLE_CAPTION), $this->pr_get_text($text, $arguments)); + $tag_text = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_CAPTION, NULL, array($this->settings['base_css'] . static::CSS_AS_TABLE_CAPTION, static::CSS_AS_TABLE_CAPTION), $this->pr_get_text($text, $arguments)); } else { - $tag_text = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_CAPTION, NULL, array($this->settings['base_css'] . self::CSS_AS_TABLE_CAPTION, self::CSS_AS_TABLE_CAPTION), $text); + $tag_text = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_CAPTION, NULL, array($this->settings['base_css'] . static::CSS_AS_TABLE_CAPTION, static::CSS_AS_TABLE_CAPTION), $text); } $tag->set_tag($tag_text); @@ -1178,7 +1178,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_table_caption($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_TABLE_CAPTION, self::CSS_AS_TABLE_CAPTION); + $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_CAPTION, static::CSS_AS_TABLE_CAPTION); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1215,7 +1215,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_table_column($id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_TABLE_COLUMN, self::CSS_AS_TABLE_COLUMN); + $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_COLUMN, static::CSS_AS_TABLE_COLUMN); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1244,7 +1244,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_table_column_group($id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_TABLE_COLUMN_GROUP, self::CSS_AS_TABLE_COLUMN_GROUP); + $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_COLUMN_GROUP, static::CSS_AS_TABLE_COLUMN_GROUP); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1273,7 +1273,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_table_header($id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_TABLE_HEADER, self::CSS_AS_TABLE_HEADER); + $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_HEADER, static::CSS_AS_TABLE_HEADER); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1308,7 +1308,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_table_header_cell($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_TABLE_HEADER_CELL, self::CSS_AS_TABLE_HEADER_CELL); + $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_HEADER_CELL, static::CSS_AS_TABLE_HEADER_CELL); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1345,7 +1345,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_table_body($id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_TABLE_BODY, self::CSS_AS_TABLE_BODY); + $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_BODY, static::CSS_AS_TABLE_BODY); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1374,7 +1374,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_table_row($id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_TABLE_ROW, self::CSS_AS_TABLE_ROW); + $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_ROW, static::CSS_AS_TABLE_ROW); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1409,7 +1409,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_table_cell($text, $arguments = array(), $id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_TABLE_CELL, self::CSS_AS_TABLE_CELL); + $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_CELL, static::CSS_AS_TABLE_CELL); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1446,7 +1446,7 @@ class c_standard_path extends c_base_path { * The generated markup tag. */ protected function pr_create_tag_table_footer($id = NULL, $extra_class = NULL) { - $classes = array($this->settings['base_css'] . self::CSS_AS_TABLE_FOOTER, self::CSS_AS_TABLE_FOOTER); + $classes = array($this->settings['base_css'] . static::CSS_AS_TABLE_FOOTER, static::CSS_AS_TABLE_FOOTER); if (is_string($extra_class)) { $classes[] = $extra_class; } @@ -1513,7 +1513,7 @@ class c_standard_path extends c_base_path { * @see: self::pr_create_html() */ protected function pr_create_html_add_primary_ids() { - $id = $this->html->sanitize_css(self::CSS_SYSTEM_PREFIX . $this->settings['system_name'])->get_value_exact(); + $id = $this->html->sanitize_css(static::CSS_SYSTEM_PREFIX . $this->settings['system_name'])->get_value_exact(); #$this->html->set_attribute(c_base_markup_attributes::ATTRIBUTE_ID, $id); $this->html->set_attribute_body(c_base_markup_attributes::ATTRIBUTE_ID, $id); @@ -1529,13 +1529,13 @@ class c_standard_path extends c_base_path { // add date/time classes. $instance = c_base_defaults_global::s_get_timestamp_session()->get_value_exact(); - $class[] = self::CSS_DATE_YEAR . $this->html->sanitize_css(date('Y', $instance))->get_value_exact(); - $class[] = self::CSS_DATE_MONTH . $this->html->sanitize_css(strtolower(date('F', $instance)))->get_value_exact(); - $class[] = self::CSS_DATE_WEEK_DAY . $this->html->sanitize_css(strtolower(date('l', $instance)))->get_value_exact(); - $class[] = self::CSS_DATE_DAY . $this->html->sanitize_css(date('d', $instance))->get_value_exact(); - $class[] = self::CSS_DATE_HOUR . $this->html->sanitize_css(date('H', $instance))->get_value_exact(); - $class[] = self::CSS_DATE_MINUTE . $this->html->sanitize_css(date('m', $instance))->get_value_exact(); - $class[] = self::CSS_DATE_SECOND . $this->html->sanitize_css(date('s', $instance))->get_value_exact(); + $class[] = static::CSS_DATE_YEAR . $this->html->sanitize_css(date('Y', $instance))->get_value_exact(); + $class[] = static::CSS_DATE_MONTH . $this->html->sanitize_css(strtolower(date('F', $instance)))->get_value_exact(); + $class[] = static::CSS_DATE_WEEK_DAY . $this->html->sanitize_css(strtolower(date('l', $instance)))->get_value_exact(); + $class[] = static::CSS_DATE_DAY . $this->html->sanitize_css(date('d', $instance))->get_value_exact(); + $class[] = static::CSS_DATE_HOUR . $this->html->sanitize_css(date('H', $instance))->get_value_exact(); + $class[] = static::CSS_DATE_MINUTE . $this->html->sanitize_css(date('m', $instance))->get_value_exact(); + $class[] = static::CSS_DATE_SECOND . $this->html->sanitize_css(date('s', $instance))->get_value_exact(); unset($instance); // add path classes @@ -1549,19 +1549,19 @@ class c_standard_path extends c_base_path { $sanitized_part = $this->html->sanitize_css($path_part, TRUE)->get_value_exact(); $sanitized .= '-' . $sanitized_part; - $class[] = self::CSS_PATH_PART . $delta . '-' . $this->html->sanitize_css($sanitized_part)->get_value_exact(); + $class[] = static::CSS_PATH_PART . $delta . '-' . $this->html->sanitize_css($sanitized_part)->get_value_exact(); $delta++; } unset($path_part); unset($sanitized_part); - $class[] = self::CSS_PATH_FULL . $this->html->sanitize_css(substr($sanitized, 1))->get_value_exact(); + $class[] = static::CSS_PATH_FULL . $this->html->sanitize_css(substr($sanitized, 1))->get_value_exact(); unset($sanitized); } unset($path_parts); - $class[] = self::CSS_IS_CONTENT_TYPE; - $class[] = self::CSS_IS_JAVASCRIPT_DISABLED; + $class[] = static::CSS_IS_CONTENT_TYPE; + $class[] = static::CSS_IS_JAVASCRIPT_DISABLED; $this->html->set_attribute_body(c_base_markup_attributes::ATTRIBUTE_CLASS, $class); @@ -1760,7 +1760,7 @@ class c_standard_path extends c_base_path { $javascript = 'function f_standard_paths_hmtl_javascript_detection() {'; $javascript .= 'document.body.removeAttribute(\'onLoad\');'; - $javascript .= 'document.body.className = document.body.className.replace(/\b' . self::CSS_IS_JAVASCRIPT_DISABLED . '\b/i, \'' . self::CSS_IS_JAVASCRIPT_ENABLED . '\');'; + $javascript .= 'document.body.className = document.body.className.replace(/\b' . static::CSS_IS_JAVASCRIPT_DISABLED . '\b/i, \'' . static::CSS_IS_JAVASCRIPT_ENABLED . '\');'; $javascript .= '}'; $tag->set_text($javascript); unset($javascript); @@ -1779,7 +1779,7 @@ class c_standard_path extends c_base_path { * The markup tag to assign the spacer to. */ protected function pr_create_tag_spacer(&$tag) { - $tag_text = $this->pr_create_tag_text(' ', array(), NULL, self::CSS_AS_SPACER); + $tag_text = $this->pr_create_tag_text(' ', array(), NULL, static::CSS_AS_SPACER); $tag->set_tag($tag_text); unset($tag_text); } @@ -1837,7 +1837,7 @@ class c_standard_path extends c_base_path { * FALSE with error bit set is returned on error. */ protected function pr_build_menu_header() { - $menu = $this->pr_include_path(self::PATH_MENU_HEADER, self::NAME_MENU_HEADER, self::HANDLER_MENU_HEADER); + $menu = $this->pr_include_path(static::PATH_MENU_HEADER, static::NAME_MENU_HEADER, static::HANDLER_MENU_HEADER); return $menu->do_build($this->http, $this->database, $this->session, $this->settings); } @@ -1859,7 +1859,7 @@ class c_standard_path extends c_base_path { * FALSE with error bit set is returned on error. */ protected function pr_build_menu_utility(&$http, &$database, &$session, $settings) { - $menu = $this->pr_include_path(self::PATH_MENU_UTILITY, self::NAME_MENU_UTILITY, self::HANDLER_MENU_UTILITY); + $menu = $this->pr_include_path(static::PATH_MENU_UTILITY, static::NAME_MENU_UTILITY, static::HANDLER_MENU_UTILITY); return $menu->do_build($this->http, $this->database, $this->session, $this->settings); } @@ -1881,7 +1881,7 @@ class c_standard_path extends c_base_path { * FALSE with error bit set is returned on error. */ protected function pr_build_menu_breadcrumbs(&$http, &$database, &$session, $settings) { - $menu = $this->pr_include_path(self::PATH_MENU_BREADCRUMBS, self::NAME_MENU_BREADCRUMBS, self::HANDLER_MENU_BREADCRUMBS); + $menu = $this->pr_include_path(static::PATH_MENU_BREADCRUMBS, static::NAME_MENU_BREADCRUMBS, static::HANDLER_MENU_BREADCRUMBS); return $menu->do_build($http, $database, $session, $settings, $this->breadcrumbs); } @@ -1903,7 +1903,7 @@ class c_standard_path extends c_base_path { * FALSE with error bit set is returned on error. */ protected function pr_build_menu_content(&$http, &$database, &$session, $settings) { - $menu = $this->pr_include_path(self::PATH_MENU_CONTENT, self::NAME_MENU_CONTENT, self::HANDLER_MENU_CONTENT); + $menu = $this->pr_include_path(static::PATH_MENU_CONTENT, static::NAME_MENU_CONTENT, static::HANDLER_MENU_CONTENT); return $menu->do_build($this->http, $this->database, $this->session, $this->settings); } @@ -1925,7 +1925,7 @@ class c_standard_path extends c_base_path { * FALSE with error bit set is returned on error. */ protected function pr_build_menu_footer(&$http, &$database, &$session, $settings) { - $menu = $this->pr_include_path(self::PATH_MENU_FOOTER, self::NAME_MENU_FOOTER, self::HANDLER_MENU_FOOTER); + $menu = $this->pr_include_path(static::PATH_MENU_FOOTER, static::NAME_MENU_FOOTER, static::HANDLER_MENU_FOOTER); return $menu->do_build($this->http, $this->database, $this->session, $this->settings); } @@ -2036,7 +2036,7 @@ class c_standard_path extends c_base_path { * The created c_base_meni object. */ protected function pr_include_path($path, $name, $class) { - require_once($path . $name . self::SCRIPT_EXTENSION); + require_once($path . $name . static::SCRIPT_EXTENSION); // use default if no aliases are found. if (is_null($this->language_alias)) { @@ -2044,7 +2044,7 @@ class c_standard_path extends c_base_path { } // use include_once instead of require_require to allow for failsafe behavior. - @include_once($path . $this->language_alias . '/' . $name . self::SCRIPT_EXTENSION); + @include_once($path . $this->language_alias . '/' . $name . static::SCRIPT_EXTENSION); $language_class = $class . '_' . $this->language_alias; if (class_exists($language_class)) { diff --git a/common/standard/classes/standard_path_exception.php b/common/standard/classes/standard_path_exception.php index 6fbe40a..ebed379 100644 --- a/common/standard/classes/standard_path_exception.php +++ b/common/standard/classes/standard_path_exception.php @@ -51,12 +51,12 @@ class c_standard_path_exception extends c_standard_path { continue; } - require_once($handler_settings['include_directory'] . $handler_settings['include_name'] . self::SCRIPT_EXTENSION); + require_once($handler_settings['include_directory'] . $handler_settings['include_name'] . static::SCRIPT_EXTENSION); $handler = NULL; if (is_string($this->language_alias)) { - @include_once($handler_settings['include_directory'] . $this->language_alias . '/' . $handler_settings['include_name'] . self::SCRIPT_EXTENSION); + @include_once($handler_settings['include_directory'] . $this->language_alias . '/' . $handler_settings['include_name'] . static::SCRIPT_EXTENSION); $handler_class = $handler_settings['handler'] . '_' . $this->language_alias; if (class_exists($handler_class)) { diff --git a/common/standard/classes/standard_paths.php b/common/standard/classes/standard_paths.php index d337be8..c5b57df 100644 --- a/common/standard/classes/standard_paths.php +++ b/common/standard/classes/standard_paths.php @@ -166,7 +166,7 @@ class c_standard_paths extends c_base_return { * A path object. */ public function get_handler_login() { - return $this->pr_include_path(self::PATH_USER, self::NAME_USER_LOGIN, self::HANDLER_USER_LOGIN); + return $this->pr_include_path(static::PATH_USER, static::NAME_USER_LOGIN, static::HANDLER_USER_LOGIN); } /** @@ -176,7 +176,7 @@ class c_standard_paths extends c_base_return { * A path object. */ public function get_handler_logout() { - return $this->pr_include_path(self::PATH_USER, self::NAME_USER_LOGOUT, self::HANDLER_USER_LOGOUT); + return $this->pr_include_path(static::PATH_USER, static::NAME_USER_LOGOUT, static::HANDLER_USER_LOGOUT); } /** @@ -186,7 +186,7 @@ class c_standard_paths extends c_base_return { * A path object. */ public function get_handler_not_found() { - return $this->pr_include_path(self::PATH_INTERNAL, self::NAME_NOT_FOUND, self::HANDLER_NOT_FOUND); + return $this->pr_include_path(static::PATH_INTERNAL, static::NAME_NOT_FOUND, static::HANDLER_NOT_FOUND); } /** @@ -196,7 +196,7 @@ class c_standard_paths extends c_base_return { * A path object. */ public function get_handler_access_denied() { - return $this->pr_include_path(self::PATH_INTERNAL, self::NAME_ACCESS_DENIED, self::HANDLER_ACCESS_DENIED); + return $this->pr_include_path(static::PATH_INTERNAL, static::NAME_ACCESS_DENIED, static::HANDLER_ACCESS_DENIED); } /** @@ -206,7 +206,7 @@ class c_standard_paths extends c_base_return { * A path object. */ public function get_handler_bad_method() { - return $this->pr_include_path(self::PATH_INTERNAL, self::NAME_BAD_METHOD, self::HANDLER_BAD_METHOD); + return $this->pr_include_path(static::PATH_INTERNAL, static::NAME_BAD_METHOD, static::HANDLER_BAD_METHOD); } /** @@ -216,7 +216,7 @@ class c_standard_paths extends c_base_return { * A path object. */ public function get_handler_server_error() { - return $this->pr_include_path(self::PATH_INTERNAL, self::NAME_SERVER_ERROR, self::HANDLER_SERVER_ERROR); + return $this->pr_include_path(static::PATH_INTERNAL, static::NAME_SERVER_ERROR, static::HANDLER_SERVER_ERROR); } /** @@ -226,7 +226,7 @@ class c_standard_paths extends c_base_return { * A path object. */ public function get_handler_options_method() { - return $this->pr_include_path(self::PATH_INTERNAL, self::NAME_OPTIONS_METHOD, self::HANDLER_OPTIONS_METHOD); + return $this->pr_include_path(static::PATH_INTERNAL, static::NAME_OPTIONS_METHOD, static::HANDLER_OPTIONS_METHOD); } /** @@ -236,7 +236,7 @@ class c_standard_paths extends c_base_return { * A path object. */ public function get_handler_index() { - return $this->pr_include_path(self::PATH_INTERNAL, self::NAME_INDEX, self::HANDLER_INDEX); + return $this->pr_include_path(static::PATH_INTERNAL, static::NAME_INDEX, static::HANDLER_INDEX); } /** @@ -508,7 +508,7 @@ class c_standard_paths extends c_base_return { } else { if (!empty($handler_settings['include_name']) && is_string($handler_settings['include_name'])) { - require_once($handler_settings['include_directory'] . $handler_settings['include_name'] . self::SCRIPT_EXTENSION); + require_once($handler_settings['include_directory'] . $handler_settings['include_name'] . static::SCRIPT_EXTENSION); } // execute path handler, using custom-language if defined. @@ -524,7 +524,7 @@ class c_standard_paths extends c_base_return { return $path_server_error; } elseif (is_string($this->language_alias)) { - @include_once($handler_settings['include_directory'] . $this->language_alias . '/' . $handler_settings['include_name'] . self::SCRIPT_EXTENSION); + @include_once($handler_settings['include_directory'] . $this->language_alias . '/' . $handler_settings['include_name'] . static::SCRIPT_EXTENSION); $handler_class = $handler_settings['handler'] . '_' . $this->language_alias; if (class_exists($handler_class)) { @@ -595,11 +595,11 @@ class c_standard_paths extends c_base_return { $this->paths = new c_base_paths(); // set root path. - $this->paths->add_path(self::URI_HOME, self::HANDLER_INDEX, self::PATH_INTERNAL, self::NAME_INDEX); + $this->paths->add_path(static::URI_HOME, static::HANDLER_INDEX, static::PATH_INTERNAL, static::NAME_INDEX); // create login/logout paths - $this->paths->add_path(self::URI_USER_LOGIN, self::HANDLER_USER_LOGIN, self::PATH_USER, self::NAME_USER_LOGIN); - $this->paths->add_path(self::URI_USER_LOGOUT, self::HANDLER_USER_LOGOUT, self::PATH_USER, self::NAME_USER_LOGOUT); + $this->paths->add_path(static::URI_USER_LOGIN, static::HANDLER_USER_LOGIN, static::PATH_USER, static::NAME_USER_LOGIN); + $this->paths->add_path(static::URI_USER_LOGOUT, static::HANDLER_USER_LOGOUT, static::PATH_USER, static::NAME_USER_LOGOUT); } /** @@ -609,7 +609,7 @@ class c_standard_paths extends c_base_return { */ protected function pr_paths_create_administer() { // dashboards - $this->paths->add_path(self::URI_DASHBOARD_ADMINISTER, self::HANDLER_ADMINISTER_DASHBOARD, self::PATH_ADMINISTER, self::NAME_DASHBOARD_ADMINISTER); + $this->paths->add_path(static::URI_DASHBOARD_ADMINISTER, static::HANDLER_ADMINISTER_DASHBOARD, static::PATH_ADMINISTER, static::NAME_DASHBOARD_ADMINISTER); } /** @@ -651,7 +651,7 @@ class c_standard_paths extends c_base_return { */ protected function pr_paths_create_management() { // dashboards - $this->paths->add_path(self::URI_DASHBOARD_MANAGEMENT, self::HANDLER_MANAGEMENT_DASHBOARD, self::PATH_MANAGEMENT, self::NAME_DASHBOARD_MANAGEMENT); + $this->paths->add_path(static::URI_DASHBOARD_MANAGEMENT, static::HANDLER_MANAGEMENT_DASHBOARD, static::PATH_MANAGEMENT, static::NAME_DASHBOARD_MANAGEMENT); } /** @@ -677,33 +677,33 @@ class c_standard_paths extends c_base_return { */ protected function pr_paths_create_user() { // dashboards - $this->paths->add_path(self::URI_USER_DASHBOARD, self::HANDLER_USER_DASHBOARD, self::PATH_USER, self::NAME_USER_DASHBOARD); + $this->paths->add_path(static::URI_USER_DASHBOARD, static::HANDLER_USER_DASHBOARD, static::PATH_USER, static::NAME_USER_DASHBOARD); // user paths - $this->paths->add_path(self::URI_USER_CHECK, self::HANDLER_USER_CHECK, self::PATH_USER, self::NAME_USER_CHECK); - $this->paths->add_path(self::URI_USER_CHECK . self::WILDCARD_PATH, self::HANDLER_USER_CHECK, self::PATH_USER, self::NAME_USER_CHECK); - $this->paths->add_path(self::URI_USER_CREATE, self::HANDLER_USER_CREATE, self::PATH_USER, self::NAME_USER_CREATE); - $this->paths->add_path(self::URI_USER_CREATE . self::WILDCARD_PATH, self::HANDLER_USER_CREATE, self::PATH_USER, self::NAME_USER_CREATE); - $this->paths->add_path(self::URI_USER_DELETE, self::HANDLER_USER_DELETE, self::PATH_USER, self::NAME_USER_DELETE); - $this->paths->add_path(self::URI_USER_DELETE . self::WILDCARD_PATH, self::HANDLER_USER_DELETE, self::PATH_USER, self::NAME_USER_DELETE); - $this->paths->add_path(self::URI_USER_EDIT, self::HANDLER_USER_EDIT, self::PATH_USER, self::NAME_USER_EDIT); - $this->paths->add_path(self::URI_USER_EDIT . self::WILDCARD_PATH, self::HANDLER_USER_EDIT, self::PATH_USER, self::NAME_USER_EDIT); - $this->paths->add_path(self::URI_USER_LOCK, self::HANDLER_USER_LOCK, self::PATH_USER, self::NAME_USER_LOCK); - $this->paths->add_path(self::URI_USER_LOCK . self::WILDCARD_PATH, self::HANDLER_USER_LOCK, self::PATH_USER, self::NAME_USER_LOCK); - $this->paths->add_path(self::URI_USER_PDF, self::HANDLER_USER_PDF, self::PATH_USER, self::NAME_USER_PDF); - $this->paths->add_path(self::URI_USER_PDF . self::WILDCARD_PATH, self::HANDLER_USER_PDF, self::PATH_USER, self::NAME_USER_PDF); - $this->paths->add_path(self::URI_USER_PRINT, self::HANDLER_USER_PRINT, self::PATH_USER, self::NAME_USER_PRINT); - $this->paths->add_path(self::URI_USER_PRINT . self::WILDCARD_PATH, self::HANDLER_USER_PRINT, self::PATH_USER, self::NAME_USER_PRINT); - $this->paths->add_path(self::URI_USER_PS, self::HANDLER_USER_PS, self::PATH_USER, self::NAME_USER_PS); - $this->paths->add_path(self::URI_USER_PS . self::WILDCARD_PATH, self::HANDLER_USER_PS, self::PATH_USER, self::NAME_USER_PS); - $this->paths->add_path(self::URI_USER_REFRESH, self::HANDLER_USER_REFRESH, self::PATH_USER, self::NAME_USER_REFRESH); - $this->paths->add_path(self::URI_USER_REFRESH . self::WILDCARD_PATH, self::HANDLER_USER_REFRESH, self::PATH_USER, self::NAME_USER_REFRESH); - $this->paths->add_path(self::URI_USER_SETTINGS, self::HANDLER_USER_SETTINGS, self::PATH_USER, self::NAME_USER_SETTINGS); - $this->paths->add_path(self::URI_USER_SETTINGS . self::WILDCARD_PATH, self::HANDLER_USER_SETTINGS, self::PATH_USER, self::NAME_USER_SETTINGS); - $this->paths->add_path(self::URI_USER_UNLOCK, self::HANDLER_USER_UNLOCK, self::PATH_USER, self::NAME_USER_UNLOCK); - $this->paths->add_path(self::URI_USER_UNLOCK . self::WILDCARD_PATH, self::HANDLER_USER_UNLOCK, self::PATH_USER, self::NAME_USER_UNLOCK); - $this->paths->add_path(self::URI_USER_VIEW, self::HANDLER_USER_VIEW, self::PATH_USER, self::NAME_USER_VIEW); - $this->paths->add_path(self::URI_USER_VIEW . self::WILDCARD_PATH, self::HANDLER_USER_VIEW, self::PATH_USER, self::NAME_USER_VIEW); + $this->paths->add_path(static::URI_USER_CHECK, static::HANDLER_USER_CHECK, static::PATH_USER, static::NAME_USER_CHECK); + $this->paths->add_path(static::URI_USER_CHECK . static::WILDCARD_PATH, static::HANDLER_USER_CHECK, static::PATH_USER, static::NAME_USER_CHECK); + $this->paths->add_path(static::URI_USER_CREATE, static::HANDLER_USER_CREATE, static::PATH_USER, static::NAME_USER_CREATE); + $this->paths->add_path(static::URI_USER_CREATE . static::WILDCARD_PATH, static::HANDLER_USER_CREATE, static::PATH_USER, static::NAME_USER_CREATE); + $this->paths->add_path(static::URI_USER_DELETE, static::HANDLER_USER_DELETE, static::PATH_USER, static::NAME_USER_DELETE); + $this->paths->add_path(static::URI_USER_DELETE . static::WILDCARD_PATH, static::HANDLER_USER_DELETE, static::PATH_USER, static::NAME_USER_DELETE); + $this->paths->add_path(static::URI_USER_EDIT, static::HANDLER_USER_EDIT, static::PATH_USER, static::NAME_USER_EDIT); + $this->paths->add_path(static::URI_USER_EDIT . static::WILDCARD_PATH, static::HANDLER_USER_EDIT, static::PATH_USER, static::NAME_USER_EDIT); + $this->paths->add_path(static::URI_USER_LOCK, static::HANDLER_USER_LOCK, static::PATH_USER, static::NAME_USER_LOCK); + $this->paths->add_path(static::URI_USER_LOCK . static::WILDCARD_PATH, static::HANDLER_USER_LOCK, static::PATH_USER, static::NAME_USER_LOCK); + $this->paths->add_path(static::URI_USER_PDF, static::HANDLER_USER_PDF, static::PATH_USER, static::NAME_USER_PDF); + $this->paths->add_path(static::URI_USER_PDF . static::WILDCARD_PATH, static::HANDLER_USER_PDF, static::PATH_USER, static::NAME_USER_PDF); + $this->paths->add_path(static::URI_USER_PRINT, static::HANDLER_USER_PRINT, static::PATH_USER, static::NAME_USER_PRINT); + $this->paths->add_path(static::URI_USER_PRINT . static::WILDCARD_PATH, static::HANDLER_USER_PRINT, static::PATH_USER, static::NAME_USER_PRINT); + $this->paths->add_path(static::URI_USER_PS, static::HANDLER_USER_PS, static::PATH_USER, static::NAME_USER_PS); + $this->paths->add_path(static::URI_USER_PS . static::WILDCARD_PATH, static::HANDLER_USER_PS, static::PATH_USER, static::NAME_USER_PS); + $this->paths->add_path(static::URI_USER_REFRESH, static::HANDLER_USER_REFRESH, static::PATH_USER, static::NAME_USER_REFRESH); + $this->paths->add_path(static::URI_USER_REFRESH . static::WILDCARD_PATH, static::HANDLER_USER_REFRESH, static::PATH_USER, static::NAME_USER_REFRESH); + $this->paths->add_path(static::URI_USER_SETTINGS, static::HANDLER_USER_SETTINGS, static::PATH_USER, static::NAME_USER_SETTINGS); + $this->paths->add_path(static::URI_USER_SETTINGS . static::WILDCARD_PATH, static::HANDLER_USER_SETTINGS, static::PATH_USER, static::NAME_USER_SETTINGS); + $this->paths->add_path(static::URI_USER_UNLOCK, static::HANDLER_USER_UNLOCK, static::PATH_USER, static::NAME_USER_UNLOCK); + $this->paths->add_path(static::URI_USER_UNLOCK . static::WILDCARD_PATH, static::HANDLER_USER_UNLOCK, static::PATH_USER, static::NAME_USER_UNLOCK); + $this->paths->add_path(static::URI_USER_VIEW, static::HANDLER_USER_VIEW, static::PATH_USER, static::NAME_USER_VIEW); + $this->paths->add_path(static::URI_USER_VIEW . static::WILDCARD_PATH, static::HANDLER_USER_VIEW, static::PATH_USER, static::NAME_USER_VIEW); } /** @@ -758,7 +758,7 @@ class c_standard_paths extends c_base_return { unset($id_group); // PHP's instanceof does not support strings, so is_subclass_of() and is_a() must instead be used. - if (class_exists(self::HANDLER_USER_LOGOUT) && (is_subclass_of($this->handler, self::HANDLER_USER_LOGOUT) || is_a($this->handler, self::HANDLER_USER_LOGOUT, TRUE))) { + if (class_exists(static::HANDLER_USER_LOGOUT) && (is_subclass_of($this->handler, static::HANDLER_USER_LOGOUT) || is_a($this->handler, static::HANDLER_USER_LOGOUT, TRUE))) { // if the user is not logged in. then provide a page not found for logout path. if (!$this->session->is_logged_in()->get_value_exact()) { $path_not_found = $this->get_handler_not_found(); @@ -920,7 +920,7 @@ class c_standard_paths extends c_base_return { * The created c_base_path object. */ protected function pr_include_path($path, $name, $class) { - require_once($path . $name . self::SCRIPT_EXTENSION); + require_once($path . $name . static::SCRIPT_EXTENSION); // use default if no aliases are found. if (is_null($this->language_alias)) { @@ -928,7 +928,7 @@ class c_standard_paths extends c_base_return { } // use include_once instead of require_require to allow for failsafe behavior. - @include_once($path . $this->language_alias . '/' . $name . self::SCRIPT_EXTENSION); + @include_once($path . $this->language_alias . '/' . $name . static::SCRIPT_EXTENSION); $language_class = $class . '_' . $this->language_alias; if (class_exists($language_class)) { diff --git a/common/standard/menus/menu_breadcrumbs.php b/common/standard/menus/menu_breadcrumbs.php index 0317099..99928fd 100644 --- a/common/standard/menus/menu_breadcrumbs.php +++ b/common/standard/menus/menu_breadcrumbs.php @@ -33,7 +33,7 @@ class c_standard_menu_breadcrumbs extends c_standard_menu { return new c_base_return_false(); } - $menu = $this->pr_create_html_create_menu($settings['base_css'] . self::CLASS_NAME, $this->pr_get_text(0)); + $menu = $this->pr_create_html_create_menu($settings['base_css'] . static::CLASS_NAME, $this->pr_get_text(0)); foreach ($items->get_items()->get_value_exact() as $item) { if (!($item instanceof c_base_menu_item)) { continue; @@ -52,7 +52,7 @@ class c_standard_menu_breadcrumbs extends c_standard_menu { unset($item_uri); unset($item_text); - $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, self::CLASS_ITEM); + $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_ITEM); $item_attributes = $item->get_attributes()->get_value_exact(); if (is_array($item_attributes) && !empty($item_attributes)) { diff --git a/common/standard/menus/menu_utility.php b/common/standard/menus/menu_utility.php index d184acc..836f1ed 100644 --- a/common/standard/menus/menu_utility.php +++ b/common/standard/menus/menu_utility.php @@ -38,46 +38,46 @@ class c_standard_menu_utility extends c_standard_menu { $roles = $session->get_user_current()->get_roles()->get_value_exact(); - $menu = $this->pr_create_html_create_menu($settings['base_css'] . self::CLASS_NAME, $this->pr_get_text(0)); + $menu = $this->pr_create_html_create_menu($settings['base_css'] . static::CLASS_NAME, $this->pr_get_text(0)); if ($session->is_logged_in() instanceof c_base_return_true) { $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(3), $settings['base_path'] . c_standard_paths::URI_USER_DASHBOARD); - $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, self::CLASS_DASHBOARD_USER); + $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_DASHBOARD_USER); $menu->set_tag($item); unset($item); if (array_key_exists(c_base_roles::MANAGER, $roles) || array_key_exists(c_base_roles::ADMINISTER, $roles)) { $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(4), $settings['base_path'] . c_standard_paths::URI_DASHBOARD_MANAGEMENT); - $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, self::CLASS_DASHBOARD_MANAGEMENT); + $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_DASHBOARD_MANAGEMENT); $menu->set_tag($item); unset($item); } if (array_key_exists(c_base_roles::ADMINISTER, $roles)) { $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(5), $settings['base_path'] . c_standard_paths::URI_DASHBOARD_ADMINISTER); - $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, self::CLASS_DASHBOARD_ADMINISTER); + $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_DASHBOARD_ADMINISTER); $menu->set_tag($item); unset($item); } $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(6), $settings['base_path'] . c_standard_paths::URI_USER_VIEW); - $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, self::CLASS_USER_SETTINGS); + $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_USER_SETTINGS); $menu->set_tag($item); unset($item); $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(7), $settings['base_path'] . c_standard_paths::URI_USER_LOGOUT); - $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, self::CLASS_LOGOUT); + $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_LOGOUT); $menu->set_tag($item); unset($item); } else { $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(1), $settings['base_path'] . c_standard_paths::URI_HOME); - $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, self::CLASS_HOME); + $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_HOME); $menu->set_tag($item); unset($item); $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(2), $settings['base_path'] . c_standard_paths::URI_USER_LOGIN); - $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, self::CLASS_LOGIN); + $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_LOGIN); $menu->set_tag($item); unset($item); } diff --git a/common/standard/paths/u/user_login.php b/common/standard/paths/u/user_login.php index 64c391e..d8a8a92 100644 --- a/common/standard/paths/u/user_login.php +++ b/common/standard/paths/u/user_login.php @@ -327,7 +327,7 @@ class c_standard_path_user_login extends c_standard_path { if (empty($_POST['login_form-user_name']) || !is_string($_POST['login_form-user_name'])) { $problems[] = c_base_form_problem::s_create_error('login_form-user_name', self::pr_get_text(10)); } - elseif ($_POST['login_form-user_name'] == self::USER_PUBLIC) { + elseif ($_POST['login_form-user_name'] == static::USER_PUBLIC) { // explicitly deny access to internal user accounts $problems[] = c_base_form_problem::s_create_error('login_form-user_name', self::pr_get_text(10)); } @@ -584,7 +584,7 @@ class c_standard_path_user_login extends c_standard_path { $data = array( 'session_id' => $session->get_session_id()->get_value_exact(), - 'expire' => gmdate(self::SESSION_DATE_FORMAT, $session_expire), // unnecessary, but provided for debug purposes. + 'expire' => gmdate(static::SESSION_DATE_FORMAT, $session_expire), // unnecessary, but provided for debug purposes. ); $cookie_login->set_value($data); diff --git a/common/standard/paths/u/user_settings.php b/common/standard/paths/u/user_settings.php index 00e3665..30b67d2 100644 --- a/common/standard/paths/u/user_settings.php +++ b/common/standard/paths/u/user_settings.php @@ -55,7 +55,7 @@ class c_standard_path_user_settings extends c_standard_path { $id_user = (int) $argument; // do not allow view access to reserved/special accounts. - if ($id_user < self::ID_USER_MINIMUM) { + if ($id_user < static::ID_USER_MINIMUM) { $id_user = FALSE; } } @@ -116,7 +116,7 @@ class c_standard_path_user_settings extends c_standard_path { $id_user = $user->get_id()->get_value_exact(); // do not allow view access to reserved/special accounts. - if ($id_user < self::ID_USER_MINIMUM) { + if ($id_user < static::ID_USER_MINIMUM) { $id_user = FALSE; } } @@ -426,7 +426,7 @@ class c_standard_path_user_settings extends c_standard_path { $id_user = $user->get_id()->get_value(); if (is_int($id_user)) { - $text_id_user = $this->pr_create_tag_text('[id: ' . $id_user . ']', array(), NULL, self::CLASS_ID_USER); + $text_id_user = $this->pr_create_tag_text('[id: ' . $id_user . ']', array(), NULL, static::CLASS_ID_USER); $wrapper = $this->pr_create_tag_section(array(1 => array('text' => 0, 'append-inside' => $text_id_user)), $arguments); unset($text_id_user); } @@ -454,8 +454,8 @@ class c_standard_path_user_settings extends c_standard_path { // account information - $fieldset = $this->pr_create_tag_fieldset(14, array(), self::CLASS_USER_SETTINGS_ACCOUNT, self::CLASS_USER_SETTINGS_ACCOUNT); - $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, self::CSS_AS_FIELD_SET_CONTENT, array(self::CSS_AS_FIELD_SET_CONTENT)); + $fieldset = $this->pr_create_tag_fieldset(14, array(), static::CLASS_USER_SETTINGS_ACCOUNT, static::CLASS_USER_SETTINGS_ACCOUNT); + $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, static::CSS_AS_FIELD_SET_CONTENT, array(static::CSS_AS_FIELD_SET_CONTENT)); $content->set_tag($this->pr_create_tag_field_row(18, '' . $id_user, array(), NULL, c_standard_path::CSS_AS_ROW_EVEN, 0, TRUE)); @@ -582,8 +582,8 @@ class c_standard_path_user_settings extends c_standard_path { if ($full_view_access || !$user->is_private()->get_value()) { // personal information - $fieldset = $this->pr_create_tag_fieldset(15, array(), self::CLASS_USER_SETTINGS_PERSONAL, self::CLASS_USER_SETTINGS_PERSONAL); - $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, self::CSS_AS_FIELD_SET_CONTENT, array(self::CSS_AS_FIELD_SET_CONTENT)); + $fieldset = $this->pr_create_tag_fieldset(15, array(), static::CLASS_USER_SETTINGS_PERSONAL, static::CLASS_USER_SETTINGS_PERSONAL); + $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, static::CSS_AS_FIELD_SET_CONTENT, array(static::CSS_AS_FIELD_SET_CONTENT)); $content->set_tag($this->pr_create_tag_field_row(37, '' . $user->get_name_human()->get_prefix()->get_value(), array(), NULL, c_standard_path::CSS_AS_ROW_EVEN, 0, TRUE)); $content->set_tag($this->pr_create_tag_field_row(38, '' . $user->get_name_human()->get_first()->get_value(), array(), NULL, c_standard_path::CSS_AS_ROW_ODD, 1, TRUE)); @@ -600,8 +600,8 @@ class c_standard_path_user_settings extends c_standard_path { // access information - $fieldset = $this->pr_create_tag_fieldset(16, array(), self::CLASS_USER_SETTINGS_ACCESS, self::CLASS_USER_SETTINGS_ACCESS); - $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, self::CSS_AS_FIELD_SET_CONTENT, array(self::CSS_AS_FIELD_SET_CONTENT)); + $fieldset = $this->pr_create_tag_fieldset(16, array(), static::CLASS_USER_SETTINGS_ACCESS, static::CLASS_USER_SETTINGS_ACCESS); + $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, static::CSS_AS_FIELD_SET_CONTENT, array(static::CSS_AS_FIELD_SET_CONTENT)); $access_to_text_mapping = array( c_base_roles::PUBLIC => 1, @@ -643,8 +643,8 @@ class c_standard_path_user_settings extends c_standard_path { // history information - $fieldset = $this->pr_create_tag_fieldset(17, array(), self::CLASS_USER_SETTINGS_HISTORY, self::CLASS_USER_SETTINGS_HISTORY); - $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, self::CSS_AS_FIELD_SET_CONTENT, array(self::CSS_AS_FIELD_SET_CONTENT)); + $fieldset = $this->pr_create_tag_fieldset(17, array(), static::CLASS_USER_SETTINGS_HISTORY, static::CLASS_USER_SETTINGS_HISTORY); + $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, static::CSS_AS_FIELD_SET_CONTENT, array(static::CSS_AS_FIELD_SET_CONTENT)); // user history // @todo: implement code for processing and generating a table/list of history, with the ability to navigate additional entries. diff --git a/common/theme/classes/theme_form.php b/common/theme/classes/theme_form.php index c1cce81..c90e18f 100644 --- a/common/theme/classes/theme_form.php +++ b/common/theme/classes/theme_form.php @@ -134,151 +134,151 @@ class c_theme_form_tag extends c_base_markup_tag { } switch ($attribute) { - case self::ATTRIBUTE_NONE: + case static::ATTRIBUTE_NONE: unset($this->attribute[$attribute]); return new c_base_return_true(); - case self::ATTRIBUTE_ACTION: - case self::ATTRIBUTE_DIRECTION_NAME: - case self::ATTRIBUTE_FOR: - case self::ATTRIBUTE_FORM: - case self::ATTRIBUTE_FORM_ACTION: - case self::ATTRIBUTE_FORM_TARGET: - case self::ATTRIBUTE_KEY_TYPE: - case self::ATTRIBUTE_LABEL: - case self::ATTRIBUTE_LIST: - case self::ATTRIBUTE_NAME: - case self::ATTRIBUTE_ON_ABORT: - case self::ATTRIBUTE_ON_AFTER_PRINT: - case self::ATTRIBUTE_ON_ANIMATION_END: - case self::ATTRIBUTE_ON_ANIMATION_ITERATION: - case self::ATTRIBUTE_ON_ANIMATION_start: - case self::ATTRIBUTE_ON_BEFORE_UNLOAD: - case self::ATTRIBUTE_ON_BEFORE_PRINT: - case self::ATTRIBUTE_ON_BLUR: - case self::ATTRIBUTE_ON_CLICK: - case self::ATTRIBUTE_ON_CONTEXT_MENU: - case self::ATTRIBUTE_ON_COPY: - case self::ATTRIBUTE_ON_CUT: - case self::ATTRIBUTE_ON_CAN_PLAY: - case self::ATTRIBUTE_ON_CAN_PLAY_THROUGH: - case self::ATTRIBUTE_ON_CHANGE: - case self::ATTRIBUTE_ON_DOUBLE_CLICK: - case self::ATTRIBUTE_ON_DRAG: - case self::ATTRIBUTE_ON_DRAG_END: - case self::ATTRIBUTE_ON_DRAG_ENTER: - case self::ATTRIBUTE_ON_DRAG_LEAVE: - case self::ATTRIBUTE_ON_DRAG_OVER: - case self::ATTRIBUTE_ON_DRAG_START: - case self::ATTRIBUTE_ON_DROP: - case self::ATTRIBUTE_ON_DURATION_CHANGE: - case self::ATTRIBUTE_ON_ERROR: - case self::ATTRIBUTE_ON_EMPTIED: - case self::ATTRIBUTE_ON_ENDED: - case self::ATTRIBUTE_ON_ERROR: - case self::ATTRIBUTE_ON_FOCUS: - case self::ATTRIBUTE_ON_FOCUS_IN: - case self::ATTRIBUTE_ON_FOCUS_OUT: - case self::ATTRIBUTE_ON_HASH_CHANGE: - case self::ATTRIBUTE_ON_INPUT: - case self::ATTRIBUTE_ON_INVALID: - case self::ATTRIBUTE_ON_KEY_DOWN: - case self::ATTRIBUTE_ON_KEY_PRESS: - case self::ATTRIBUTE_ON_KEY_UP: - case self::ATTRIBUTE_ON_LOAD: - case self::ATTRIBUTE_ON_LOADED_DATA: - case self::ATTRIBUTE_ON_LOADED_META_DATA: - case self::ATTRIBUTE_ON_LOAD_START: - case self::ATTRIBUTE_ON_MOUSE_DOWN: - case self::ATTRIBUTE_ON_MOUSE_ENTER: - case self::ATTRIBUTE_ON_MOUSE_LEAVE: - case self::ATTRIBUTE_ON_MOUSE_MOVE: - case self::ATTRIBUTE_ON_MOUSE_OVER: - case self::ATTRIBUTE_ON_MOUSE_OUT: - case self::ATTRIBUTE_ON_MOUSE_UP: - case self::ATTRIBUTE_ON_MESSAGE: - case self::ATTRIBUTE_ON_MOUSE_WHEEL: - case self::ATTRIBUTE_ON_OPEN: - case self::ATTRIBUTE_ON_ONLINE: - case self::ATTRIBUTE_ON_OFFLINE: - case self::ATTRIBUTE_ON_PAGE_SHOW: - case self::ATTRIBUTE_ON_PAGE_HIDE: - case self::ATTRIBUTE_ON_PASTE: - case self::ATTRIBUTE_ON_PAUSE: - case self::ATTRIBUTE_ON_PLAY: - case self::ATTRIBUTE_ON_PLAYING: - case self::ATTRIBUTE_ON_PROGRESS: - case self::ATTRIBUTE_ON_POP_STATE: - case self::ATTRIBUTE_ON_RESIZE: - case self::ATTRIBUTE_ON_RESET: - case self::ATTRIBUTE_ON_RATE_CHANGE: - case self::ATTRIBUTE_ON_SCROLL: - case self::ATTRIBUTE_ON_SEARCH: - case self::ATTRIBUTE_ON_SELECT: - case self::ATTRIBUTE_ON_SUBMIT: - case self::ATTRIBUTE_ON_SEEKED: - case self::ATTRIBUTE_ON_SEEKING: - case self::ATTRIBUTE_ON_STALLED: - case self::ATTRIBUTE_ON_SUSPEND: - case self::ATTRIBUTE_ON_SHOW: - case self::ATTRIBUTE_ON_STORAGE: - case self::ATTRIBUTE_ON_TIME_UPDATE: - case self::ATTRIBUTE_ON_TRANSITION_END: - case self::ATTRIBUTE_ON_TOGGLE: - case self::ATTRIBUTE_ON_TOUCH_CANCEL: - case self::ATTRIBUTE_ON_TOUCH_END: - case self::ATTRIBUTE_ON_TOUCH_MOVE: - case self::ATTRIBUTE_ON_TOUCH_START: - case self::ATTRIBUTE_ON_UNLOAD: - case self::ATTRIBUTE_ON_VOLUME_CHANGE: - case self::ATTRIBUTE_ON_WAITING: - case self::ATTRIBUTE_ON_WHEEL: - case self::ATTRIBUTE_PATTERN: - case self::ATTRIBUTE_PLACE_HOLDER: - case self::ATTRIBUTE_READONLY: - case self::ATTRIBUTE_REQUIRED: - case self::ATTRIBUTE_ROWS: - case self::ATTRIBUTE_SELECTED: - case self::ATTRIBUTE_SIZE: - case self::ATTRIBUTE_SOURCE: - case self::ATTRIBUTE_STEP: - case self::ATTRIBUTE_TYPE: - case self::ATTRIBUTE_WRAP: - case self::ATTRIBUTE_VALUE: + case static::ATTRIBUTE_ACTION: + case static::ATTRIBUTE_DIRECTION_NAME: + case static::ATTRIBUTE_FOR: + case static::ATTRIBUTE_FORM: + case static::ATTRIBUTE_FORM_ACTION: + case static::ATTRIBUTE_FORM_TARGET: + case static::ATTRIBUTE_KEY_TYPE: + case static::ATTRIBUTE_LABEL: + case static::ATTRIBUTE_LIST: + case static::ATTRIBUTE_NAME: + case static::ATTRIBUTE_ON_ABORT: + case static::ATTRIBUTE_ON_AFTER_PRINT: + case static::ATTRIBUTE_ON_ANIMATION_END: + case static::ATTRIBUTE_ON_ANIMATION_ITERATION: + case static::ATTRIBUTE_ON_ANIMATION_start: + case static::ATTRIBUTE_ON_BEFORE_UNLOAD: + case static::ATTRIBUTE_ON_BEFORE_PRINT: + case static::ATTRIBUTE_ON_BLUR: + case static::ATTRIBUTE_ON_CLICK: + case static::ATTRIBUTE_ON_CONTEXT_MENU: + case static::ATTRIBUTE_ON_COPY: + case static::ATTRIBUTE_ON_CUT: + case static::ATTRIBUTE_ON_CAN_PLAY: + case static::ATTRIBUTE_ON_CAN_PLAY_THROUGH: + case static::ATTRIBUTE_ON_CHANGE: + case static::ATTRIBUTE_ON_DOUBLE_CLICK: + case static::ATTRIBUTE_ON_DRAG: + case static::ATTRIBUTE_ON_DRAG_END: + case static::ATTRIBUTE_ON_DRAG_ENTER: + case static::ATTRIBUTE_ON_DRAG_LEAVE: + case static::ATTRIBUTE_ON_DRAG_OVER: + case static::ATTRIBUTE_ON_DRAG_START: + case static::ATTRIBUTE_ON_DROP: + case static::ATTRIBUTE_ON_DURATION_CHANGE: + case static::ATTRIBUTE_ON_ERROR: + case static::ATTRIBUTE_ON_EMPTIED: + case static::ATTRIBUTE_ON_ENDED: + case static::ATTRIBUTE_ON_ERROR: + case static::ATTRIBUTE_ON_FOCUS: + case static::ATTRIBUTE_ON_FOCUS_IN: + case static::ATTRIBUTE_ON_FOCUS_OUT: + case static::ATTRIBUTE_ON_HASH_CHANGE: + case static::ATTRIBUTE_ON_INPUT: + case static::ATTRIBUTE_ON_INVALID: + case static::ATTRIBUTE_ON_KEY_DOWN: + case static::ATTRIBUTE_ON_KEY_PRESS: + case static::ATTRIBUTE_ON_KEY_UP: + case static::ATTRIBUTE_ON_LOAD: + case static::ATTRIBUTE_ON_LOADED_DATA: + case static::ATTRIBUTE_ON_LOADED_META_DATA: + case static::ATTRIBUTE_ON_LOAD_START: + case static::ATTRIBUTE_ON_MOUSE_DOWN: + case static::ATTRIBUTE_ON_MOUSE_ENTER: + case static::ATTRIBUTE_ON_MOUSE_LEAVE: + case static::ATTRIBUTE_ON_MOUSE_MOVE: + case static::ATTRIBUTE_ON_MOUSE_OVER: + case static::ATTRIBUTE_ON_MOUSE_OUT: + case static::ATTRIBUTE_ON_MOUSE_UP: + case static::ATTRIBUTE_ON_MESSAGE: + case static::ATTRIBUTE_ON_MOUSE_WHEEL: + case static::ATTRIBUTE_ON_OPEN: + case static::ATTRIBUTE_ON_ONLINE: + case static::ATTRIBUTE_ON_OFFLINE: + case static::ATTRIBUTE_ON_PAGE_SHOW: + case static::ATTRIBUTE_ON_PAGE_HIDE: + case static::ATTRIBUTE_ON_PASTE: + case static::ATTRIBUTE_ON_PAUSE: + case static::ATTRIBUTE_ON_PLAY: + case static::ATTRIBUTE_ON_PLAYING: + case static::ATTRIBUTE_ON_PROGRESS: + case static::ATTRIBUTE_ON_POP_STATE: + case static::ATTRIBUTE_ON_RESIZE: + case static::ATTRIBUTE_ON_RESET: + case static::ATTRIBUTE_ON_RATE_CHANGE: + case static::ATTRIBUTE_ON_SCROLL: + case static::ATTRIBUTE_ON_SEARCH: + case static::ATTRIBUTE_ON_SELECT: + case static::ATTRIBUTE_ON_SUBMIT: + case static::ATTRIBUTE_ON_SEEKED: + case static::ATTRIBUTE_ON_SEEKING: + case static::ATTRIBUTE_ON_STALLED: + case static::ATTRIBUTE_ON_SUSPEND: + case static::ATTRIBUTE_ON_SHOW: + case static::ATTRIBUTE_ON_STORAGE: + case static::ATTRIBUTE_ON_TIME_UPDATE: + case static::ATTRIBUTE_ON_TRANSITION_END: + case static::ATTRIBUTE_ON_TOGGLE: + case static::ATTRIBUTE_ON_TOUCH_CANCEL: + case static::ATTRIBUTE_ON_TOUCH_END: + case static::ATTRIBUTE_ON_TOUCH_MOVE: + case static::ATTRIBUTE_ON_TOUCH_START: + case static::ATTRIBUTE_ON_UNLOAD: + case static::ATTRIBUTE_ON_VOLUME_CHANGE: + case static::ATTRIBUTE_ON_WAITING: + case static::ATTRIBUTE_ON_WHEEL: + case static::ATTRIBUTE_PATTERN: + case static::ATTRIBUTE_PLACE_HOLDER: + case static::ATTRIBUTE_READONLY: + case static::ATTRIBUTE_REQUIRED: + case static::ATTRIBUTE_ROWS: + case static::ATTRIBUTE_SELECTED: + case static::ATTRIBUTE_SIZE: + case static::ATTRIBUTE_SOURCE: + case static::ATTRIBUTE_STEP: + case static::ATTRIBUTE_TYPE: + case static::ATTRIBUTE_WRAP: + case static::ATTRIBUTE_VALUE: if (!is_string($value)) { return new c_base_return_false(); } break; - case self::ATTRIBUTE_FORM_NO_VALIDATED: - case self::ATTRIBUTE_AUTO_COMPLETE: - case self::ATTRIBUTE_AUTO_FOCUS: - case self::ATTRIBUTE_CHALLENGE: - case self::ATTRIBUTE_CHECKED: - case self::ATTRIBUTE_DISABLED: - case self::ATTRIBUTE_MULTIPLE: + case static::ATTRIBUTE_FORM_NO_VALIDATED: + case static::ATTRIBUTE_AUTO_COMPLETE: + case static::ATTRIBUTE_AUTO_FOCUS: + case static::ATTRIBUTE_CHALLENGE: + case static::ATTRIBUTE_CHECKED: + case static::ATTRIBUTE_DISABLED: + case static::ATTRIBUTE_MULTIPLE: if (!is_bool($value)) { return new c_base_return_false(); } break; - case self::ATTRIBUTE_ACCEPT: - case self::ATTRIBUTE_FORM_ENCODE_TYPE: + case static::ATTRIBUTE_ACCEPT: + case static::ATTRIBUTE_FORM_ENCODE_TYPE: if (!$this->pr_validate_value_mime_type($value)) { return new c_base_return_false(); } break; - case self::ATTRIBUTE_COLUMNS: - case self::ATTRIBUTE_MAXIMUM: - case self::ATTRIBUTE_MAXIMUM_LENGTH: - case self::ATTRIBUTE_MINIMUM: + case static::ATTRIBUTE_COLUMNS: + case static::ATTRIBUTE_MAXIMUM: + case static::ATTRIBUTE_MAXIMUM_LENGTH: + case static::ATTRIBUTE_MINIMUM: if (!is_int($value)) { return new c_base_return_false(); } break; - case self::ATTRIBUTE_FORM_METHOD: + case static::ATTRIBUTE_FORM_METHOD: if (!$this->pr_validate_value_http_method($value)) { return new c_base_return_false(); } @@ -330,139 +330,139 @@ class c_theme_form_tag extends c_base_markup_tag { if (array_key_exists($attribute, $this->attributes)) { switch ($attribute) { - case self::ATTRIBUTE_NONE: + case static::ATTRIBUTE_NONE: // should not be possible, so consider this an error (attributes set to NONE are actually unset from the array). return c_base_return_error::s_false(); - case self::ATTRIBUTE_ACTION: - case self::ATTRIBUTE_DIRECTION_NAME: - case self::ATTRIBUTE_FOR: - case self::ATTRIBUTE_FORM: - case self::ATTRIBUTE_FORM_ACTION: - case self::ATTRIBUTE_FORM_TARGET: - case self::ATTRIBUTE_KEY_TYPE: - case self::ATTRIBUTE_LABEL: - case self::ATTRIBUTE_LIST: - case self::ATTRIBUTE_NAME: - case self::ATTRIBUTE_ON_ABORT: - case self::ATTRIBUTE_ON_AFTER_PRINT: - case self::ATTRIBUTE_ON_ANIMATION_END: - case self::ATTRIBUTE_ON_ANIMATION_ITERATION: - case self::ATTRIBUTE_ON_ANIMATION_start: - case self::ATTRIBUTE_ON_BEFORE_UNLOAD: - case self::ATTRIBUTE_ON_BEFORE_PRINT: - case self::ATTRIBUTE_ON_BLUR: - case self::ATTRIBUTE_ON_CLICK: - case self::ATTRIBUTE_ON_CONTEXT_MENU: - case self::ATTRIBUTE_ON_COPY: - case self::ATTRIBUTE_ON_CUT: - case self::ATTRIBUTE_ON_CAN_PLAY: - case self::ATTRIBUTE_ON_CAN_PLAY_THROUGH: - case self::ATTRIBUTE_ON_CHANGE: - case self::ATTRIBUTE_ON_DOUBLE_CLICK: - case self::ATTRIBUTE_ON_DRAG: - case self::ATTRIBUTE_ON_DRAG_END: - case self::ATTRIBUTE_ON_DRAG_ENTER: - case self::ATTRIBUTE_ON_DRAG_LEAVE: - case self::ATTRIBUTE_ON_DRAG_OVER: - case self::ATTRIBUTE_ON_DRAG_START: - case self::ATTRIBUTE_ON_DROP: - case self::ATTRIBUTE_ON_DURATION_CHANGE: - case self::ATTRIBUTE_ON_ERROR: - case self::ATTRIBUTE_ON_EMPTIED: - case self::ATTRIBUTE_ON_ENDED: - case self::ATTRIBUTE_ON_ERROR: - case self::ATTRIBUTE_ON_FOCUS: - case self::ATTRIBUTE_ON_FOCUS_IN: - case self::ATTRIBUTE_ON_FOCUS_OUT: - case self::ATTRIBUTE_ON_HASH_CHANGE: - case self::ATTRIBUTE_ON_INPUT: - case self::ATTRIBUTE_ON_INVALID: - case self::ATTRIBUTE_ON_KEY_DOWN: - case self::ATTRIBUTE_ON_KEY_PRESS: - case self::ATTRIBUTE_ON_KEY_UP: - case self::ATTRIBUTE_ON_LOAD: - case self::ATTRIBUTE_ON_LOADED_DATA: - case self::ATTRIBUTE_ON_LOADED_META_DATA: - case self::ATTRIBUTE_ON_LOAD_START: - case self::ATTRIBUTE_ON_MOUSE_DOWN: - case self::ATTRIBUTE_ON_MOUSE_ENTER: - case self::ATTRIBUTE_ON_MOUSE_LEAVE: - case self::ATTRIBUTE_ON_MOUSE_MOVE: - case self::ATTRIBUTE_ON_MOUSE_OVER: - case self::ATTRIBUTE_ON_MOUSE_OUT: - case self::ATTRIBUTE_ON_MOUSE_UP: - case self::ATTRIBUTE_ON_MESSAGE: - case self::ATTRIBUTE_ON_MOUSE_WHEEL: - case self::ATTRIBUTE_ON_OPEN: - case self::ATTRIBUTE_ON_ONLINE: - case self::ATTRIBUTE_ON_OFFLINE: - case self::ATTRIBUTE_ON_PAGE_SHOW: - case self::ATTRIBUTE_ON_PAGE_HIDE: - case self::ATTRIBUTE_ON_PASTE: - case self::ATTRIBUTE_ON_PAUSE: - case self::ATTRIBUTE_ON_PLAY: - case self::ATTRIBUTE_ON_PLAYING: - case self::ATTRIBUTE_ON_PROGRESS: - case self::ATTRIBUTE_ON_POP_STATE: - case self::ATTRIBUTE_ON_RESIZE: - case self::ATTRIBUTE_ON_RESET: - case self::ATTRIBUTE_ON_RATE_CHANGE: - case self::ATTRIBUTE_ON_SCROLL: - case self::ATTRIBUTE_ON_SEARCH: - case self::ATTRIBUTE_ON_SELECT: - case self::ATTRIBUTE_ON_SUBMIT: - case self::ATTRIBUTE_ON_SEEKED: - case self::ATTRIBUTE_ON_SEEKING: - case self::ATTRIBUTE_ON_STALLED: - case self::ATTRIBUTE_ON_SUSPEND: - case self::ATTRIBUTE_ON_SHOW: - case self::ATTRIBUTE_ON_STORAGE: - case self::ATTRIBUTE_ON_TIME_UPDATE: - case self::ATTRIBUTE_ON_TRANSITION_END: - case self::ATTRIBUTE_ON_TOGGLE: - case self::ATTRIBUTE_ON_TOUCH_CANCEL: - case self::ATTRIBUTE_ON_TOUCH_END: - case self::ATTRIBUTE_ON_TOUCH_MOVE: - case self::ATTRIBUTE_ON_TOUCH_START: - case self::ATTRIBUTE_ON_UNLOAD: - case self::ATTRIBUTE_ON_VOLUME_CHANGE: - case self::ATTRIBUTE_ON_WAITING: - case self::ATTRIBUTE_ON_WHEEL: - case self::ATTRIBUTE_PATTERN: - case self::ATTRIBUTE_READONLY: - case self::ATTRIBUTE_REQUIRED: - case self::ATTRIBUTE_ROWS: - case self::ATTRIBUTE_SELECTED: - case self::ATTRIBUTE_SIZE: - case self::ATTRIBUTE_SOURCE: - case self::ATTRIBUTE_STEP: - case self::ATTRIBUTE_TYPE: - case self::ATTRIBUTE_WRAP: - case self::ATTRIBUTE_PLACE_HOLDER: - case self::ATTRIBUTE_VALUE: + case static::ATTRIBUTE_ACTION: + case static::ATTRIBUTE_DIRECTION_NAME: + case static::ATTRIBUTE_FOR: + case static::ATTRIBUTE_FORM: + case static::ATTRIBUTE_FORM_ACTION: + case static::ATTRIBUTE_FORM_TARGET: + case static::ATTRIBUTE_KEY_TYPE: + case static::ATTRIBUTE_LABEL: + case static::ATTRIBUTE_LIST: + case static::ATTRIBUTE_NAME: + case static::ATTRIBUTE_ON_ABORT: + case static::ATTRIBUTE_ON_AFTER_PRINT: + case static::ATTRIBUTE_ON_ANIMATION_END: + case static::ATTRIBUTE_ON_ANIMATION_ITERATION: + case static::ATTRIBUTE_ON_ANIMATION_start: + case static::ATTRIBUTE_ON_BEFORE_UNLOAD: + case static::ATTRIBUTE_ON_BEFORE_PRINT: + case static::ATTRIBUTE_ON_BLUR: + case static::ATTRIBUTE_ON_CLICK: + case static::ATTRIBUTE_ON_CONTEXT_MENU: + case static::ATTRIBUTE_ON_COPY: + case static::ATTRIBUTE_ON_CUT: + case static::ATTRIBUTE_ON_CAN_PLAY: + case static::ATTRIBUTE_ON_CAN_PLAY_THROUGH: + case static::ATTRIBUTE_ON_CHANGE: + case static::ATTRIBUTE_ON_DOUBLE_CLICK: + case static::ATTRIBUTE_ON_DRAG: + case static::ATTRIBUTE_ON_DRAG_END: + case static::ATTRIBUTE_ON_DRAG_ENTER: + case static::ATTRIBUTE_ON_DRAG_LEAVE: + case static::ATTRIBUTE_ON_DRAG_OVER: + case static::ATTRIBUTE_ON_DRAG_START: + case static::ATTRIBUTE_ON_DROP: + case static::ATTRIBUTE_ON_DURATION_CHANGE: + case static::ATTRIBUTE_ON_ERROR: + case static::ATTRIBUTE_ON_EMPTIED: + case static::ATTRIBUTE_ON_ENDED: + case static::ATTRIBUTE_ON_ERROR: + case static::ATTRIBUTE_ON_FOCUS: + case static::ATTRIBUTE_ON_FOCUS_IN: + case static::ATTRIBUTE_ON_FOCUS_OUT: + case static::ATTRIBUTE_ON_HASH_CHANGE: + case static::ATTRIBUTE_ON_INPUT: + case static::ATTRIBUTE_ON_INVALID: + case static::ATTRIBUTE_ON_KEY_DOWN: + case static::ATTRIBUTE_ON_KEY_PRESS: + case static::ATTRIBUTE_ON_KEY_UP: + case static::ATTRIBUTE_ON_LOAD: + case static::ATTRIBUTE_ON_LOADED_DATA: + case static::ATTRIBUTE_ON_LOADED_META_DATA: + case static::ATTRIBUTE_ON_LOAD_START: + case static::ATTRIBUTE_ON_MOUSE_DOWN: + case static::ATTRIBUTE_ON_MOUSE_ENTER: + case static::ATTRIBUTE_ON_MOUSE_LEAVE: + case static::ATTRIBUTE_ON_MOUSE_MOVE: + case static::ATTRIBUTE_ON_MOUSE_OVER: + case static::ATTRIBUTE_ON_MOUSE_OUT: + case static::ATTRIBUTE_ON_MOUSE_UP: + case static::ATTRIBUTE_ON_MESSAGE: + case static::ATTRIBUTE_ON_MOUSE_WHEEL: + case static::ATTRIBUTE_ON_OPEN: + case static::ATTRIBUTE_ON_ONLINE: + case static::ATTRIBUTE_ON_OFFLINE: + case static::ATTRIBUTE_ON_PAGE_SHOW: + case static::ATTRIBUTE_ON_PAGE_HIDE: + case static::ATTRIBUTE_ON_PASTE: + case static::ATTRIBUTE_ON_PAUSE: + case static::ATTRIBUTE_ON_PLAY: + case static::ATTRIBUTE_ON_PLAYING: + case static::ATTRIBUTE_ON_PROGRESS: + case static::ATTRIBUTE_ON_POP_STATE: + case static::ATTRIBUTE_ON_RESIZE: + case static::ATTRIBUTE_ON_RESET: + case static::ATTRIBUTE_ON_RATE_CHANGE: + case static::ATTRIBUTE_ON_SCROLL: + case static::ATTRIBUTE_ON_SEARCH: + case static::ATTRIBUTE_ON_SELECT: + case static::ATTRIBUTE_ON_SUBMIT: + case static::ATTRIBUTE_ON_SEEKED: + case static::ATTRIBUTE_ON_SEEKING: + case static::ATTRIBUTE_ON_STALLED: + case static::ATTRIBUTE_ON_SUSPEND: + case static::ATTRIBUTE_ON_SHOW: + case static::ATTRIBUTE_ON_STORAGE: + case static::ATTRIBUTE_ON_TIME_UPDATE: + case static::ATTRIBUTE_ON_TRANSITION_END: + case static::ATTRIBUTE_ON_TOGGLE: + case static::ATTRIBUTE_ON_TOUCH_CANCEL: + case static::ATTRIBUTE_ON_TOUCH_END: + case static::ATTRIBUTE_ON_TOUCH_MOVE: + case static::ATTRIBUTE_ON_TOUCH_START: + case static::ATTRIBUTE_ON_UNLOAD: + case static::ATTRIBUTE_ON_VOLUME_CHANGE: + case static::ATTRIBUTE_ON_WAITING: + case static::ATTRIBUTE_ON_WHEEL: + case static::ATTRIBUTE_PATTERN: + case static::ATTRIBUTE_READONLY: + case static::ATTRIBUTE_REQUIRED: + case static::ATTRIBUTE_ROWS: + case static::ATTRIBUTE_SELECTED: + case static::ATTRIBUTE_SIZE: + case static::ATTRIBUTE_SOURCE: + case static::ATTRIBUTE_STEP: + case static::ATTRIBUTE_TYPE: + case static::ATTRIBUTE_WRAP: + case static::ATTRIBUTE_PLACE_HOLDER: + case static::ATTRIBUTE_VALUE: return c_base_return_string::s_new($value); - case self::ATTRIBUTE_FORM_NO_VALIDATED: - case self::ATTRIBUTE_AUTO_COMPLETE: - case self::ATTRIBUTE_AUTO_FOCUS: - case self::ATTRIBUTE_CHALLENGE: - case self::ATTRIBUTE_CHECKED: - case self::ATTRIBUTE_DISABLED: - case self::ATTRIBUTE_MULTIPLE: + case static::ATTRIBUTE_FORM_NO_VALIDATED: + case static::ATTRIBUTE_AUTO_COMPLETE: + case static::ATTRIBUTE_AUTO_FOCUS: + case static::ATTRIBUTE_CHALLENGE: + case static::ATTRIBUTE_CHECKED: + case static::ATTRIBUTE_DISABLED: + case static::ATTRIBUTE_MULTIPLE: return c_base_return_bool::s_new($value); - case self::ATTRIBUTE_ACCEPT: - case self::ATTRIBUTE_FORM_ENCODE_TYPE: + case static::ATTRIBUTE_ACCEPT: + case static::ATTRIBUTE_FORM_ENCODE_TYPE: return c_base_return_int::s_new($value); - case self::ATTRIBUTE_COLUMNS: - case self::ATTRIBUTE_MAXIMUM: - case self::ATTRIBUTE_MAXIMUM_LENGTH: - case self::ATTRIBUTE_MINIMUM: + case static::ATTRIBUTE_COLUMNS: + case static::ATTRIBUTE_MAXIMUM: + case static::ATTRIBUTE_MAXIMUM_LENGTH: + case static::ATTRIBUTE_MINIMUM: return c_base_return_int::s_new($value); - case self::ATTRIBUTE_FORM_METHOD: + case static::ATTRIBUTE_FORM_METHOD: return c_base_return_int::s_new($value); default: diff --git a/common/theme/classes/theme_html.php b/common/theme/classes/theme_html.php index ef327d5..21f1d7f 100644 --- a/common/theme/classes/theme_html.php +++ b/common/theme/classes/theme_html.php @@ -41,7 +41,7 @@ class c_theme_html extends c_base_return { $this->html = NULL; $this->markup = NULL; $this->http = NULL; - $this->max_recursion_depth = self::DEFAULT_MAX_RECURSION_DEPTH; + $this->max_recursion_depth = static::DEFAULT_MAX_RECURSION_DEPTH; } /** @@ -299,7 +299,7 @@ class c_theme_html extends c_base_return { */ public function get_max_recursion_depth() { if (!is_int($this->max_recursion_depth)) { - $this->max_recursion_depth = self::DEFAULT_MAX_RECURSION_DEPTH; + $this->max_recursion_depth = static::DEFAULT_MAX_RECURSION_DEPTH; } return c_base_return_int::s_new($this->max_recursion_depth); diff --git a/common/theme/classes/theme_markup.php b/common/theme/classes/theme_markup.php index 5c391a0..1d7d26d 100644 --- a/common/theme/classes/theme_markup.php +++ b/common/theme/classes/theme_markup.php @@ -120,7 +120,7 @@ class c_theme_tag { $this->tags = array(); $this->tags_length = NULL; - $this->type = self::TYPE_NONE; + $this->type = static::TYPE_NONE; } /** @@ -183,24 +183,24 @@ class c_theme_tag { * FALSE with error bit set is returned on error. */ public function set_type($type) { - if (!is_int($type) || $type < self::TYPE_NONE) { + if (!is_int($type) || $type < static::TYPE_NONE) { return c_base_return_error::s_false(); } if ($this->type === $type) { return new c_base_return_true(); } - elseif ($type === self::TYPE_NONE) { + elseif ($type === static::TYPE_NONE) { $new_attributes = array(); } - elseif ($type === self::TYPE_TITLE) { + elseif ($type === static::TYPE_TITLE) { $new_attributes = array(); if (array_key_exists('id', $this->attributes)) { $new_attributes['id'] = $this->attributes['id']; } } - elseif ($type === self::TYPE_HEADING) { + elseif ($type === static::TYPE_HEADING) { $new_attributes = array(); if (array_key_exists('id', $this->attributes)) { @@ -215,7 +215,7 @@ class c_theme_tag { $new_attributes['name'] = $this->attributes['name']; } } - elseif ($type === self::TYPE_FILES) { + elseif ($type === static::TYPE_FILES) { $new_attributes = array(); if (array_key_exists('id', $this->attributes)) { @@ -226,14 +226,14 @@ class c_theme_tag { $new_attributes['type'] = $this->attributes['type']; } } - elseif ($type === self::TYPE_CONTEXT) { + elseif ($type === static::TYPE_CONTEXT) { $new_attributes = array(); if (array_key_exists('id', $this->attributes)) { $new_attributes['id'] = $this->attributes['id']; } } - elseif ($type === self::TYPE_PRESENTATION) { + elseif ($type === static::TYPE_PRESENTATION) { $new_attributes = array(); if (array_key_exists('id', $this->attributes)) { @@ -260,7 +260,7 @@ class c_theme_tag { $new_attributes['file'] = $this->attributes['file']; } } - elseif ($type === self::TYPE_CONTENT) { + elseif ($type === static::TYPE_CONTENT) { $new_attributes = array(); if (array_key_exists('id', $this->attributes)) { @@ -837,12 +837,12 @@ class c_theme_tag { $markup .= 's'; } - if ($this->type === self::TYPE_TITLE) { + if ($this->type === static::TYPE_TITLE) { if (isset($this->attributes['id'])) { $markup .= ' id="' . $this->attributes['id'] . '"'; } } - elseif ($this->type === self::TYPE_HEADING) { + elseif ($this->type === static::TYPE_HEADING) { if (isset($this->attributes['id'])) { $markup .= ' id="' . $this->attributes['id'] . '"'; } @@ -855,7 +855,7 @@ class c_theme_tag { $markup .= ' name="' . $this->attributes['name'] . '"'; } } - elseif ($this->type === self::TYPE_FILES) { + elseif ($this->type === static::TYPE_FILES) { if (isset($this->attributes['id'])) { $markup .= ' id="' . $this->attributes['id'] . '"'; } @@ -864,12 +864,12 @@ class c_theme_tag { $markup .= ' type="' . $this->attributes['type'] . '"'; } } - elseif ($this->type === self::TYPE_CONTEXT) { + elseif ($this->type === static::TYPE_CONTEXT) { if (isset($this->attributes['id'])) { $markup .= ' id="' . $this->attributes['id'] . '"'; } } - elseif ($this->type === self::TYPE_PRESENTATION) { + elseif ($this->type === static::TYPE_PRESENTATION) { if (isset($this->attributes['id'])) { $markup .= ' id="' . $this->attributes['id'] . '"'; } @@ -894,7 +894,7 @@ class c_theme_tag { $markup .= ' file="' . $this->attributes['file'] . '"'; } } - elseif ($this->type === self::TYPE_CONTENT) { + elseif ($this->type === static::TYPE_CONTENT) { if (isset($this->attributes['id'])) { $markup .= ' id="' . $this->attributes['id'] . '"'; } @@ -992,11 +992,11 @@ class c_theme_tag { // clear the contents of this class. $this->__construct(); - if ($this->type === self::TYPE_TAG) { + if ($this->type === static::TYPE_TAG) { // @todo: does this need to be sanitized, or would that result in double-sanitization? $this->text = $node->textContent; } - elseif ($this->type === self::TYPE_TAGS && $node->hasChildNodes()) { + elseif ($this->type === static::TYPE_TAGS && $node->hasChildNodes()) { foreach ($node->childNodes as $child_node) { if (!($child_node instanceof DOMNode)) { continue; @@ -1252,7 +1252,7 @@ class c_theme_tag { * NULL is returned for unknown tag type. */ private function p_allowed_attribute($attribute_name) { - if ($this->type === self::TYPE_TITLE) { + if ($this->type === static::TYPE_TITLE) { switch ($attribute_name) { case 'id': return TRUE; @@ -1260,7 +1260,7 @@ class c_theme_tag { return FALSE; } } - elseif ($this->type === self::TYPE_HEADING) { + elseif ($this->type === static::TYPE_HEADING) { switch ($attribute_name) { case 'id': case 'type': @@ -1270,7 +1270,7 @@ class c_theme_tag { return FALSE; } } - elseif ($this->type === self::TYPE_FILES) { + elseif ($this->type === static::TYPE_FILES) { switch ($attribute_name) { case 'id': case 'type': @@ -1279,7 +1279,7 @@ class c_theme_tag { return FALSE; } } - elseif ($this->type === self::TYPE_CONTEXT) { + elseif ($this->type === static::TYPE_CONTEXT) { switch ($attribute_name) { case 'id': return TRUE; @@ -1287,7 +1287,7 @@ class c_theme_tag { return FALSE; } } - elseif ($this->type === self::TYPE_PRESENTATION) { + elseif ($this->type === static::TYPE_PRESENTATION) { switch ($attribute_name) { case 'id': case 'class': @@ -1300,7 +1300,7 @@ class c_theme_tag { return FALSE; } } - elseif ($this->type === self::TYPE_CONTENT) { + elseif ($this->type === static::TYPE_CONTENT) { switch ($attribute_name) { case 'id': case 'context': @@ -1346,8 +1346,8 @@ class c_theme_tag { unset($tags); unset($total); - if ($this->type === self::TYPE_TAG) { - $this->type = self::TYPE_TAGS; + if ($this->type === static::TYPE_TAG) { + $this->type = static::TYPE_TAGS; } } @@ -1363,13 +1363,13 @@ class c_theme_tag { if ($this->tags_length > 0) { $this->text = NULL; - if ($this->type === self::TYPE_TAG) { - $this->type = self::TYPE_TAGS; + if ($this->type === static::TYPE_TAG) { + $this->type = static::TYPE_TAGS; } } elseif (!is_null($this->text)) { - if ($this->type !== self::TYPE_TAG) { - $this->type = self::TYPE_TAG; + if ($this->type !== static::TYPE_TAG) { + $this->type = static::TYPE_TAG; } } @@ -1421,12 +1421,12 @@ class c_theme_tag { } } - if ($this->type === self::TYPE_TITLE) { + if ($this->type === static::TYPE_TITLE) { if (isset($this->attributes['id'])) { $element->setAttribute('id', $this->attributes['id']); } } - elseif ($this->type === self::TYPE_HEADING) { + elseif ($this->type === static::TYPE_HEADING) { if (isset($this->attributes['id'])) { $element->setAttribute('id', $this->attributes['id']); } @@ -1439,7 +1439,7 @@ class c_theme_tag { $element->setAttribute('name', $this->attributes['name']); } } - elseif ($this->type === self::TYPE_FILES) { + elseif ($this->type === static::TYPE_FILES) { if (isset($this->attributes['id'])) { $element->setAttribute('id', $this->attributes['id']); } @@ -1448,12 +1448,12 @@ class c_theme_tag { $element->setAttribute('type', $this->attributes['type']); } } - elseif ($this->type === self::TYPE_CONTEXT) { + elseif ($this->type === static::TYPE_CONTEXT) { if (isset($this->attributes['id'])) { $element->setAttribute('id', $this->attributes['id']); } } - elseif ($this->type === self::TYPE_PRESENTATION) { + elseif ($this->type === static::TYPE_PRESENTATION) { if (isset($this->attributes['id'])) { $element->setAttribute('id', $this->attributes['id']); } @@ -1478,7 +1478,7 @@ class c_theme_tag { $element->setAttribute('file', $this->attributes['file']); } } - elseif ($this->type === self::TYPE_CONTENT) { + elseif ($this->type === static::TYPE_CONTENT) { if (isset($this->attributes['id'])) { $element->setAttribute('id', $this->attributes['id']); } diff --git a/documentation/class_self_references.txt b/documentation/class_self_references.txt new file mode 100644 index 0000000..08e7f74 --- /dev/null +++ b/documentation/class_self_references.txt @@ -0,0 +1,85 @@ +This project is intended to be both extended and directly modified. +The code is intended to be written this way so that classfull extensions can be used. +However, when it comes to PHP there are some additional considerations that must be made. + +PHP Class Constants and Extending Classes: + - Class Constants are static variables specific to a given class and also cannot be changed. + - When a class constant is changed by an extending class, references to 'self::' but the extended class are not bound to the extension but instead to the original class constant. + - Also, when references to 'self::' are used by the extending class for an extended constant are made, the extension class constant is instead used. + - To both avoid confusion and to ensure that the extended class constants are used, 'static::' may and should be used in place of 'self::'. + +Do not do this for static class variables or static class functions. + +static:: may not be used in compile-time cases such as with __construct() and function parameters, instead use self::. + +When creating a class that is final, just use self::. + +If there are specific situations where the extended class should not be referenced, then the use of self:: instead of static:: can and should be used. +This works because PHP uses "Late Static Binding" for static:: but not for self::. + +For example, consider classes A, B, and C, such that B and C are extensions of A: +print_self(); + $a->print_static(); + print("\n"); + + print("Class B:\n"); + $b->print_self(); + $b->print_static(); + print("\n"); + + print("Class C:\n"); + $c->print_self(); + $c->print_static(); + print("\n"); +?> + +The above has the following output: + Class A: + Class Name = A + Class Name = A + + Class B: + Class Name = A + Class Name = B + + Class C: + Class Name = C + Class Name = C + +For the purposes of this project and consistency, the expected behavior is case where class B is printing a class name of 'B' and not 'A'. + +see: http://php.net/manual/en/language.oop5.late-static-bindings.php -- 1.8.3.1