From: Kevin Day Date: Tue, 2 May 2017 05:08:52 +0000 (-0500) Subject: Progress: move code from reservation to standard and other fixes X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=be8a2bd98ad3ffb2961df49705d0ee724c8b3c7e;p=koopa Progress: move code from reservation to standard and other fixes I've now determined what would be a good basis for using a 'standard' structure. Standard would be a minimal website used by most of my projects here, but it is not part of the base so that other developers do not have to use it at all. This allows for more development flexibility while still providing a common default. Most of the reservation example program code was moved into standard, including sql code. --- diff --git a/common/base/classes/base_access.php b/common/base/classes/base_access.php index 5812b23..ef47c10 100644 --- a/common/base/classes/base_access.php +++ b/common/base/classes/base_access.php @@ -10,366 +10,3 @@ require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_session.php'); require_once('common/base/classes/base_ldap.php'); -/** - * A class for managing roles. - * - * Roles defined here are general top-level roles used for separating database activity. - * The intentions here is to keep the roles as simple and as few as possible while allowing considerable flexibility. - * This should cut down on the complexity of the database access control. - * - * Additional granularity may be supplied via PHP access checks or by extending this class. - * - * Roles: - * - None: no access to anything. - * - Public: access to only public information (users who are not logged in have this, such as anonymous). - * - System: account is a machine and should not be a human (such as with cron jobs). - * - User: account is a user and that user is logged in. - * - Requester: account is for requesting something, generally via some sort of form. - * - Drafter: account is for making templates, drafts, ideas, etc.. (this is a lesser form of "editer"). - * - Editer: account is for editors who add/manage/create content. - * - Reviewer: account is for users who review something (such as a user who approves content for publishing). - * - Insurer: account is for users who deal with insurance related information. - * - Financer: account is for users who deal with financial related information. - * - Publisher: account is for users who perform publishing (marking content available and complete). - * - Auditor: account is for users who perform auditing. This account has read access to almost all data on the system. - * - Manager: account is for users who manager the entire system. This is a non-technical administration account. - * - Administer: account is for users who have full administrative access to the system. This is a technical administration account and supercedes Manager. - */ -class c_base_roles extends c_base_return { - const NONE = 0; - const PUBLIC = 1; - const SYSTEM = 2; - const USER = 3; - const REQUESTER = 4; - const DRAFTER = 5; - const EDITOR = 6; - const REVIEWER = 7; - const INSURER = 8; - const FINANCER = 9; - const PUBLISHER = 10; - const AUDITOR = 11; - const MANAGER = 12; - const ADMINISTER = 13; - - private $public; - private $system; - private $user; - private $requester; - private $drafter; - private $editer; - private $reviewer; - private $insurer; - private $financer; - private $publisher; - private $auditor; - private $manager; - private $administer; - - /** - * Class constructor. - */ - public function __construct() { - parent::__construct(); - - $this->public = TRUE; - $this->system = FALSE; - $this->user = FALSE; - $this->requester = FALSE; - $this->drafter = FALSE; - $this->editer = FALSE; - $this->reviewer = FALSE; - $this->financer = FALSE; - $this->insurer = FALSE; - $this->publisher = FALSE; - $this->auditor = FALSE; - $this->manager = FALSE; - $this->administer = FALSE; - } - - /** - * Class destructor. - */ - public function __destruct() { - unset($this->public); - unset($this->system); - unset($this->user); - unset($this->requester); - unset($this->drafter); - unset($this->editer); - unset($this->reviewer); - unset($this->financer); - unset($this->insurer); - unset($this->publisher); - unset($this->auditor); - unset($this->manager); - unset($this->administer); - - parent::__destruct(); - } - - /** - * @see: t_base_return_value::p_s_new() - */ - public static function s_new($value) { - return self::p_s_new($value, __CLASS__); - } - - /** - * @see: t_base_return_value::p_s_value() - */ - public static function s_value($return) { - return self::p_s_value($return, __CLASS__); - } - - /** - * @see: t_base_return_value_exact::p_s_value_exact() - */ - public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); - } - - /** - * Assign a role. - * - * When role is set to NONE, and value is TRUE, then all roles are set to FALSE. - * When role is set to NONE and value is FALSE, nothing happens. - * - * @param int $role - * The role id to assign. - * @param bool $value - * Set the role value to TRUE/FALSE. - * - * @return c_base_return_status - * TRUE on success, FALSE otherwise. - * FALSE with error bit set is returned on error. - */ - public function set_role($role, $value) { - if (!is_int($role)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'role', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_false($error); - } - - if (!is_bool($value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'value', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_false($error); - } - - if ($role === self::NONE) { - if ($value) { - $this->public = FALSE; - $this->system = FALSE; - $this->user = FALSE; - $this->requester = FALSE; - $this->drafter = FALSE; - $this->editer = FALSE; - $this->reviewer = FALSE; - $this->publisher = FALSE; - $this->auditor = FALSE; - $this->manager = FALSE; - $this->administer = FALSE; - } - } - elseif ($role === self::PUBLIC) { - $this->public = $value; - } - elseif ($role === self::SYSTEM) { - $this->system = $value; - } - elseif ($role === self::USER) { - $this->user = $value; - } - elseif ($role === self::REQUESTER) { - $this->requester = $value; - } - elseif ($role === self::DRAFTER) { - $this->drafter = $value; - } - elseif ($role === self::EDITOR) { - $this->editer = $value; - } - elseif ($role === self::REVIEWER) { - $this->reviewer = $value; - } - elseif ($role === self::FINANCER) { - $this->financer = $value; - } - elseif ($role === self::INSURER) { - $this->insurer = $value; - } - elseif ($role === self::PUBLISHER) { - $this->publisher = $value; - } - elseif ($role === self::AUDITOR) { - $this->auditor = $value; - } - elseif ($role === self::MANAGER) { - $this->manager = $value; - } - elseif ($role === self::ADMINISTER) { - $this->administer = $value; - } - else { - return new c_base_return_false(); - } - - return new c_base_return_true(); - } - - /** - * Get the current status of the specified role. - * - * When role is set to NONE, TRUE is returned when all values are set to FALSE. - * When role is set to NONE, FALSE is returned when any values are set to TRUE. - * - * @param int $role - * The role id to get the value of. - * - * @return c_base_return_status - * TRUE on enabled, FALSE on disabled. - * FALSE with error bit set is returned on error. - */ - public function get_role($role) { - if (!is_int($role)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'role', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_false($error); - } - - if ($role === self::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) { - if ($this->public) { - return new c_base_return_true(); - } - } - elseif ($role === self::SYSTEM) { - if ($this->system) { - return new c_base_return_true(); - } - } - elseif ($role === self::USER) { - if ($this->user) { - return new c_base_return_true(); - } - } - elseif ($role === self::REQUESTER) { - if ($this->requester) { - return new c_base_return_true(); - } - } - elseif ($role === self::DRAFTER) { - if ($this->drafter) { - return new c_base_return_true(); - } - } - elseif ($role === self::EDITOR) { - if ($this->editer) { - return new c_base_return_true(); - } - } - elseif ($role === self::REVIEWER) { - if ($this->reviewer) { - return new c_base_return_true(); - } - } - elseif ($role === self::FINANCER) { - if ($this->financer) { - return new c_base_return_true(); - } - } - elseif ($role === self::INSURER) { - if ($this->insurer) { - return new c_base_return_true(); - } - } - elseif ($role === self::PUBLISHER) { - if ($this->publisher) { - return new c_base_return_true(); - } - } - elseif ($role === self::AUDITOR) { - if ($this->auditor) { - return new c_base_return_true(); - } - } - elseif ($role === self::MANAGER) { - if ($this->manager) { - return new c_base_return_true(); - } - } - elseif ($role === self::ADMINISTER) { - if ($this->administer) { - return new c_base_return_true(); - } - } - - return new c_base_return_false(); - } - - /** - * Get an array of all currently assigned roles. - * - * @return c_base_return_array - * An array of roles are returned. - * An array with error bit set is returned on error. - */ - public function get_roles() { - $roles = array(); - - if ($this->public) { - $roles[self::PUBLIC] = self::PUBLIC; - } - - if ($this->system) { - $roles[self::SYSTEM] = self::SYSTEM; - } - - if ($this->user) { - $roles[self::USER] = self::USER; - } - - if ($this->requester) { - $roles[self::REQUESTER] = self::REQUESTER; - } - - if ($this->drafter) { - $roles[self::DRAFTER] = self::DRAFTER; - } - - if ($this->editer) { - $roles[self::EDITOR] = self::EDITOR; - } - - if ($this->reviewer) { - $roles[self::REVIEWER] = self::REVIEWER; - } - - if ($this->financer) { - $roles[self::FINANCER] = self::FINANCER; - } - - if ($this->insurer) { - $roles[self::INSURER] = self::INSURER; - } - - if ($this->publisher) { - $roles[self::PUBLISHER] = self::PUBLISHER; - } - - if ($this->auditor) { - $roles[self::AUDITOR] = self::AUDITOR; - } - - if ($this->manager) { - $roles[self::MANAGER] = self::MANAGER; - } - - if ($this->administer) { - $roles[self::ADMINISTER] = self::ADMINISTER; - } - - return c_base_return_array::s_new($roles); - } -} diff --git a/common/base/classes/base_charset.php b/common/base/classes/base_charset.php index 16d1f75..4053dd7 100644 --- a/common/base/classes/base_charset.php +++ b/common/base/classes/base_charset.php @@ -42,7 +42,7 @@ class c_base_charset { */ public static function s_is_valid($charset) { if (!is_int($charset)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'charset', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'charset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -65,7 +65,7 @@ class c_base_charset { */ public static function s_to_string($charset) { if (!is_int($charset)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'charset', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'charset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -112,7 +112,7 @@ class c_base_charset { return c_base_return_string::s_new('ISO-8859-16'); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '::' . __FUNCTION__), i_base_error_messages::FUNCTION_FAILURE)); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '::' . __FUNCTION__), i_base_error_messages::FUNCTION_FAILURE)); return c_base_return_error::s_false($error); } } diff --git a/common/base/classes/base_cml.php b/common/base/classes/base_cml.php index 81ed671..c3e9c7b 100644 --- a/common/base/classes/base_cml.php +++ b/common/base/classes/base_cml.php @@ -10,8 +10,3 @@ * * @see: https://www.w3.org/TR/html5/ */ - -// include required files. -require_once('common/base/classes/base_error.php'); -require_once('common/base/classes/base_return.php'); -require_once('common/base/classes/base_markup.php'); diff --git a/common/base/classes/base_cookie.php b/common/base/classes/base_cookie.php index c751e0b..2908898 100644 --- a/common/base/classes/base_cookie.php +++ b/common/base/classes/base_cookie.php @@ -3,8 +3,6 @@ * @file * Provides a class for managing cookies. */ - -// include required files. require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -35,17 +33,17 @@ class c_base_cookie extends c_base_return_array { const SAME_SITE_STRICT = 2; - private $name; - private $secure; - private $max_age; - private $expires; - private $path; - private $domain; - private $http_only; - private $first_only; - private $host_only; - private $same_site; - private $json_encode_depth; + protected $name; + protected $secure; + protected $max_age; + protected $expires; + protected $path; + protected $domain; + protected $http_only; + protected $first_only; + protected $host_only; + protected $same_site; + protected $json_encode_depth; /** @@ -120,12 +118,12 @@ class c_base_cookie extends c_base_return_array { */ public function set_name($name) { if (!is_string($name) || empty($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (mb_strlen($name) == 0 || preg_match('/^(\w|-)+$/iu', $name) != 1) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'name', ':expected_format' => '. Alphanumeric and dash characters only', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'name', ':{expected_format}' => '. Alphanumeric and dash characters only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } @@ -157,7 +155,7 @@ class c_base_cookie extends c_base_return_array { */ public function set_secure($secure) { if (!is_bool($secure)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'secure', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'secure', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -204,12 +202,12 @@ class c_base_cookie extends c_base_return_array { $expires = (int) $expires; if ($expires < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'expires', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'expires', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } else { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'expires', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'expires', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } @@ -260,12 +258,12 @@ class c_base_cookie extends c_base_return_array { $max_age = (int) $max_age; if ($max_age < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'max_age', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'max_age', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } else { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'max_age', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'max_age', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } @@ -303,7 +301,7 @@ class c_base_cookie extends c_base_return_array { */ public function set_path($path) { if (!is_string($path) || empty($path)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'path', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -311,7 +309,7 @@ class c_base_cookie extends c_base_return_array { $parsed = parse_url($path, PHP_URL_PATH); if ($parsed === FALSE) { unset($parsed); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'parse_url'), i_base_error_messages::OPERATION_FAILURE)); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'parse_url'), i_base_error_messages::OPERATION_FAILURE)); return c_base_return_error::s_false($error); } @@ -347,7 +345,7 @@ class c_base_cookie extends c_base_return_array { */ public function set_domain($domain) { if (!is_string($domain) || empty($domain)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'domain', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'domain', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -355,7 +353,7 @@ class c_base_cookie extends c_base_return_array { $parsed = parse_url('stub://' . $domain, PHP_URL_HOST); if ($parsed === FALSE) { unset($parsed); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'parse_url', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'parse_url', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -389,7 +387,7 @@ class c_base_cookie extends c_base_return_array { */ public function set_http_only($http_only) { if (!is_bool($http_only)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'http_only', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'http_only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -426,7 +424,7 @@ class c_base_cookie extends c_base_return_array { */ public function set_first_only($first_only) { if (!is_bool($first_only)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'first_only', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'first_only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -464,7 +462,7 @@ class c_base_cookie extends c_base_return_array { */ public function set_host_only($host_only) { if (!is_bool($host_only)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'host_only', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'host_only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -502,7 +500,7 @@ class c_base_cookie extends c_base_return_array { */ public function set_same_site($same_site) { if (!is_int($same_site)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'same_site', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'same_site', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -513,7 +511,7 @@ class c_base_cookie extends c_base_return_array { $this->same_site = $same_site; break; default: - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'same_site', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'same_site', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -551,12 +549,12 @@ class c_base_cookie extends c_base_return_array { */ public function get_cookie($checksum = TRUE) { if (!is_bool($checksum)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'checksum', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (is_null($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->value', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -584,7 +582,7 @@ class c_base_cookie extends c_base_return_array { */ public function set_json_encode_depth($json_encode_depth) { if (!is_int($json_encode_depth) || $json_encode_depth < 1) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'json_encode_depth', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'json_encode_depth', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -627,22 +625,22 @@ class c_base_cookie extends c_base_return_array { */ public function do_push($checksum = TRUE, $force = FALSE) { if (!is_bool($checksum)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'checksum', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($force)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'force', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'force', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (is_null($this->name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (is_null($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->value', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -684,7 +682,7 @@ class c_base_cookie extends c_base_return_array { unset($json); if ($data === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'json_decode', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'json_decode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -709,7 +707,7 @@ class c_base_cookie extends c_base_return_array { */ public function validate() { if (!is_array($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->data')), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->data')), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -773,7 +771,7 @@ class c_base_cookie extends c_base_return_array { } unset($checksum); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->p_build_checksum', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_build_checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -871,7 +869,7 @@ class c_base_cookie extends c_base_return_array { if (is_null($this->value['checksum'])) { unset($this->value['checksum']); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->p_build_checksum', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_build_checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } } @@ -879,7 +877,7 @@ class c_base_cookie extends c_base_return_array { $json = json_encode($this->value, 0, $this->json_encode_depth); if ($json === FALSE) { unset($json); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'json_encode', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'json_encode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_database.php b/common/base/classes/base_database.php index 3caf269..6fb7c0a 100644 --- a/common/base/classes/base_database.php +++ b/common/base/classes/base_database.php @@ -29,8 +29,6 @@ * * @see: http://php.net/manual/en/features.persistent-connections.php */ - -// include required files. require_once('common/base/classes/base_warning.php'); require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -40,19 +38,19 @@ require_once('common/base/classes/base_return.php'); * * @see: http://php.net/manual/en/function.pg-pconnect.php */ -class c_base_connection_string extends c_base_return_string { +class c_base_database_connection_string extends c_base_return_string { const DATA_CLEAR_TEXT_LENGTH = 4096; - private $host; - private $host_addr; - private $port; - private $database; - private $user; - private $password; - private $connect_timeout; - private $options; - private $ssl_mode; - private $service; + protected $host; + protected $host_addr; + protected $port; + protected $database; + protected $user; + protected $password; + protected $connect_timeout; + protected $options; + protected $ssl_mode; + protected $service; /** * Class destructor. @@ -125,7 +123,7 @@ class c_base_connection_string extends c_base_return_string { */ public function set_host($host) { if (!is_string($host)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'host', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -160,7 +158,7 @@ class c_base_connection_string extends c_base_return_string { */ public function set_host_addr($host_addr) { if (!is_string($host_addr)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'host_addr', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'host_addr', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -198,12 +196,12 @@ class c_base_connection_string extends c_base_return_string { if (is_string($port) && is_numeric($port)) { $port = (int) $port; if ($port < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'port', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'port', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } else { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'port', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'port', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } @@ -239,7 +237,7 @@ class c_base_connection_string extends c_base_return_string { */ public function set_database($database) { if (!is_string($database)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'database', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -274,7 +272,7 @@ class c_base_connection_string extends c_base_return_string { */ public function set_user($user) { if (!is_string($user)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'user', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'user', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -309,7 +307,7 @@ class c_base_connection_string extends c_base_return_string { */ public function set_password($password) { if (!is_null($password) && !is_string($password)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'password', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'password', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -352,12 +350,12 @@ class c_base_connection_string extends c_base_return_string { if (is_string($connect_timeout) && is_numeric($connect_timeout)) { $connect_timeout = (int) $connect_timeout; if ($connect_timeout < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'connect_timeout', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'connect_timeout', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } else { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'connect_timeout', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'connect_timeout', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } @@ -393,7 +391,7 @@ class c_base_connection_string extends c_base_return_string { */ public function set_options($options) { if (!is_string($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'options', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -433,7 +431,7 @@ class c_base_connection_string extends c_base_return_string { */ public function set_ssl_mode($ssl_mode) { if (!is_string($ssl_mode)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'ssl_mode', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'ssl_mode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -468,7 +466,7 @@ class c_base_connection_string extends c_base_return_string { */ public function set_service($service) { if (!is_string($service)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'service', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'service', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -612,7 +610,7 @@ class c_base_database extends c_base_return { $this->do_disconnect(); } - if (is_object($this->connection_string) && $this->connection_string instanceof c_base_connection_string) { + if (is_object($this->connection_string) && $this->connection_string instanceof c_base_database_connection_string) { $this->connection_string->clear(); } @@ -659,7 +657,7 @@ class c_base_database extends c_base_return { */ public function set_session($session) { if (!is_object($session) || !($session instanceof c_base_session)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'session', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'session', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -685,7 +683,7 @@ class c_base_database extends c_base_return { /** * Assign a connection string to the database. * - * @param c_base_connection_string $connection_string + * @param c_base_database_connection_string $connection_string * An already processed and configured connection string object. * * @return c_base_return_status @@ -693,12 +691,12 @@ class c_base_database extends c_base_return { * FALSE with the error bit set is returned on error. */ public function set_connection_string($connection_string) { - if (!is_object($connection_string) || !($connection_string instanceof c_base_connection_string)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'connection_string', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + if (!is_object($connection_string) || !($connection_string instanceof c_base_database_connection_string)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'connection_string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - $this->connection_string = $connection_string; + $this->connection_string = clone($connection_string); $this->connection_string->build(); return new c_base_return_true(); @@ -707,16 +705,16 @@ class c_base_database extends c_base_return { /** * Returns the connection string. * - * @return c_base_connection_string + * @return c_base_database_connection_string * A connection string object on success. * The error bit set is on error. */ public function get_connection_string() { - if (!is_object($this->connection_string) || !($this->connection_string instanceof c_base_connection_string)) { - $this->connection_string = new c_base_connection_string(); + if (!is_object($this->connection_string) || !($this->connection_string instanceof c_base_database_connection_string)) { + $this->connection_string = new c_base_database_connection_string(); } - return $this->connection_string; + return clone($this->connection_string); } /** @@ -741,7 +739,7 @@ class c_base_database extends c_base_return { */ public function set_persistent($persistent) { if (!is_bool($persistent)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'persistent', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'persistent', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -781,7 +779,7 @@ class c_base_database extends c_base_return { */ public function set_asynchronous($asynchronous) { if (!is_bool($asynchronous)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'asynchronous', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'asynchronous', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -826,17 +824,17 @@ class c_base_database extends c_base_return { */ public function do_connect($force = FALSE) { if (!is_bool($force)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'force', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'force', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (is_null($this->connection_string)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'connection_string', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'connection_string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (is_resource($this->database)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'database', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_UNECESSARY); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_UNECESSARY); return c_base_return_error::s_true($error); } @@ -883,7 +881,7 @@ class c_base_database extends c_base_return { } unset($warnings); - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $this->connection_string->get_database()->get_value_exact(), ':failure_reasons' => $failure_reasons, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_CONNECTION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $this->connection_string->get_database()->get_value_exact(), ':{failure_reasons}' => $failure_reasons, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_CONNECTION_FAILURE); unset($failure_reasons); return c_base_return_error::s_false($error); @@ -915,8 +913,8 @@ class c_base_database extends c_base_return { */ public function do_disconnect() { if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -926,7 +924,7 @@ class c_base_database extends c_base_return { return new c_base_return_true(); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_close', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_close', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -941,8 +939,8 @@ class c_base_database extends c_base_return { */ public function do_flush() { if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -953,7 +951,7 @@ class c_base_database extends c_base_return { } if ($result === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_flush', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_flush', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -988,7 +986,7 @@ class c_base_database extends c_base_return { */ public function is_busy() { if (!$this->asynchronous) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->asynchronous', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->asynchronous', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -1013,14 +1011,14 @@ class c_base_database extends c_base_return { */ public function get_parameter_status($name) { if (!is_string($name) || empty($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $result = pg_parameter_status($this->database, $name); if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_parameter_status', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_parameter_status', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1041,7 +1039,7 @@ class c_base_database extends c_base_return { */ public function do_poll() { if (!$this->asynchronous) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->database', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -1059,8 +1057,8 @@ class c_base_database extends c_base_return { */ public function do_reset() { if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1069,7 +1067,7 @@ class c_base_database extends c_base_return { return new c_base_return_true(); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_connection_reset', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_connection_reset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1101,8 +1099,8 @@ class c_base_database extends c_base_return { */ public function do_ping() { if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1115,7 +1113,7 @@ class c_base_database extends c_base_return { return new c_base_return_false(); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::FUNCTION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::FUNCTION_FAILURE); return c_base_return_error::s_false($error); } @@ -1136,13 +1134,13 @@ class c_base_database extends c_base_return { */ public function escape_literal($literal) { if (!is_string($literal)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'literal', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'literal', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1167,13 +1165,13 @@ class c_base_database extends c_base_return { */ public function escape_bytea($bytea) { if (!is_string($bytea)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'bytea', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'bytea', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1198,13 +1196,13 @@ class c_base_database extends c_base_return { */ public function escape_identifier($identifier) { if (!is_string($identifier)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'identifier', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'identifier', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1229,13 +1227,13 @@ class c_base_database extends c_base_return { */ public function unescape_bytea($bytea) { if (!is_string($bytea)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'bytea', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'bytea', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1257,13 +1255,13 @@ class c_base_database extends c_base_return { */ public function set_client_encoding($encoding) { if (!is_string($encoding)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'encoding', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1274,7 +1272,7 @@ class c_base_database extends c_base_return { return new c_base_return_true(); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_set_client_encoding', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_set_client_encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1289,8 +1287,8 @@ class c_base_database extends c_base_return { */ public function get_client_encoding() { if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1299,7 +1297,7 @@ class c_base_database extends c_base_return { if ($encoding === FALSE) { unset($encoding); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_client_encoding', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_client_encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1322,8 +1320,8 @@ class c_base_database extends c_base_return { */ public function consume_input() { if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1332,7 +1330,7 @@ class c_base_database extends c_base_return { return new c_base_return_true(); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_consume_input', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_consume_input', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1356,23 +1354,23 @@ class c_base_database extends c_base_return { */ public function do_convert($table, $array, $options = 0) { if (!is_string($table) || empty($table)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'table', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($array)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'array', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'array', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'options', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1380,7 +1378,7 @@ class c_base_database extends c_base_return { $converted = pg_connect_status($this->database, $table, $array, $options); if ($converted === FALSE) { unset($converted); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_connect_status', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_connect_status', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1414,18 +1412,18 @@ class c_base_database extends c_base_return { */ public function do_execute($name, $parameters = array()) { if (!is_string($name) || empty($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($parameters)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'parameters', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameters', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1442,7 +1440,7 @@ class c_base_database extends c_base_return { } unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => ($this->asynchronous ? 'pg_send_execute' : 'pg_execute'), ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => ($this->asynchronous ? 'pg_send_execute' : 'pg_execute'), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1460,8 +1458,9 @@ class c_base_database extends c_base_return { * Any bytea field must not be used as a parameter. * Instead, use pg_escape_bytea() or a large object function. * - * @return c_base_database_result|c_base_return_status - * Query resource is returned on success, FALSE otherwise. + * @return c_base_database_result + * Query resource is returned on success. + * Query resource with the error bit set is returned on error. * * @see: self::execute() * @see: self::prepare() @@ -1476,20 +1475,34 @@ class c_base_database extends c_base_return { */ public function do_query($query, $parameters = array()) { if (!is_string($query) || empty($query)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'query', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_false($error); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + + $result = new c_base_database_result(); + $result->set_error($error); + unset($error); + + return $result; } if (!is_array($parameters)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'parameters', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_false($error); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameters', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + + $result = new c_base_database_result(); + $result->set_error($error); + unset($error); + + return $result; } if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); - unset($database); - return c_base_return_error::s_false($error); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + + $result = new c_base_database_result(); + $result->set_error($error); + unset($error); + + return $result; } if ($this->asynchronous) { @@ -1516,22 +1529,26 @@ class c_base_database extends c_base_return { if ($this->asynchronous) { if (empty($parameters)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_send_query', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_send_query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); } else { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_send_query_params', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_send_query_params', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); } } else { if (empty($parameters)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_query', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); } else { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_query_params', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_query_params', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); } } - return c_base_return_error::s_false($error); + $result = new c_base_database_result(); + $result->set_error($error); + unset($error); + + return $result; } /** @@ -1544,8 +1561,9 @@ class c_base_database extends c_base_return { * @param string $query * The query statement to execute. * - * @return c_base_database_result|c_base_return_status - * Query resource is returned on success, FALSE otherwise. + * @return c_base_database_result + * Query resource is returned on success. + * Query resource with error bit set is returned on error. * * @see: self::execute() * @see: self::query() @@ -1556,20 +1574,35 @@ class c_base_database extends c_base_return { */ public function do_prepare($name, $query) { if (!is_string($name) || empty($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_false($error); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + + $result = new c_base_database_result(); + $result->set_error($error); + unset($error); + + return $result; } if (!is_string($query) || empty($query)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'query', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_false($error); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + + $result = new c_base_database_result(); + $result->set_error($error); + unset($error); + + return $result; } if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); - return c_base_return_error::s_false($error); + + $result = new c_base_database_result(); + $result->set_error($error); + unset($error); + + return $result; } if ($this->asynchronous) { @@ -1584,8 +1617,13 @@ class c_base_database extends c_base_return { } unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => ($this->asynchronous ? 'pg_send_prepare' :'pg_prepare'), ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); - return c_base_return_error::s_false($error); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => ($this->asynchronous ? 'pg_send_prepare' :'pg_prepare'), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + + $result = new c_base_database_result(); + $result->set_error($error); + unset($error); + + return $result; } /** @@ -1593,21 +1631,25 @@ class c_base_database extends c_base_return { * * This is only useful when a query is asynchronous. * - * @return c_base_database_result|c_base_return_status + * @return c_base_database_result * A database result is returned on success. - * FALSE with the error bit set is returned on error. - * When asynchronous is not enabled, FALSE is returned without an error flag set. + * A database result with the error bit set is returned on error. */ public function get_result() { if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); - return c_base_return_error::s_false($error); + + $result = new c_base_database_result(); + $result->set_error($error); + unset($error); + + return $result; } if (!$this->asynchronous) { - return new c_base_return_false(); + return new c_base_database_result(); } $result = pg_get_result($this->database); @@ -1616,8 +1658,13 @@ class c_base_database extends c_base_return { } unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_get_result', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); - return c_base_return_error::s_false($error); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_get_result', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + + $result = new c_base_database_result(); + $result->set_error($error); + unset($error); + + return $result; } /** @@ -1653,8 +1700,8 @@ class c_base_database extends c_base_return { */ public function do_cancel() { if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1667,7 +1714,7 @@ class c_base_database extends c_base_return { return new c_base_return_true(); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_cancel_query', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_cancel_query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1714,23 +1761,23 @@ class c_base_database extends c_base_return { */ public function do_insert($table, $values, $options = NULL) { if (!is_string($table) || empty($table)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'table', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($values)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'values', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'values', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($options) && !is_int($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'options', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1755,7 +1802,7 @@ class c_base_database extends c_base_return { } unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_insert', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_insert', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1798,28 +1845,28 @@ class c_base_database extends c_base_return { */ function do_update($table, $values, $conditions, $options = NULL) { if (!is_string($table) || empty($table)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'table', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($values)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'values', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'values', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($conditions)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'conditions', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'conditions', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($options) && !is_int($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'options', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1844,7 +1891,7 @@ class c_base_database extends c_base_return { } unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_update', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_update', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1888,23 +1935,23 @@ class c_base_database extends c_base_return { */ function do_select($table, $conditions, $options = NULL) { if (!is_string($table) || empty($table)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'table', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($conditions)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'conditions', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'conditions', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($options) && !is_int($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'options', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -1932,7 +1979,7 @@ class c_base_database extends c_base_return { } unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_select', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_select', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1972,23 +2019,23 @@ class c_base_database extends c_base_return { */ function do_delete($table, $conditions, $options = NULL) { if (!is_string($table) || empty($table)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'table', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($conditions)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'conditions', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'conditions', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($options) && !is_int($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'options', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -2013,7 +2060,7 @@ class c_base_database extends c_base_return { } unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_select', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_select', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2035,18 +2082,18 @@ class c_base_database extends c_base_return { */ public function get_meta_data($table, $extended = FALSE) { if (!is_string($table) || empty($table)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'table', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($extended)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'extended', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'extended', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -2055,7 +2102,7 @@ class c_base_database extends c_base_return { if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_meta_data', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_meta_data', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2078,14 +2125,14 @@ class c_base_database extends c_base_return { */ public function set_error_verbosity($verbosity) { if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } if (!is_int($verbosity)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'verbosity', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'verbosity', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2103,8 +2150,8 @@ class c_base_database extends c_base_return { */ public function get_last_error() { if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -2113,7 +2160,7 @@ class c_base_database extends c_base_return { if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_last_error', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_last_error', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2131,8 +2178,8 @@ class c_base_database extends c_base_return { */ public function get_last_notice() { if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -2141,7 +2188,7 @@ class c_base_database extends c_base_return { if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_last_notice', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_last_notice', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2166,8 +2213,8 @@ class c_base_database extends c_base_return { */ public function get_transaction_status() { if (!is_resource($this->database)) { - $database = ($this->connection_string instanceof c_base_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; - $error = c_base_error::s_log(NULL, array('arguments' => array(':database_name' => $database, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); + $database = ($this->connection_string instanceof c_base_database_connection_string) ? $this->connection_string->get_database()->get_value_exact() : ''; + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_name}' => $database, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_CONNECTION); unset($database); return c_base_return_error::s_false($error); } @@ -2176,7 +2223,7 @@ class c_base_database extends c_base_return { if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_transaction_status', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_transaction_status', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2276,18 +2323,18 @@ class c_base_database_result extends c_base_return_resource { */ public function fetch_all_columns($column) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_int($column) || $column < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'column', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $result = pg_fetch_all_columns($this->value, $column); if ($result === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_fetch_all_columns', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_fetch_all_columns', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2304,13 +2351,13 @@ class c_base_database_result extends c_base_return_resource { */ public function fetch_all() { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } $result = pg_fetch_all($this->value); if ($result === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_fetch_all', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_fetch_all', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2336,23 +2383,23 @@ class c_base_database_result extends c_base_return_resource { */ public function fetch_array($row = NULL, $type = PGSQL_ASSOC) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_null($row) && (!is_int($row) || $row < 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'row', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $result = pg_fetch_array($this->value, $row, $type); if ($result === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_fetch_array', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_fetch_array', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2381,22 +2428,22 @@ class c_base_database_result extends c_base_return_resource { */ public function fetch_object($row = NULL, $class = NULL, $parameters = NULL) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_null($row) && (!is_int($row) || $row < 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'row', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($class) && !is_string($class)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'class', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'class', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($parameters) && !is_array($parameters)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'parameters', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameters', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2408,7 +2455,7 @@ class c_base_database_result extends c_base_return_resource { } if ($result === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_fetch_object', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_fetch_object', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2431,30 +2478,30 @@ class c_base_database_result extends c_base_return_resource { */ public function fetch_result($row, $column) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_null($row) && (!is_int($row) || $row < 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'row', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($column) && !is_string($column) || is_int($column) && $column < 0 || is_string($column) && empty($column)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'column', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - if (!is_null($row)) { - $result = pg_fetch_result($this->value, $row, $column); + if (is_null($row)) { + $result = pg_fetch_result($this->value, $column); } else { - $result = pg_fetch_result($this->value, $column); + $result = pg_fetch_result($this->value, $row, $column); } if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_fetch_result', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_fetch_result', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2476,18 +2523,24 @@ class c_base_database_result extends c_base_return_resource { */ public function fetch_row($row = NULL) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_null($row) && (!is_int($row) || $row < 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'row', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - $result = pg_fetch_row($this->value, $row); + if (is_null($row)) { + $result = pg_fetch_row($this->value); + } + else { + $result = pg_fetch_row($this->value, $row); + } + if ($result === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_fetch_row', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_fetch_row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2521,12 +2574,12 @@ class c_base_database_result extends c_base_return_resource { */ public function error($code = NULL) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_null($code) && !is_int($code)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'code', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'code', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2556,7 +2609,7 @@ class c_base_database_result extends c_base_return_resource { */ public function affected_rows() { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } @@ -2574,13 +2627,13 @@ class c_base_database_result extends c_base_return_resource { */ public function number_of_rows() { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } $result = pg_num_rows($this->value); if ($result < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_num_rows', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_num_rows', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2598,13 +2651,13 @@ class c_base_database_result extends c_base_return_resource { */ public function number_of_columns() { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } $result = pg_num_fields($this->value); if ($result < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_num_fields', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_num_fields', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2625,19 +2678,19 @@ class c_base_database_result extends c_base_return_resource { */ public function field_name($number) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_int($number) || $number < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'number', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'number', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $result = pg_field_name($this->value, $number); if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_field_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_field_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2658,12 +2711,12 @@ class c_base_database_result extends c_base_return_resource { */ public function field_number($name) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_string($name) || mb_strlen($name) == 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2671,7 +2724,7 @@ class c_base_database_result extends c_base_return_resource { $result = pg_field_number($this->value, $name); if ($result < 0) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_field_number', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_field_number', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2700,17 +2753,17 @@ class c_base_database_result extends c_base_return_resource { */ public function field_length($row, $name_or_number) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_null($row) && (!is_int($row) || $row < 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'row', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'row', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($name_or_number) && !(is_string($name_or_number) && mb_strlen($name) > 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name_or_number', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name_or_number', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2723,7 +2776,7 @@ class c_base_database_result extends c_base_return_resource { if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_field_prtlen', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_field_prtlen', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2746,19 +2799,19 @@ class c_base_database_result extends c_base_return_resource { */ public function field_bytes($column) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_int($column) || $column < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'column', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $result = pg_size($this->value, $column); if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_size', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_size', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2787,24 +2840,24 @@ class c_base_database_result extends c_base_return_resource { */ public function field_table($column, $oid = FALSE) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_int($column) || $column < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'column', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($oid)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'oid', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'oid', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $result = pg_field_table($this->value, $column, $oid); if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_field_table', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_field_table', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2830,19 +2883,19 @@ class c_base_database_result extends c_base_return_resource { */ public function field_type_oid($column) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_int($column) || $column < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'column', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $result = pg_field_type_oid($this->value, $column); if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_field_type_oid', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_field_type_oid', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2865,14 +2918,14 @@ class c_base_database_result extends c_base_return_resource { */ public function last_oid() { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } $result = pg_last_oid($this->database); if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_last_oid', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_last_oid', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2893,19 +2946,19 @@ class c_base_database_result extends c_base_return_resource { */ public function field_type($column) { if (!is_resource($this->value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_NO_RESOURCE); return c_base_return_error::s_false($error); } if (!is_int($column) || $column < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'column', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'column', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $result = pg_field_type($this->value, $column); if ($result === FALSE) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'pg_field_type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'pg_field_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2930,7 +2983,7 @@ class c_base_database_result extends c_base_return_resource { return new c_base_return_true(); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::FUNCTION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::FUNCTION_FAILURE); return c_base_return_error::s_false($error); } } @@ -3000,13 +3053,13 @@ class c_base_database_query extends c_base_return_array { */ public function import($import) { if (!is_string($import) || empty($import)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'import', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'import', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $decoded = json_decode($import, TRUE); if (!is_array($decoded) || empty($decoded)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'json_decode', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'json_decode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -3034,7 +3087,7 @@ class c_base_database_query extends c_base_return_array { // everything else has to be re-created on import for security reasons. $encoded = json_encode($this->value); if (!is_string($encoded)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'json_encode', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'json_encode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_debug.php b/common/base/classes/base_debug.php index 5d23bd4..a29e990 100644 --- a/common/base/classes/base_debug.php +++ b/common/base/classes/base_debug.php @@ -3,8 +3,6 @@ * @file * Provides a class for performing debugging. */ - -// include required files. require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -12,17 +10,17 @@ require_once('common/base/classes/base_return.php'); * A generic class for performing debugging. */ class c_base_debug extends c_base_return { - private static $s_debugging = FALSE; + protected static $s_debugging = FALSE; - private $time_start; - private $time_stop; + protected $time_start; + protected $time_stop; - private $memory_usage_start; - private $memory_usage_stop; - private $memory_usage_peak; - private $memory_allocated_start; - private $memory_allocated_stop; - private $memory_allocated_peak; + protected $memory_usage_start; + protected $memory_usage_stop; + protected $memory_usage_peak; + protected $memory_allocated_start; + protected $memory_allocated_stop; + protected $memory_allocated_peak; /** @@ -91,7 +89,7 @@ class c_base_debug extends c_base_return { */ public static function s_set_debugging($debug) { if (!is_bool($debug)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'debug', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'debug', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -188,12 +186,12 @@ class c_base_debug extends c_base_return { } if (!is_bool($milliseconds)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'milliseconds', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'milliseconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (is_null($this->time_start) || is_null($this->time_stop)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->time_stop', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->time_stop', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -228,18 +226,18 @@ class c_base_debug extends c_base_return { } if (!is_int($option) || $option < 1 || $option > 3) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'option', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($megabytes)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'megabytes', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'megabytes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ($option == 1) { if (is_null($this->memory_usage_peak)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->memory_usage_peak', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->memory_usage_peak', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -251,7 +249,7 @@ class c_base_debug extends c_base_return { } elseif ($option == 2) { if (is_null($this->time_stop)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->time_stop', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->time_stop', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -263,12 +261,12 @@ class c_base_debug extends c_base_return { } else { if (is_null($this->time_start)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->time_start', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->time_start', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (is_null($this->time_stop)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->time_stop', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->time_stop', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_defaults_global.php b/common/base/classes/base_defaults_global.php index 489aa06..ee4d87f 100644 --- a/common/base/classes/base_defaults_global.php +++ b/common/base/classes/base_defaults_global.php @@ -34,7 +34,7 @@ class c_base_defaults_global { const ERROR_BACKTRACE_ARGUMENTS = FALSE; // provide a language to fallback to if none is set. - const LANGUAGE_CLASS_DEFAULT = 'c_base_language_us_only'; + const LANGUAGE_CLASS_DEFAULT = 'c_base_languages_us_only'; // reserved path groups: array(97, 99, 100, 102, 109, 115, 116, 120, 121). const RESERVED_PATH_GROUP = array(c_base_ascii::LOWER_A, c_base_ascii::LOWER_C, c_base_ascii::LOWER_D, c_base_ascii::LOWER_F, c_base_ascii::LOWER_M, c_base_ascii::LOWER_S, c_base_ascii::LOWER_T, c_base_ascii::LOWER_U, c_base_ascii::LOWER_X); @@ -49,7 +49,7 @@ class c_base_defaults_global { private static $s_timezone = NULL; // Represents the default language class in use. - // This must be a class that implements: i_base_language. + // This must be a class that implements: i_base_languages. // In most cases, this should be expected to be defined. private static $s_languages = NULL; @@ -65,8 +65,8 @@ class c_base_defaults_global { * FALSE with error bit set is returned on error. */ public static function s_set_timezone($timezone) { - if (!($timezone instanceof i_base_language)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'timezone', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + if (!($timezone instanceof i_base_languages)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timezone', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -77,18 +77,18 @@ class c_base_defaults_global { /** * Set the default language. * - * @param i_base_language $languages - * Must be a class that implements i_base_language. + * @param i_base_languages $languages + * Must be a class that implements i_base_languages. * * @return c_base_return_status * TRUE on success. * FALSE with error bit set is returned on error. * - * @see: i_base_language() + * @see: i_base_languages() */ public static function s_set_languages($languages) { - if (!($languages instanceof i_base_language)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'languages', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + if (!($languages instanceof i_base_languages)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'languages', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -119,12 +119,12 @@ class c_base_defaults_global { */ public static function s_get_date($string, $timestamp = NULL) { if (!is_string($string)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'string', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } if (!is_null($timestamp) && !is_float($timestamp) && !is_int($timestamp)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'timestamp', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -153,7 +153,7 @@ class c_base_defaults_global { unset($microseconds); if (!($date instanceof DateTime)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'date', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -163,7 +163,7 @@ class c_base_defaults_global { $formatted = $date->format($string); if (!is_string($formatted)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'date->format', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'date->format', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -190,12 +190,12 @@ class c_base_defaults_global { */ public static function s_get_timestamp($string, $timestamp = NULL) { if (!is_string($string)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'string', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } if (!is_null($timestamp) && !is_float($timestamp) && !is_int($timestamp)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'timestamp', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } @@ -208,7 +208,7 @@ class c_base_defaults_global { $now = self::s_get_timestamp_session()->get_value_exact(); $microseconds = (int) (($now - ((int) $now)) * 1000000); - $date = new date('Y/m/d h:i:s', (int) $now) . '.' . $microseconds . date(' P', (int) $now); + $date = new DateTime(date('Y/m/d h:i:s', (int) $now) . '.' . $microseconds . date(' P', (int) $now)); unset($now); } else { @@ -224,13 +224,13 @@ class c_base_defaults_global { unset($microseconds); if (!($date instanceof DateTime)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'date', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } $resulting_timestamp = $date->getTimestamp(); if (!is_int($resulting_timestamp)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'date->get_timestamp', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'date->get_timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } @@ -303,10 +303,10 @@ class c_base_defaults_global { /** * Get the currently assigned language class. * - * @return i_base_language - * A class that implements i_base_language. + * @return i_base_languages + * A class that implements i_base_languages. * - * @see: i_base_language + * @see: i_base_languages */ public static function s_get_languages() { if (is_null(self::$s_languages)) { @@ -324,7 +324,7 @@ class c_base_defaults_global { * @return string * A string representing the class of the language. * - * @see: i_base_language + * @see: i_base_languages */ public static function s_get_languages_class() { if (is_null(self::$s_languages)) { diff --git a/common/base/classes/base_email.php b/common/base/classes/base_email.php index c0d876e..6f22816 100644 --- a/common/base/classes/base_email.php +++ b/common/base/classes/base_email.php @@ -3,12 +3,9 @@ * @file * Provides a class for managing e-mail related functionality. */ - -// include required files. require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_ascii.php'); -require_once('common/base/classes/base_utf8.php'); require_once('common/base/classes/base_rfc_string.php'); /** diff --git a/common/base/classes/base_error.php b/common/base/classes/base_error.php index 1ae30aa..6c6c479 100644 --- a/common/base/classes/base_error.php +++ b/common/base/classes/base_error.php @@ -512,11 +512,12 @@ interface i_base_error_messages { const POSTGRESQL_CONNECTION_FAILURE = 14; const POSTGRESQL_NO_CONNECTION = 15; const POSTGRESQL_NO_RESOURCE = 16; - const SOCKET_FAILURE = 17; - const ACCESS_DENIED = 18; - const ACCESS_DENIED_UNAVAILABLE = 19; - const ACCESS_DENIED_USER = 20; - const ACCESS_DENIED_ADMINISTRATION = 21; + const POSTGRESQL_ERROR = 17; + const SOCKET_FAILURE = 18; + const ACCESS_DENIED = 19; + const ACCESS_DENIED_UNAVAILABLE = 20; + const ACCESS_DENIED_USER = 21; + const ACCESS_DENIED_ADMINISTRATION = 22; /** @@ -527,7 +528,7 @@ interface i_base_error_messages { * @param bool $arguments * (optional) When TRUE, argument placeholders are added. * When FALSE, no placeholders are provided. - * All placeholders should begin with a single colon ':'. + * All placeholders should begin with a single colon ':' and be wrapped within '{}', such that 'example' placeholder is ':{example}'. * @param bool $function_name * (optional) When TRUE, the function name is included with the message. * When FALSE, no funciton name is provided. diff --git a/common/base/classes/base_error_messages_english.php b/common/base/classes/base_error_messages_english.php index 71c2fc6..bfebb0d 100644 --- a/common/base/classes/base_error_messages_english.php +++ b/common/base/classes/base_error_messages_english.php @@ -122,12 +122,12 @@ final class c_base_error_messages_english implements i_base_error_messages { static function s_get_message($code, $arguments = TRUE, $function_name = FALSE) { $function_name_string = NULL; if ($function_name) { - $function_name_string = ' while calling :function_name'; + $function_name_string = ' while calling :{function_name}'; } if ($code === self::INVALID_ARGUMENT) { if ($arguments === TRUE) { - return c_base_return_string::s_new('An invalid argument, :argument_name, has been specified' . $function_name_string . '.'); + return c_base_return_string::s_new('An invalid argument, :{argument_name}, has been specified' . $function_name_string . '.'); } else { return c_base_return_string::s_new('An invalid argument has been specified' . $function_name_string . '.'); @@ -135,7 +135,7 @@ final class c_base_error_messages_english implements i_base_error_messages { } elseif ($code === self::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'); + return c_base_return_string::s_new('The argument, :{format_name}, has an invalid format' . $function_name_string . '.:{expected_format}'); } else { return c_base_return_string::s_new('An invalid format has been specified.'); @@ -151,7 +151,7 @@ final class c_base_error_messages_english implements i_base_error_messages { } elseif ($code === self::INVALID_VARIABLE) { if ($arguments === TRUE) { - return c_base_return_string::s_new('The variable, :variable_name, is invalid' . $function_name_string . '.'); + return c_base_return_string::s_new('The variable, :{variable_name}, is invalid' . $function_name_string . '.'); } else { return c_base_return_string::s_new('An invalid variable has been specified.'); @@ -159,7 +159,7 @@ final class c_base_error_messages_english implements i_base_error_messages { } elseif ($code === self::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 . '.'); + return c_base_return_string::s_new('Failed to perform operation, :{operation_name}' . (is_null($function_name_string) ? '' : ',') . $function_name_string . '.'); } else { return c_base_return_string::s_new('Failed to perform operation.'); @@ -167,7 +167,7 @@ final class c_base_error_messages_english implements i_base_error_messages { } elseif ($code === self::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 . '.'); + return c_base_return_string::s_new('Did not perform unnecessary operation, :{operation_name}' . (is_null($function_name_string) ? '' : ',') . $function_name_string . '.'); } else { return c_base_return_string::s_new('Did not perform unnecessary operation.'); @@ -175,7 +175,7 @@ final class c_base_error_messages_english implements i_base_error_messages { } elseif ($code === self::FUNCTION_FAILURE) { if ($arguments === TRUE) { - return c_base_return_string::s_new('The function, :function_name, has failed execution.'); + return c_base_return_string::s_new('The function, :{function_name}, has failed execution.'); } else { return c_base_return_string::s_new('A function has failed execution.'); @@ -183,7 +183,7 @@ final class c_base_error_messages_english implements i_base_error_messages { } elseif ($code === self::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 . '.'); + return c_base_return_string::s_new('The index, :index_name, was not found in the array, :{array_name}' . $function_name_string . '.'); } else { return c_base_return_string::s_new('Failed to find index within specified array.'); @@ -191,7 +191,7 @@ final class c_base_error_messages_english implements i_base_error_messages { } elseif ($code === self::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 . '.'); + return c_base_return_string::s_new('The file, :{file_name}, was not found or cannot be accessed' . $function_name_string . '.'); } else { return c_base_return_string::s_new('File not found or cannot be accessed.'); @@ -199,7 +199,7 @@ final class c_base_error_messages_english implements i_base_error_messages { } elseif ($code === self::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 . '.'); + return c_base_return_string::s_new('The directory, :{directory_name}, was not found or cannot be accessed' . $function_name_string . '.'); } else { return c_base_return_string::s_new('File not found or cannot be accessed.'); @@ -207,7 +207,7 @@ final class c_base_error_messages_english implements i_base_error_messages { } elseif ($code === self::NO_CONNECTION) { if ($arguments === TRUE) { - return c_base_return_string::s_new('The resource, :resource_name, is not connected' . $function_name_string . '.'); + return c_base_return_string::s_new('The resource, :{resource_name}, is not connected' . $function_name_string . '.'); } else { return c_base_return_string::s_new('The resource is not connected.'); @@ -215,7 +215,7 @@ final class c_base_error_messages_english implements i_base_error_messages { } elseif ($code === self::NO_SUPPORT) { if ($arguments === TRUE) { - return c_base_return_string::s_new('The functionality, :functionality_name, is currently not supported.' . $function_name_string . '.'); + return c_base_return_string::s_new('The functionality, :{functionality_name}, is currently not supported.' . $function_name_string . '.'); } else { return c_base_return_string::s_new('The requested functionality is not supported.'); @@ -223,7 +223,7 @@ final class c_base_error_messages_english implements i_base_error_messages { } elseif ($code === self::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 . '.'); + 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 . '.'); } else { return c_base_return_string::s_new('Failed to connect to the database.'); @@ -231,7 +231,7 @@ final class c_base_error_messages_english implements i_base_error_messages { } elseif ($code === self::POSTGRESQL_NO_CONNECTION) { if ($arguments === TRUE) { - return c_base_return_string::s_new('The database, :database_name, is not connected' . $function_name_string . '.'); + return c_base_return_string::s_new('The database, :{database_name}, is not connected' . $function_name_string . '.'); } else { return c_base_return_string::s_new('The database is not connected.'); @@ -245,9 +245,17 @@ 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) { + if ($arguments === TRUE) { + return c_base_return_string::s_new('Database query error: :{database_error_message}' . $function_name_string . '.'); + } + else { + return c_base_return_string::s_new('Failed to perform database query.'); + } + } elseif ($code === self::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 . '.'); + 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 . '.'); } else { return c_base_return_string::s_new('Failed to perform socket operation.'); @@ -255,7 +263,7 @@ final class c_base_error_messages_english implements i_base_error_messages { } elseif ($code === self::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 . '.'); + return c_base_return_string::s_new('Access is denied, :{operation_name}' . (is_null($function_name_string) ? '' : ',') . $function_name_string . '.'); } else { return c_base_return_string::s_new('Access is denied.'); @@ -263,7 +271,7 @@ final class c_base_error_messages_english implements i_base_error_messages { } elseif ($code === self::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 . '.'); + return c_base_return_string::s_new('Access is denied due to unavailability, :{operation_name} ' . (is_null($function_name_string) ? '' : ',') . $function_name_string . '.'); } else { return c_base_return_string::s_new('Access is denied due to unavailability.'); @@ -271,7 +279,7 @@ final class c_base_error_messages_english implements i_base_error_messages { } elseif ($code === self::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 . '.'); + 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 . '.'); } else { return c_base_return_string::s_new('Access is denied for user.'); @@ -279,7 +287,7 @@ final class c_base_error_messages_english implements i_base_error_messages { } elseif ($code === self::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 . '.'); + return c_base_return_string::s_new('Access is denied for administrative reasons, :{operation_name} ' . (is_null($function_name_string) ? '' : ',') . $function_name_string . '.'); } else { return c_base_return_string::s_new('Access is denied for administrative reasons.'); diff --git a/common/base/classes/base_error_messages_japanese.php b/common/base/classes/base_error_messages_japanese.php index ea3c8b4..ddb6344 100644 --- a/common/base/classes/base_error_messages_japanese.php +++ b/common/base/classes/base_error_messages_japanese.php @@ -127,12 +127,12 @@ final class c_base_error_messages_japanese implements i_base_error_messages { static function s_get_message($code, $arguments = TRUE, $function_name = FALSE) { $function_name_string = NULL; if ($function_name) { - $function_name_string = ' :function_name を呼び出している間'; + $function_name_string = ' :{function_name} を呼び出している間'; } if ($code === self::INVALID_ARGUMENT) { if ($arguments === TRUE) { - return c_base_return_string::s_new('無効な引数 :argument_name が指定されています' . $function_name_string . '。'); + return c_base_return_string::s_new('無効な引数 :{argument_name} が指定されています' . $function_name_string . '。'); } else { return c_base_return_string::s_new('無効な引数が指定されています' . $function_name_string . '。'); @@ -140,7 +140,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::INVALID_FORMAT) { if ($arguments === TRUE) { - return c_base_return_string::s_new('引数 :format_name の形式が無効です' . $function_name_string . '。:expected_format'); + return c_base_return_string::s_new('引数 :{format_name} の形式が無効です' . $function_name_string . '。:{expected_format}'); } else { return c_base_return_string::s_new('無効な形式が指定されています。'); @@ -156,7 +156,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::INVALID_VARIABLE) { if ($arguments === TRUE) { - return c_base_return_string::s_new('変数 :variable_name は無効です' . $function_name_string . '。'); + return c_base_return_string::s_new('変数 :{variable_name} は無効です' . $function_name_string . '。'); } else { return c_base_return_string::s_new('無効な変数が指定されています。'); @@ -164,7 +164,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::OPERATION_FAILURE) { if ($arguments === TRUE) { - return c_base_return_string::s_new('操作の実行に失敗しました :operation_name' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); + return c_base_return_string::s_new('操作の実行に失敗しました :{operation_name}' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } else { return c_base_return_string::s_new('操作を実行できませんでした。'); @@ -172,7 +172,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::OPERATION_UNECESSARY) { if ($arguments === TRUE) { - return c_base_return_string::s_new('不要な操作を実行しませんでした :operation_name' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); + return c_base_return_string::s_new('不要な操作を実行しませんでした :{operation_name}' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } else { return c_base_return_string::s_new('不要な操作を実行しませんでした。'); @@ -180,7 +180,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::FUNCTION_FAILURE) { if ($arguments === TRUE) { - return c_base_return_string::s_new('関数 :function_name は実行に失敗しました。'); + return c_base_return_string::s_new('関数 :{function_name} は実行に失敗しました。'); } else { return c_base_return_string::s_new('関数の実行に失敗しました。'); @@ -188,7 +188,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::NOT_FOUND_ARRAY_INDEX) { if ($arguments === TRUE) { - return c_base_return_string::s_new('配列 :index_name に索引 :array_name が見つかりませんでした。' . $function_name_string . '。'); + return c_base_return_string::s_new('配列 :index_name に索引 :{array_name} が見つかりませんでした。' . $function_name_string . '。'); } else { return c_base_return_string::s_new('指定された配列内のインデックスの検索に失敗しました。'); @@ -196,7 +196,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::NOT_FOUND_FILE) { if ($arguments === TRUE) { - return c_base_return_string::s_new('ファイル :file_name が見つかりませんでした、またはアクセスできません' . $function_name_string . '。'); + return c_base_return_string::s_new('ファイル :{file_name} が見つかりませんでした、またはアクセスできません' . $function_name_string . '。'); } else { return c_base_return_string::s_new('ファイルが見つからないか、アクセスできません。'); @@ -204,7 +204,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::NOT_FOUND_DIRECTORY) { if ($arguments === TRUE) { - return c_base_return_string::s_new('ディレクトリ :directory_name が見つかりませんでした、またはアクセスできません' . $function_name_string . '。'); + return c_base_return_string::s_new('ディレクトリ :{directory_name} が見つかりませんでした、またはアクセスできません' . $function_name_string . '。'); } else { return c_base_return_string::s_new('ファイルが見つからないか、アクセスできません。'); @@ -212,7 +212,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::NO_CONNECTION) { if ($arguments === TRUE) { - return c_base_return_string::s_new('リソース :resource_name は接続されていません' . $function_name_string . '。'); + return c_base_return_string::s_new('リソース :{resource_name} は接続されていません' . $function_name_string . '。'); } else { return c_base_return_string::s_new('リソースが接続されていません。'); @@ -220,7 +220,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::NO_SUPPORT) { if ($arguments === TRUE) { - return c_base_return_string::s_new('機能 :functionality_name は現在サポートされていません。' . $function_name_string . '。'); + return c_base_return_string::s_new('機能 :{functionality_name} は現在サポートされていません。' . $function_name_string . '。'); } else { return c_base_return_string::s_new('要求された機能はサポートされていません。'); @@ -228,7 +228,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::POSTGRESQL_CONNECTION_FAILURE) { if ($arguments === TRUE) { - return c_base_return_string::s_new('データベースへの接続に失敗しました。 :database_name' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); + return c_base_return_string::s_new('データベースへの接続に失敗しました。 :{database_name}' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } else { return c_base_return_string::s_new('データベースに接続できませんでした。'); @@ -236,7 +236,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::POSTGRESQL_NO_CONNECTION) { if ($arguments === TRUE) { - return c_base_return_string::s_new('データベース :database_name は接続されていません' . $function_name_string . '。'); + return c_base_return_string::s_new('データベース :{database_name} は接続されていません' . $function_name_string . '。'); } else { return c_base_return_string::s_new('データベースが接続されていません。'); @@ -252,7 +252,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::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 . '。'); + return c_base_return_string::s_new('ソケット操作の実行に失敗しました。 :{operation_name} 、ソケットエラー(:{socket_error} \':{socket_error_message}\'' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } else { return c_base_return_string::s_new('ソケット操作を実行できませんでした。'); @@ -260,7 +260,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::ACCESS_DENIED) { if ($arguments === TRUE) { - return c_base_return_string::s_new('アクセスが拒否されました。 :operation_name' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); + return c_base_return_string::s_new('アクセスが拒否されました。 :{operation_name}' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } else { return c_base_return_string::s_new('アクセスは拒否されました。'); @@ -268,7 +268,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::ACCESS_DENIED_UNAVAILABLE) { if ($arguments === TRUE) { - return c_base_return_string::s_new('利用できないためアクセスが拒否されましたが、 :operation_name ' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); + return c_base_return_string::s_new('利用できないためアクセスが拒否されましたが、 :{operation_name} ' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } else { return c_base_return_string::s_new('利用できないためアクセスが拒否されました。'); @@ -276,7 +276,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::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 . '。'); + return c_base_return_string::s_new('ユーザーのアクセスが拒否されました :name_machine_user (:{id_user}), :{operation_name} ' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } else { return c_base_return_string::s_new('ユーザーのアクセスが拒否されました。'); @@ -284,7 +284,7 @@ final class c_base_error_messages_japanese implements i_base_error_messages { } elseif ($code === self::ACCESS_DENIED_ADMINISTRATION) { if ($arguments === TRUE) { - return c_base_return_string::s_new('管理上の理由でアクセスが拒否されました, :operation_name ' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); + return c_base_return_string::s_new('管理上の理由でアクセスが拒否されました, :{operation_name} ' . (is_null($function_name_string) ? '' : '、') . $function_name_string . '。'); } else { return c_base_return_string::s_new('管理上の理由からアクセスが拒否されました。'); diff --git a/common/base/classes/base_form.php b/common/base/classes/base_form.php index 256f94e..d305ef9 100644 --- a/common/base/classes/base_form.php +++ b/common/base/classes/base_form.php @@ -3,12 +3,9 @@ * @file * Provides a class for managing forms. */ - -// include required files. require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); - /** * A class for form problems. * @@ -18,8 +15,8 @@ require_once('common/base/classes/base_return.php'); * @todo: come up with a list of problem codes and add a problem id variable. */ class c_base_form_problem extends c_base_return_string { - private $fields; - private $arguments; + protected $fields; + protected $arguments; /** @@ -121,7 +118,7 @@ class c_base_form_problem extends c_base_return_string { } if (!is_string($field_name) || empty($field_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'field_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'field_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -148,7 +145,7 @@ class c_base_form_problem extends c_base_return_string { */ public function unset_field($field_name) { if (!is_string($field_name) && !empty($field_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'field_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'field_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -191,12 +188,12 @@ class c_base_form_problem extends c_base_return_string { */ public function set_argument($index, $value) { if (!is_string($index) && !empty($index)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'index', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'value', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -218,7 +215,7 @@ class c_base_form_problem extends c_base_return_string { */ public function get_argument($index) { if (!is_string($index) && !empty($index)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'index', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_html.php b/common/base/classes/base_html.php index 30d1c03..fdc07d5 100644 --- a/common/base/classes/base_html.php +++ b/common/base/classes/base_html.php @@ -7,8 +7,6 @@ * * @see: https://www.w3.org/TR/html5/ */ - -// include required files. require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_markup.php'); @@ -21,13 +19,13 @@ require_once('common/base/classes/base_markup.php'); * @todo: add support for non-standard tag attributes, which will just be a string or NULL. */ class c_base_html extends c_base_return { - private $id; - private $attributes; - private $attributes_body; - private $type; - private $method; - private $headers; - private $body; + protected $id; + protected $attributes; + protected $attributes_body; + protected $type; + protected $method; + protected $headers; + protected $body; /** * Class constructor. @@ -95,12 +93,12 @@ class c_base_html extends c_base_return { */ public static function sanitize_css($text, $partial = FALSE) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } if (!is_bool($partial)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'partial', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'partial', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -118,7 +116,7 @@ class c_base_html extends c_base_return { } unset($sanitized); - $error = c_base_error::s_log(' ' . $response['error']['message'], array('arguments' => array(':operation_name' => 'preg_replace', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(' ' . $response['error']['message'], array('arguments' => array(':{operation_name}' => 'preg_replace', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -134,7 +132,7 @@ class c_base_html extends c_base_return { */ public function set_id($id) { if (!is_int($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'id', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -173,7 +171,7 @@ class c_base_html extends c_base_return { */ public function set_attribute($attribute, $value) { if (!is_int($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'attribute', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -195,7 +193,7 @@ class c_base_html extends c_base_return { */ public function set_attribute_body($attribute, $value) { if (!is_int($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'attribute', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -230,7 +228,7 @@ class c_base_html extends c_base_return { */ public function get_attribute($attribute) { if (!is_int($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'attribute', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -252,7 +250,7 @@ class c_base_html extends c_base_return { */ public function get_attribute_body($attribute) { if (!is_int($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'attribute', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -274,12 +272,12 @@ class c_base_html extends c_base_return { */ public function set_tag($tag, $delta = NULL) { if (!($tag instanceof c_base_markup_tag)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'tag', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'tag', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($delta) && !is_int($delta)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'delta', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -309,7 +307,7 @@ class c_base_html extends c_base_return { */ public function get_tag($delta) { if (!is_int($delta)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'delta', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -344,18 +342,18 @@ class c_base_html extends c_base_return { * (optional) A position in the page to assign the header. * If NULL, then the header is appended. * - * @return c_base_return_status - * TRUE on success, FALSE otherwise. + * @return c_base_return_int|c_base_return_status + * An integer representing the delta of where the header was added. * FALSE with error bit set is returned on error. */ public function set_header($header, $delta = NULL) { if (!($header instanceof c_base_markup_tag)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'header', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'header', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($delta) && !is_int($delta)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'delta', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -379,12 +377,15 @@ class c_base_html extends c_base_return { } if (is_null($delta)) { + $at = count($this->headers); $this->headers[] = $header; } else { + $at = $delta; $this->headers[$delta] = $header; } - return new c_base_return_true(); + + return c_base_return_int::s_new($at); } /** @@ -400,7 +401,7 @@ class c_base_html extends c_base_return { */ public function get_header($delta) { if (!is_int($delta)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'delta', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_http.php b/common/base/classes/base_http.php index 7229044..950bb6f 100644 --- a/common/base/classes/base_http.php +++ b/common/base/classes/base_http.php @@ -3,14 +3,11 @@ * @file * Provides a class for managing the HTTP protocol. */ - -// include required files. require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_charset.php'); require_once('common/base/classes/base_rfc_string.php'); require_once('common/base/classes/base_utf8.php'); -require_once('common/base/classes/base_email.php'); require_once('common/base/classes/base_languages.php'); require_once('common/base/classes/base_http_status.php'); require_once('common/base/classes/base_cookie.php'); @@ -238,20 +235,20 @@ class c_base_http extends c_base_rfc_string { // fallbacks/failsafes const FALLBACK_PROTOCOL = 'HTTP/1.1'; - private $headers; - private $headers_sent; - private $request; - private $request_time; - private $response; + protected $headers; + protected $headers_sent; + protected $request; + protected $request_time; + protected $response; - private $request_uri_relative; - private $request_uri_query; + protected $request_uri_relative; + protected $request_uri_query; - private $content; - private $content_is_file; - private $buffer_enabled; + protected $content; + protected $content_is_file; + protected $buffer_enabled; - private $languages; + protected $languages; /** * Class constructor. @@ -364,12 +361,12 @@ class c_base_http extends c_base_rfc_string { */ public function get_request($header_name = NULL, $delta = NULL) { if (!is_null($header_name) && !is_int($header_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'header_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($delta) && !is_int($delta) && !is_string($delta)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'delta', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -379,7 +376,7 @@ class c_base_http extends c_base_rfc_string { } if (!array_key_exists($header_name, $this->request)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':index_name' => $header_name, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, array('arguments' => array(':index_name' => $header_name, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -392,7 +389,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_value::s_new($this->request[$header_name]['data'][$delta]); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':index_name' => $delta, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, array('arguments' => array(':index_name' => $delta, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -414,12 +411,12 @@ class c_base_http extends c_base_rfc_string { */ public function get_request_uri_relative($base_path, $with_query = FALSE) { if (!is_string($base_path)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'base_path', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'base_path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } if (!is_bool($with_query)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'with_query', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'with_query', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -476,12 +473,12 @@ class c_base_http extends c_base_rfc_string { */ public function get_response($header_name = NULL, $delta = NULL) { if (!is_null($header_name) && !is_int($header_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'header_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($delta) && !is_int($delta) && !is_string($delta)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'delta', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -491,7 +488,7 @@ class c_base_http extends c_base_rfc_string { } if (!array_key_exists($header_name, $this->response)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':index_name' => $header_name, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, array('arguments' => array(':index_name' => $header_name, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -508,7 +505,7 @@ class c_base_http extends c_base_rfc_string { return c_base_return_value::s_new($this->response[$header_name][$delta]); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':index_name' => $delta, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, array('arguments' => array(':index_name' => $delta, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -520,8 +517,8 @@ class c_base_http extends c_base_rfc_string { * * The languages class provides a list of supported languages. * - * @param string|i_base_language $class_name - * A string name representing an object that is a sub-class of i_base_language. + * @param string|i_base_languages $class_name + * A string name representing an object that is a sub-class of i_base_languages. * Or a language class object. * * @return c_base_return_status @@ -529,8 +526,8 @@ class c_base_http extends c_base_rfc_string { * FALSE with error bit set is returned on error. */ public function set_languages($class_name) { - if (!(is_string($class_name) && is_subclass_of('i_base_language', $class_name)) || !(is_object($class_name) && $class_name instanceof i_base_language)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'class_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + if (!(is_string($class_name) && is_subclass_of('i_base_languages', $class_name)) || !(is_object($class_name) && $class_name instanceof i_base_languages)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'class_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -547,7 +544,7 @@ class c_base_http extends c_base_rfc_string { /** * Get the language class object currently assigned to this class. * - * @return i_base_language + * @return i_base_languages * The language class object. */ public function get_languages() { @@ -907,16 +904,16 @@ class c_base_http extends c_base_rfc_string { * Because multiple languages may be returned, this does not explicitly define the langugae headers. * * @param array $supported_languages - * An array of supported languages as defined in i_base_language. + * An array of supported languages as defined in i_base_languages. * * @return c_base_return_int - * An integer representing the language code as defined in i_base_language. + * An integer representing the language code as defined in i_base_languages. * 0 with the error bit set is returned on error. - * An integer representing the language code as defined in i_base_language with the error bit set is returned on error. + * An integer representing the language code as defined in i_base_languages with the error bit set is returned on error. */ public function select_language($supported_languages) { if (!is_array($supported_languages) || empty($supported_languages)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'supported_languages', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $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(0, 'c_base_return_int', $error); } @@ -925,7 +922,7 @@ class c_base_http extends c_base_rfc_string { 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']) {; - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'supported_languages', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $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); } @@ -970,7 +967,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_access_control_allow_origin($uri) { if (!is_string($uri)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'uri', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'uri', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -983,7 +980,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->pr_rfc_string_prepare', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -992,7 +989,7 @@ class c_base_http extends c_base_rfc_string { if ($parsed['invalid']) { unset($parsed); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'uri', ':expected_format' => NULL, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'uri', ':{expected_format}' => NULL, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed['invalid']); @@ -1022,7 +1019,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_access_control_allow_credentials($allow_credentials) { if (!is_bool($allow_credentials)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'allowed_credentials', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'allowed_credentials', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1049,12 +1046,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_access_control_expose_headers($header_name, $append = TRUE) { if (!is_string($header_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'header_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1063,7 +1060,7 @@ class c_base_http extends c_base_rfc_string { if ($prepared_token === FALSE) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->p_prepare_token', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1098,7 +1095,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_access_control_max_age($seconds) { if (!is_int($seconds) && !is_float($seconds)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'seconds', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'seconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1125,12 +1122,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_access_control_allow_methods($method, $append = TRUE) { if (!is_int($method)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'method', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'method', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1158,7 +1155,7 @@ class c_base_http extends c_base_rfc_string { break; default: - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'method', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'method', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1192,12 +1189,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_access_control_allow_headers($header_name, $append = TRUE) { if (!is_string($header_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'header_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1206,7 +1203,7 @@ class c_base_http extends c_base_rfc_string { if ($prepared_token === FALSE) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->p_prepare_token', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1245,12 +1242,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_accept_patch($media_type, $append = TRUE) { if (!is_string($media_type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'media_type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'media_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1259,7 +1256,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->pr_rfc_string_prepare', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1269,7 +1266,7 @@ class c_base_http extends c_base_rfc_string { if ($parsed['invalid']) { unset($parsed); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'media type', ':expected_format' => '1*(tchar) "/" 1*(tchar) *(*(wsp) ";" *(wsp) 1*(1*(tchar) *(wsp) "=" *(wsp) 1*(tchar) / (quoted-string)))', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'media type', ':{expected_format}' => '1*(tchar) "/" 1*(tchar) *(*(wsp) ";" *(wsp) 1*(1*(tchar) *(wsp) "=" *(wsp) 1*(tchar) / (quoted-string)))', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed['invalid']); @@ -1310,7 +1307,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_accept_ranges($ranges) { if (!is_string($ranges)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'ranges', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'ranges', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1319,7 +1316,7 @@ class c_base_http extends c_base_rfc_string { if ($prepared_token === FALSE) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->p_prepare_token', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1343,7 +1340,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_age($seconds) { if (!is_int($seconds)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'seconds', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'seconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1373,12 +1370,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_allow($allow, $append = TRUE) { if (!is_int($allow)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'allow', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $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 (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1398,7 +1395,7 @@ class c_base_http extends c_base_rfc_string { case self::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); + $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); } @@ -1451,17 +1448,17 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_cache_control($directive_name, $directive_value = NULL, $append = TRUE) { if (!is_int($directive_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'directive_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'directive_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($directive_value) && !is_string($directive_value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'directive_value', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'directive_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1482,7 +1479,7 @@ class c_base_http extends c_base_rfc_string { break; default: - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'directive_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'directive_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1492,7 +1489,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->pr_rfc_string_prepare', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1502,7 +1499,7 @@ class c_base_http extends c_base_rfc_string { if ($parsed['invalid']) { unset($parsed); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'directive value', ':expected_format' => '1*(tchar) *("=" 1*(1*(tchar) / quoted-string) *(*(wsp) "," *(wsp) 1*(tchar) *("=" 1*(1*(tchar) / quoted-string))', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'directive value', ':{expected_format}' => '1*(tchar) *("=" 1*(1*(tchar) / quoted-string) *(*(wsp) "," *(wsp) 1*(tchar) *("=" 1*(1*(tchar) / quoted-string))', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed); @@ -1544,12 +1541,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_connection($connection_option, $append = TRUE) { if (!is_string($connection_option)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'connection_option', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'connection_option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1558,7 +1555,7 @@ class c_base_http extends c_base_rfc_string { if ($prepared_token === FALSE) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->p_prepare_token', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1604,17 +1601,17 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_content($content, $append = TRUE, $is_file = FALSE) { if (!is_string($content)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'content', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'content', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($is_file)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'is_file', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_file', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1689,22 +1686,22 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_content_disposition($type, $parameter_name = NULL, $parameter_value = NULL, $append = TRUE) { if (!is_null($type) && !is_string($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($parameter_name) && !is_string($parameter_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'parameter_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($parameter_value) && !is_string($parameter_value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'parameter_value', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1725,14 +1722,14 @@ class c_base_http extends c_base_rfc_string { if ($prepared_token === FALSE) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'content disposition type', ':expected_format' => '1*(tchar)', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'content disposition type', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } if (empty($prepared_token)) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } @@ -1743,14 +1740,14 @@ class c_base_http extends c_base_rfc_string { if ($prepared_parameter_name === FALSE) { unset($prepared_parameter_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'content disposition parameter name', ':expected_format' => '1*(tchar)', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'content disposition parameter name', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } if (empty($prepared_parameter_name)) { unset($prepared_parameter_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'parameter_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } @@ -1760,7 +1757,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->pr_rfc_string_prepare', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1771,7 +1768,7 @@ class c_base_http extends c_base_rfc_string { unset($parsed_parameter_value); unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'disposition parameter value', ':expected_format' => '1*(tchar) / 1*(quoted-string)', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'disposition parameter value', ':{expected_format}' => '1*(tchar) / 1*(quoted-string)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed_parameter_value['invalid']); @@ -1786,7 +1783,7 @@ class c_base_http extends c_base_rfc_string { if (is_null($type)) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1887,12 +1884,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_content_encoding($encoding, $append = TRUE) { if (!is_int($encoding)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'encoding', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1911,7 +1908,7 @@ class c_base_http extends c_base_rfc_string { case self::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); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1945,12 +1942,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_content_language($language = NULL, $append = TRUE) { if (!is_null($language) && !is_int($language)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'language', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'language', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1963,7 +1960,7 @@ class c_base_http extends c_base_rfc_string { if ($default instanceof c_base_return_false) { unset($default); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->languages->s_get_default_id', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->languages->s_get_default_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1972,7 +1969,7 @@ class c_base_http extends c_base_rfc_string { } else { if ($this->languages->s_get_names_by_id($language) instanceof c_base_return_false) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->languages->s_get_names_by_id', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->languages->s_get_names_by_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2011,12 +2008,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_content_length($length = NULL, $force = FALSE) { if (!is_null($length) && !is_int($length) || $length < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'length', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'length', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($force)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'force', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'force', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2038,7 +2035,7 @@ class c_base_http extends c_base_rfc_string { if (!file_exists($filename)) { unset($filename); - $error = c_base_error::s_log(NULL, array('arguments' => array(':file_name' => $filename, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } @@ -2082,23 +2079,23 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_content_range($start, $stop, $total) { if (!is_int($start) && $start !== FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'start', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'start', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($stop) && $stop !== FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'stop', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'stop', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($total) && $total !== FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'total', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'total', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } // unsatisfiable requires a total to be specified. if (($start === FALSE || $stop === FALSE) && $total === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'total', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'total', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2141,7 +2138,7 @@ class c_base_http extends c_base_rfc_string { $result = c_base_mime::s_get_names_by_id($content_type); if ($result instanceof c_base_return_false) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'content_type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'content_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2149,14 +2146,14 @@ class c_base_http extends c_base_rfc_string { unset($result); } elseif (!is_string($content_type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'content_type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'content_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } else { $result = c_base_mime::s_identify($content_type, TRUE); if ($result instanceof c_base_return_false) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'content_type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'content_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2167,7 +2164,7 @@ class c_base_http extends c_base_rfc_string { if (!c_base_charset::s_is_valid($charset)) { unset($content_type_string); - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'charset', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'charset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2212,7 +2209,7 @@ class c_base_http extends c_base_rfc_string { } if (!is_int($timestamp) && !is_float($timestamp)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'timestamp', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2249,7 +2246,7 @@ class c_base_http extends c_base_rfc_string { } if (!is_int($timestamp) && !is_float($timestamp)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'timestamp', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2282,7 +2279,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_etag($entity_tag = NULL, $weak = FALSE) { if (!is_null($entity_tag) && !is_string($entity_tag) && $entity_tag !== FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'entity_tag', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'entity_tag', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2319,7 +2316,7 @@ class c_base_http extends c_base_rfc_string { unset($hash); unset($response); - $error = c_base_error::s_log(NULL, array('arguments' => array(':file_name' => $filename, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } @@ -2330,7 +2327,7 @@ class c_base_http extends c_base_rfc_string { unset($hash); unset($response); - $error = c_base_error::s_log(NULL, array('arguments' => array(':file_name' => $filename, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } } @@ -2384,7 +2381,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_expires($timestamp) { if (!is_int($timestamp) && !is_float($timestamp)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'timestamp', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2406,7 +2403,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_last_modified($timestamp) { if (!is_int($timestamp) && !is_float($timestamp)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'timestamp', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timestamp', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2447,22 +2444,22 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_link($uri, $parameter_name = NULL, $parameter_value = NULL, $append = TRUE) { if (!is_string($uri)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'uri', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'uri', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($parameter_name) && !is_string($parameter_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'parameter_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($parameter_value) && !is_string($parameter_value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'parameter_value', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2481,7 +2478,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->pr_rfc_string_prepare', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2491,7 +2488,7 @@ class c_base_http extends c_base_rfc_string { if ($parsed_uri['invalid']) { unset($parsed_uri); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'link uri', ':expected_format' => '(uri)', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'link uri', ':{expected_format}' => '(uri)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed_uri['invalid']); @@ -2519,14 +2516,14 @@ class c_base_http extends c_base_rfc_string { if ($prepared_parameter_name === FALSE) { unset($prepared_parameter_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'link parameter name', ':expected_format' => '1*(tchar)', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'link parameter name', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } if (empty($prepared_parameter_name)) { unset($prepared_parameter_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'parameter_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } @@ -2538,7 +2535,7 @@ class c_base_http extends c_base_rfc_string { unset($text); unset($parsed_uri); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->pr_rfc_string_prepare', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2549,7 +2546,7 @@ class c_base_http extends c_base_rfc_string { unset($parsed_parameter_value); unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'content disposition parameter value', ':expected_format' => '1*(tchar) / 1*(quoted-string)', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'content disposition parameter value', ':{expected_format}' => '1*(tchar) / 1*(quoted-string)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed_parameter_value['invalid']); @@ -2603,7 +2600,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_location($uri) { if (!is_string($uri) && !is_array($uri)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'uri', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'uri', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2613,7 +2610,7 @@ class c_base_http extends c_base_rfc_string { unset($parts); unset($combined); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'URI or URL', ':expected_format' => 'URI or URL', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'URI or URL', ':{expected_format}' => 'URI or URL', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($combined); @@ -2626,7 +2623,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->pr_rfc_string_prepare', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2635,7 +2632,7 @@ class c_base_http extends c_base_rfc_string { if ($parsed['invalid']) { unset($parsed); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'uri', ':expected_format' => NULL, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'uri', ':{expected_format}' => NULL, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed['invalid']); @@ -2673,17 +2670,17 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_pragma($parameter_name, $parameter_value = NULL, $append = TRUE) { if (!is_string($parameter_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'parameter_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($parameter_value) && !is_string($parameter_value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'parameter_value', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2694,14 +2691,14 @@ class c_base_http extends c_base_rfc_string { if ($prepared_parameter_name === FALSE) { unset($prepared_parameter_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'pragma parameter name', ':expected_format' => '1*(tchar)', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'pragma parameter name', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } if (empty($prepared_parameter_name)) { unset($prepared_parameter_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'parameter_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } @@ -2711,7 +2708,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->pr_rfc_string_prepare', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -2722,7 +2719,7 @@ class c_base_http extends c_base_rfc_string { unset($parsed_parameter_value); unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'pragma parameter value', ':expected_format' => '1*(tchar) / 1*(quoted-string)', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'pragma parameter value', ':{expected_format}' => '1*(tchar) / 1*(quoted-string)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed_parameter_value['invalid']); @@ -2763,7 +2760,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_proxy_authenticate($value) { // @todo: self::RESPONSE_PROXY_AUTHENTICATE - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response proxy authenticate', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response proxy authenticate', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -2782,7 +2779,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_public_key_pins($value) { // @todo: self::RESPONSE_PUBLIC_KEY_PINS - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response public key pins', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response public key pins', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -2807,7 +2804,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_refresh($value) { // @todo: self::RESPONSE_REFRESH - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response refresh', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response refresh', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -2829,12 +2826,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_retry_after($date, $seconds = FALSE) { if (!is_int($date)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'date', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($seconds)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'seconds', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'seconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2862,7 +2859,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_server($value) { // @todo: self::RESPONSE_SERVER - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response server', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response server', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -2886,12 +2883,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_set_cookie($cookie, $append = TRUE) { if (!($cookie instanceof c_base_cookie)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'cookie', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'cookie', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2927,7 +2924,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_status($code) { if (!is_int($code)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'code', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'code', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2948,7 +2945,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_strict_transport_security($value) { // @todo: self::RESPONSE_STRICT_SECURITY_TRANSPORT - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response strict transport security', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response strict transport security', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -2965,7 +2962,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_trailer($value) { // @todo: self::RESPONSE_TRAILER - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response trailer', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response trailer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -2996,7 +2993,7 @@ class c_base_http extends c_base_rfc_string { // @todo: self::RESPONSE_TRANSFER_ENCODING - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response transfer encoding', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response transfer encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -3013,7 +3010,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_upgrade($value) { // @todo: self::RESPONSE_UPGRADE - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response upgrade', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response upgrade', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -3034,12 +3031,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_vary($header_name, $append = TRUE) { if (!is_string($header_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'header_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3047,7 +3044,7 @@ class c_base_http extends c_base_rfc_string { $prepared_token = $this->p_prepare_token($header_name, FALSE); if ($prepared_token === FALSE) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->p_prepare_token', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -3081,7 +3078,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_warning($value) { // @todo: self::RESPONSE_WARNING - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response warning', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response warning', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -3100,7 +3097,7 @@ class c_base_http extends c_base_rfc_string { public function set_response_www_authenticate($value) { // @todo: self::RESPONSE_WWW_AUTHENTICATE - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response www authenticate', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response www authenticate', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -3116,7 +3113,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_protocol($protocol) { if (!is_string($protocol)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'protocol', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'protocol', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3154,17 +3151,17 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_content_security_policy($policy_name, $policy_value, $append = TRUE) { if (!is_string($policy_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'policy_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'policy_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($policy_value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'policy_value', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'policy_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3173,7 +3170,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->pr_rfc_string_prepare', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -3184,7 +3181,7 @@ class c_base_http extends c_base_rfc_string { unset($parsed_policy_name); unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'policy name', ':expected_format' => '1*((alpha) | (digit) | '-')', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'policy name', ':{expected_format}' => '1*((alpha) | (digit) | '-')', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed_policy_name['invalid']); @@ -3195,7 +3192,7 @@ class c_base_http extends c_base_rfc_string { if ($text['invalid']) { unset($text); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->pr_rfc_string_prepare', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->pr_rfc_string_prepare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -3206,7 +3203,7 @@ class c_base_http extends c_base_rfc_string { unset($parsed_policy_value); unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'policy value', ':expected_format' => '1*(vchar, except \';\' and \',\')', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'policy value', ':{expected_format}' => '1*(vchar, except \';\' and \',\')', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } unset($parsed_policy_value['invalid']); @@ -3241,7 +3238,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_x_content_type_options($no_sniff) { if (!is_bool($no_sniff)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'no_sniff', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'no_sniff', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3267,12 +3264,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_x_ua_compatible($browser_name, $compatible_version) { if (!is_string($parameter_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'parameter_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'parameter_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($compatible_version) && !is_string($compatible_version)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'compatible_version', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'compatible_version', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3281,14 +3278,14 @@ class c_base_http extends c_base_rfc_string { if ($prepared_browser_name === FALSE) { unset($prepared_browser_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'browser name', ':expected_format' => '1*(tchar)', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'browser name', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } if (empty($prepared_browser_name)) { unset($prepared_browser_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'browser_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'browser_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3308,14 +3305,14 @@ class c_base_http extends c_base_rfc_string { if ($prepared_compatible_version === FALSE) { unset($prepared_compatible_version); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'browser name', ':expected_format' => '1*(tchar)', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'browser name', ':{expected_format}' => '1*(tchar)', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } if (empty($prepared_compatible_version)) { unset($prepared_compatible_version); - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'compatible_version', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'compatible_version', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3365,33 +3362,33 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_checksum_header($action = self::CHECKSUM_ACTION_AUTO, $what = NULL, $type = NULL, $checksum = NULL) { 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); + $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) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'action', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $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 (!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); + $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); } if (!is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($checksum)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'checksum', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ($what != self::CHECKSUM_WHAT_PARTIAL && $what != self::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); + $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); } @@ -3409,7 +3406,7 @@ class c_base_http extends c_base_rfc_string { case CHECKSUM_PG: break; default: - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3423,17 +3420,17 @@ class c_base_http extends c_base_rfc_string { else { if (!is_null($what) && !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); + $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); } if (!is_null($type) && !is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($action) && !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); + $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); } @@ -3474,12 +3471,12 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_checksum_headers($header_name, $append = TRUE) { if (!is_string($header_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'header_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'header_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3487,7 +3484,7 @@ class c_base_http extends c_base_rfc_string { $prepared_token = $this->p_prepare_token($header_name); if ($prepared_token === FALSE) { unset($prepared_token); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->p_prepare_token', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_prepare_token', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -3535,33 +3532,33 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_checksum_content($action = self::CHECKSUM_ACTION_AUTO, $what = NULL, $type = NULL, $checksum = NULL) { 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); + $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) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'action', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $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 (!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); + $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); } if (!is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($checksum)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'checksum', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'checksum', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ($what != self::CHECKSUM_WHAT_PARTIAL && $what != self::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); + $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); } @@ -3579,7 +3576,7 @@ class c_base_http extends c_base_rfc_string { case CHECKSUM_PG: break; default: - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3592,17 +3589,17 @@ class c_base_http extends c_base_rfc_string { } else { if (!is_null($what) && !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); + $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); } if (!is_null($type) && !is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } 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); + $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); } @@ -3639,7 +3636,7 @@ class c_base_http extends c_base_rfc_string { */ public function set_response_content_revision($revision) { if (!is_int($revision)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'revision', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'revision', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3660,7 +3657,7 @@ class c_base_http extends c_base_rfc_string { */ public function unset_response_value($response_id) { if (!is_int($response_id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'response_id', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'response_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -3685,7 +3682,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -3706,7 +3703,7 @@ 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); + $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); return c_base_return_error::s_value(FALSE, 'c_base_return_bool', $error); } @@ -3726,7 +3723,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -3746,7 +3743,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -3765,7 +3762,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -3785,7 +3782,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -3805,7 +3802,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -3829,7 +3826,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -3847,7 +3844,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -3865,7 +3862,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -3899,7 +3896,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -3920,7 +3917,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -3938,7 +3935,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -3954,7 +3951,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -3972,7 +3969,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -3990,7 +3987,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -4016,7 +4013,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -4036,7 +4033,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -4054,7 +4051,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } @@ -4080,7 +4077,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } @@ -4104,7 +4101,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -4122,7 +4119,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } @@ -4144,7 +4141,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } @@ -4169,7 +4166,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -4189,7 +4186,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -4208,7 +4205,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -4228,13 +4225,13 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response proxy authenticate', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response proxy authenticate', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4251,13 +4248,13 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response public key pins', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response public key pins', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4277,13 +4274,13 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response refresh', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response refresh', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4301,7 +4298,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -4319,7 +4316,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_cookie', $error); } @@ -4336,13 +4333,13 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response server', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response server', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4357,7 +4354,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -4375,13 +4372,13 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value('', 'c_base_return_string', $error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response strict transport security', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response strict transport security', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4401,13 +4398,13 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response trailer', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response trailer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4422,13 +4419,13 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response transfer encoding', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response transfer encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4442,13 +4439,13 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response upgrade', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response upgrade', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4463,7 +4460,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -4481,13 +4478,13 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response warning', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response warning', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4502,13 +4499,13 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_false($error); } // @todo - $error = c_base_error::s_log(NULL, array('arguments' => array(':functionality_name' => 'http response www authenticate', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{functionality_name}' => 'http response www authenticate', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_SUPPORT); return c_base_return_error::s_false($error); } @@ -4521,7 +4518,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -4541,7 +4538,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -4557,7 +4554,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(FALSE, 'c_base_return_bool', $error); } @@ -4573,7 +4570,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -4595,7 +4592,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -4611,7 +4608,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -4631,7 +4628,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -4647,7 +4644,7 @@ class c_base_http extends c_base_rfc_string { */ 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); + $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); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -4718,12 +4715,12 @@ class c_base_http extends c_base_rfc_string { */ public function send_response_headers($shuffle = TRUE) { if (!is_bool($shuffle)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'shuffle', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'shuffle', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if ($this->headers_sent || headers_sent()) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'headers_sent()', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_UNECESSARY); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'headers_sent()', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_UNECESSARY); return c_base_return_error::s_false($error); } @@ -4934,12 +4931,12 @@ class c_base_http extends c_base_rfc_string { */ public function encode_response_content($compression = NULL, $max_filesize = NULL) { if (!is_null($compression) && !is_int($compression)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'compression', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'compression', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($max_filesize) && !(is_int($max_filesize) && $max_filesize > 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'max_filesize', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'max_filesize', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -4960,7 +4957,7 @@ class c_base_http extends c_base_rfc_string { unset($filename); unset($content); - $error = c_base_error::s_log(NULL, array('arguments' => array(':file_name' => $filename, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } @@ -4987,7 +4984,7 @@ class c_base_http extends c_base_rfc_string { unset($filename); unset($content); - $error = c_base_error::s_log(NULL, array('arguments' => array(':file_name' => $filename, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } @@ -5042,7 +5039,7 @@ class c_base_http extends c_base_rfc_string { if (!file_exists($filename)) { unset($filename); - $error = c_base_error::s_log(NULL, array('arguments' => array(':file_name' => $filename, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } @@ -5050,7 +5047,7 @@ class c_base_http extends c_base_rfc_string { if ($opened_file === FALSE) { unset($filename); - $error = c_base_error::s_log(NULL, array('arguments' => array(':file_name' => $filename, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } @@ -5084,7 +5081,7 @@ class c_base_http extends c_base_rfc_string { */ public function sanitize_path($path) { if (!is_string($path)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'path', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -9672,7 +9669,7 @@ class c_base_http extends c_base_rfc_string { unset($algorithm); unset($use_hash); - $error = c_base_error::s_log(NULL, array('arguments' => array(':file_name' => $filename, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $filename, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_http_status.php b/common/base/classes/base_http_status.php index f39c89f..7b5a44c 100644 --- a/common/base/classes/base_http_status.php +++ b/common/base/classes/base_http_status.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing the HTTP protocol status codes. */ +require_once('common/base/classes/base_error.php'); +require_once('common/base/classes/base_return.php'); /** * A generic class for managing the HTTP protocol status codes. @@ -95,7 +97,7 @@ class c_base_http_status { */ public static function to_text($status) { if (!is_int($status)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'status', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'status', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_languages.php b/common/base/classes/base_languages.php index e394a67..6850a67 100644 --- a/common/base/classes/base_languages.php +++ b/common/base/classes/base_languages.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing the different supported languages. */ +require_once('common/base/classes/base_error.php'); +require_once('common/base/classes/base_return.php'); /** * A generic interface for managing the different supported languages. @@ -11,7 +13,7 @@ * * @see: http://www.loc.gov/standards/iso639-2/php/code_list.php */ -interface i_base_language { +interface i_base_languages { const NONE = 0; const AFAR = 1; // aar, aa const ABKHAZIAN = 2; // abk, ab @@ -627,7 +629,7 @@ interface i_base_language { * * @see: http://www.loc.gov/standards/iso639-2/php/code_list.php */ -final class c_base_language_us_only implements i_base_language { +final class c_base_languages_us_only implements i_base_languages { private static $s_aliases = array( self::ENGLISH_US => array('en-us'), @@ -657,7 +659,7 @@ final class c_base_language_us_only implements i_base_language { */ public static function s_get_names_by_id($id) { if (!is_int($id) && !is_numeric($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'id', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -673,7 +675,7 @@ final class c_base_language_us_only implements i_base_language { */ public static function s_get_names_by_alias($alias) { if (!is_string($alias)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'alias', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -689,7 +691,7 @@ final class c_base_language_us_only implements i_base_language { */ public static function s_get_id_by_name($name) { if (!is_string($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -705,7 +707,7 @@ final class c_base_language_us_only implements i_base_language { */ public static function s_get_id_by_alias($alias) { if (!is_string($alias)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'alias', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -721,7 +723,7 @@ final class c_base_language_us_only implements i_base_language { */ public static function s_get_aliases_by_id($id) { if (!is_int($id) && !is_numeric($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'id', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -737,7 +739,7 @@ final class c_base_language_us_only implements i_base_language { */ public static function s_get_aliases_by_name($name) { if (!is_string($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -796,7 +798,7 @@ final class c_base_language_us_only implements i_base_language { * * @see: http://www.loc.gov/standards/iso639-2/php/code_list.php */ -final class c_base_language_limited implements i_base_language { +final class c_base_languages_limited implements i_base_languages { private static $s_aliases = array( self::ENGLISH_US => array('en-us'), @@ -860,7 +862,7 @@ final class c_base_language_limited implements i_base_language { */ public static function s_get_names_by_id($id) { if (!is_int($id) && !is_numeric($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'id', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -876,7 +878,7 @@ final class c_base_language_limited implements i_base_language { */ public static function s_get_names_by_alias($alias) { if (!is_string($alias)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'alias', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -892,7 +894,7 @@ final class c_base_language_limited implements i_base_language { */ public static function s_get_id_by_name($name) { if (!is_string($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -908,7 +910,7 @@ final class c_base_language_limited implements i_base_language { */ public static function s_get_id_by_alias($alias) { if (!is_string($alias)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'alias', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -924,7 +926,7 @@ final class c_base_language_limited implements i_base_language { */ public static function s_get_aliases_by_id($id) { if (!is_int($id) && !is_numeric($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'id', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -940,7 +942,7 @@ final class c_base_language_limited implements i_base_language { */ public static function s_get_aliases_by_name($name) { if (!is_string($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -999,7 +1001,7 @@ final class c_base_language_limited implements i_base_language { * * @see: http://www.loc.gov/standards/iso639-2/php/code_list.php */ -final class c_base_language_all implements i_base_language { +final class c_base_languages_all implements i_base_languages { private static $s_aliases = array( self::ENGLISH_US => array('en-us'), @@ -2679,7 +2681,7 @@ final class c_base_language_all implements i_base_language { */ public static function s_get_names_by_id($id) { if (!is_int($id) && !is_numeric($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'id', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -2695,7 +2697,7 @@ final class c_base_language_all implements i_base_language { */ public static function s_get_names_by_alias($alias) { if (!is_string($alias)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'alias', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -2711,7 +2713,7 @@ final class c_base_language_all implements i_base_language { */ public static function s_get_id_by_name($name) { if (!is_string($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -2727,7 +2729,7 @@ final class c_base_language_all implements i_base_language { */ public static function s_get_id_by_alias($alias) { if (!is_string($alias)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'alias', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -2743,7 +2745,7 @@ final class c_base_language_all implements i_base_language { */ public static function s_get_aliases_by_id($id) { if (!is_int($id) && !is_numeric($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'id', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -2759,7 +2761,7 @@ final class c_base_language_all implements i_base_language { */ public static function s_get_aliases_by_name($name) { if (!is_string($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } diff --git a/common/base/classes/base_ldap.php b/common/base/classes/base_ldap.php index 81c90e0..55462c8 100644 --- a/common/base/classes/base_ldap.php +++ b/common/base/classes/base_ldap.php @@ -5,8 +5,6 @@ * * This is initially designed just to select/read from the ldap and not meant to modify or manage ldap databases. */ - -// include required files. require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -14,11 +12,11 @@ require_once('common/base/classes/base_return.php'); * A class for managing ldap connections. */ class c_base_ldap extends c_base_return { - private $ldap; - private $name; + protected $ldap; + protected $name; - private $bind_name; - private $bind_password; + protected $bind_name; + protected $bind_password; /** @@ -79,7 +77,7 @@ class c_base_ldap extends c_base_return { */ public function set_name($name) { if (!is_string($name) || empty($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -87,7 +85,7 @@ class c_base_ldap extends c_base_return { $parsed = parse_url($name, PHP_URL_HOST); if ($parsed === FALSE) { unset($parsed); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'parse_url', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'parse_url', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -119,7 +117,7 @@ class c_base_ldap extends c_base_return { */ public function set_bind_name($name) { if (!is_null($name) && (!is_string($name) || empty($name))) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -149,7 +147,7 @@ class c_base_ldap extends c_base_return { */ public function set_bind_password($password) { if (!is_null($password) && (!is_string($password) || empty($password))) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'password', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'password', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -181,7 +179,7 @@ class c_base_ldap extends c_base_return { */ public function do_connect() { if (is_null($this->name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -194,7 +192,7 @@ class c_base_ldap extends c_base_return { if (!is_resource($this->ldap)) { $this->ldap = NULL; - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'ldap_connect', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_connect', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -205,7 +203,7 @@ class c_base_ldap extends c_base_return { } unset($bound); - $error = c_base_error::s_log(NULL, array('arguments' => array(':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::FUNCTION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::FUNCTION_FAILURE); return c_base_return_error::s_false($error); } @@ -232,7 +230,7 @@ class c_base_ldap extends c_base_return { } unset($unbound); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'ldap_unbind', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_unbind', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -266,32 +264,32 @@ class c_base_ldap extends c_base_return { */ public function do_search($directory_name, $filter, $attributes, $attributes_only = FALSE, $entry_limit = 0, $time_limit = 0, $dereference = LDAP_DEREF_NEVER) { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_string($directory_name) || !is_string($filter)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'directory_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'directory_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($attributes)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'attributes', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attributes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($entry_limit) || $entry_limit < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'entry_limit', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'entry_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($time_limit) || $time_limit < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'time_limit', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'time_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($dereference)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'dereference', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'dereference', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -307,7 +305,7 @@ class c_base_ldap extends c_base_return { } unset($found); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'ldap_search', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_search', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -341,37 +339,37 @@ class c_base_ldap extends c_base_return { */ public function do_list($directory_name, $filter, $attributes, $attributes_only = FALSE, $entry_limit = 0, $time_limit = 0, $dereference = LDAP_DEREF_NEVER) { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_string($directory_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'directory_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'directory_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($filter)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'filter', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'filter', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($attributes)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'attributes', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attributes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($entry_limit) || $entry_limit < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'entry_limit', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'entry_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($time_limit) || $time_limit < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'time_limit', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'time_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($dereference)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'dereference', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'dereference', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -387,7 +385,7 @@ class c_base_ldap extends c_base_return { } unset($found); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'ldap_list', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_list', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -421,37 +419,37 @@ class c_base_ldap extends c_base_return { */ public function do_read($directory_name, $filter, $attributes, $attributes_only = FALSE, $entry_limit = 0, $time_limit = 0, $dereference = LDAP_DEREF_NEVER) { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_string($directory_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'directory_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'directory_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($filter)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'filter', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'filter', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($attributes)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'attributes', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attributes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($entry_limit) || $entry_limit < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'entry_limit', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'entry_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($time_limit) || $time_limit < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'time_limit', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'time_limit', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($dereference)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'dereference', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'dereference', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -467,7 +465,7 @@ class c_base_ldap extends c_base_return { } unset($found); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'ldap_read', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_read', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -490,22 +488,22 @@ class c_base_ldap extends c_base_return { */ public function do_compare($directory_name, $attribute, $value) { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_string($directory_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'directory_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'directory_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'attibute', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attibute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($value)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'value', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -513,7 +511,7 @@ class c_base_ldap extends c_base_return { if ($result === -1) { unset($result); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'ldap_compare', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_compare', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -536,7 +534,7 @@ class c_base_ldap extends c_base_return { */ public function get_error_message() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } @@ -556,7 +554,7 @@ class c_base_ldap extends c_base_return { */ public function get_error_number() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } @@ -592,19 +590,19 @@ class c_base_ldap extends c_base_return { */ public function get_option($option) { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_int($option)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'option', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } $value = NULL; if (ldap_get_option($this->ldap, $option, $value) === FALSE) { unset($value); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'ldap_get_option', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_get_option', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -693,7 +691,7 @@ class c_base_ldap_result extends c_base_return_resource { */ public function set_ldap($ldap) { if (!is_resource($ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -714,14 +712,14 @@ class c_base_ldap_result extends c_base_return_resource { */ public function get_count() { if (!is_resource($ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } $total = ldap_count_entries($this->ldap, $this->value); if ($total === FALSE) { unset($total); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'ldap_count_entries', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_count_entries', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -738,14 +736,14 @@ class c_base_ldap_result extends c_base_return_resource { */ public function load_entry_first() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } $first = ldap_first_entry($this->ldap, $this->value); if ($first === FALSE) { unset($first); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'ldap_first_entry', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_first_entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -769,7 +767,7 @@ class c_base_ldap_result extends c_base_return_resource { */ public function load_entry_next() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } @@ -780,7 +778,7 @@ class c_base_ldap_result extends c_base_return_resource { // the entry must first be loaded by self::load_entry_first(). if (!is_null($this->entry)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->entry', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -807,7 +805,7 @@ class c_base_ldap_result extends c_base_return_resource { */ public function get_entry_all() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } @@ -815,7 +813,7 @@ class c_base_ldap_result extends c_base_return_resource { if ($entries === FALSE) { unset($entries); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'ldap_get_entries', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_get_entries', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -837,12 +835,12 @@ class c_base_ldap_result extends c_base_return_resource { */ public function get_attribute_first() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_resource($this->entry)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->entry', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -850,7 +848,7 @@ class c_base_ldap_result extends c_base_return_resource { if ($attribute === FALSE) { unset($attribute); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'ldap_first_attribute', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_first_attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -873,12 +871,12 @@ class c_base_ldap_result extends c_base_return_resource { */ public function get_attribute_next() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_resource($this->entry)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->entry', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -886,7 +884,7 @@ class c_base_ldap_result extends c_base_return_resource { if ($attribute === FALSE) { unset($attribute); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'ldap_next_attribute', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_next_attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -909,12 +907,12 @@ class c_base_ldap_result extends c_base_return_resource { */ public function get_attribute_all() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_resource($this->entry)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->entry', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -922,7 +920,7 @@ class c_base_ldap_result extends c_base_return_resource { if ($attributes === FALSE) { unset($attributes); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'ldap_get_attributes', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_get_attributes', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -945,12 +943,12 @@ class c_base_ldap_result extends c_base_return_resource { */ public function get_directory_name() { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_resource($this->entry)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->entry', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -958,7 +956,7 @@ class c_base_ldap_result extends c_base_return_resource { if ($directory_name === FALSE) { unset($directory_name); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'ldap_get_dn', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_get_dn', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -981,22 +979,22 @@ class c_base_ldap_result extends c_base_return_resource { */ public function get_values($attribute, $binary = FALSE) { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_resource($this->entry)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->entry', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->entry', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (!is_string($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'attribute', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($binary)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'binary', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'binary', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1010,7 +1008,7 @@ class c_base_ldap_result extends c_base_return_resource { if (!is_array($values)) { unset($values); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => ($binary ? 'ldap_get_values_len' : 'ldap_get_values'), ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => ($binary ? 'ldap_get_values_len' : 'ldap_get_values'), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1027,12 +1025,12 @@ class c_base_ldap_result extends c_base_return_resource { */ public function do_sort($attribute) { if (!is_resource($this->ldap)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':resource_name' => 'this->ldap', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{resource_name}' => 'this->ldap', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NO_CONNECTION); return c_base_return_error::s_false($error); } if (!is_string($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'attribute', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1040,7 +1038,7 @@ class c_base_ldap_result extends c_base_return_resource { if ($status === FALSE) { unset($status); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'ldap_sort', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_sort', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } unset($status); @@ -1066,7 +1064,7 @@ class c_base_ldap_result extends c_base_return_resource { return new c_base_return_true(); } - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'ldap_free_result', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'ldap_free_result', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } } diff --git a/common/base/classes/base_log.php b/common/base/classes/base_log.php index 8242bf9..dab9195 100644 --- a/common/base/classes/base_log.php +++ b/common/base/classes/base_log.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing the logs. */ +require_once('common/base/classes/base_error.php'); +require_once('common/base/classes/base_return.php'); /** * A generic class for managing the logs. @@ -67,8 +69,8 @@ class c_base_log extends c_base_return { const SEVERITY_CRITICAL = 6; // this is a big problem. const SEVERITY_EMERGENCY = 7; // this is the most serious type of problem. - private $type; - private $data; + protected $type; + protected $data; /** @@ -124,7 +126,7 @@ class c_base_log extends c_base_return { */ public function set_type($type) { if (!is_int($type) || $type < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -174,12 +176,12 @@ class c_base_log extends c_base_return { */ public function get_data_jsonized($options = 0, $depth = 512) { if (!is_int($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'options', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($depth) || $depth < 1) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'depth', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'depth', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -187,7 +189,7 @@ class c_base_log extends c_base_return { if ($encoded === FALSE) { unset($encoded); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'json_encode', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'json_encode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -209,12 +211,12 @@ class c_base_log extends c_base_return { protected function pr_set_data($key, $value) { if (is_int($key)) { if ($key < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'key', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'key', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } elseif (!is_string($key)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'value', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -236,17 +238,17 @@ class c_base_log extends c_base_return { protected function pr_get_data($key) { if (is_int($key)) { if ($key < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'key', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'key', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } } elseif (!is_string($key)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'key', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'key', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!array_key_exists($key, $this->data)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':index_name' => $key, ':array_name' => 'this->data', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, array('arguments' => array(':index_name' => $key, ':{array_name}' => 'this->data', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_markup.php b/common/base/classes/base_markup.php index 4b1b413..dff4ed8 100644 --- a/common/base/classes/base_markup.php +++ b/common/base/classes/base_markup.php @@ -3,13 +3,10 @@ * @file * Provides a class for html markup. */ - -// include required files. require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_mime.php'); require_once('common/base/classes/base_charset.php'); -require_once('common/base/classes/base_languages.php'); require_once('common/base/classes/base_rfc_string.php'); /** @@ -89,7 +86,7 @@ class c_base_markup_attributes { const ATTRIBUTE_HIDDEN = 64; // TRUE/FALSE const ATTRIBUTE_HIGH = 65; // number const ATTRIBUTE_HREF = 66; // text - const ATTRIBUTE_HREF_LANGUAGE = 67; // i_base_language + const ATTRIBUTE_HREF_LANGUAGE = 67; // i_base_languages const ATTRIBUTE_HREF_NO = 68; // text const ATTRIBUTE_HTTP_EQUIV = 69; // text const ATTRIBUTE_ICON = 70; // text @@ -101,7 +98,7 @@ class c_base_markup_attributes { const ATTRIBUTE_KEY_TYPE = 76; // text: rsa, dsa, ec const ATTRIBUTE_KIND = 77; // text const ATTRIBUTE_LABEL = 78; // text - const ATTRIBUTE_LANGUAGE = 79; // i_base_language, int + const ATTRIBUTE_LANGUAGE = 79; // i_base_languages, int const ATTRIBUTE_LENGTH_ADJUST = 80; // text const ATTRIBUTE_LIST = 81; // text, datalist_id const ATTRIBUTE_LOCAL = 82; // text @@ -256,7 +253,7 @@ class c_base_markup_attributes { const ATTRIBUTE_SORTED = 231; // text const ATTRIBUTE_SOURCE = 232; // text: url const ATTRIBUTE_SOURCE_DOCUMENT = 233; // text - const ATTRIBUTE_SOURCE_LANGUAGE = 234; // i_base_language + const ATTRIBUTE_SOURCE_LANGUAGE = 234; // i_base_languages const ATTRIBUTE_SOURCE_SET = 235; // text const ATTRIBUTE_SPAN = 236; // text const ATTRIBUTE_SPELLCHECK = 237; // TRUE/FALSE @@ -607,7 +604,7 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function set_attribute($attribute, $value) { if (!is_int($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'attribute', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1026,7 +1023,7 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function get_attribute($attribute) { if (!is_int($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'attribute', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1038,7 +1035,7 @@ class c_base_markup_tag extends c_base_rfc_string { switch ($attribute) { case c_base_markup_attributes::ATTRIBUTE_NONE: // should not be possible, so consider this an error (when attribute is set to NONE, the entire attributes array is unset). - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); case c_base_markup_attributes::ATTRIBUTE_ABBR: @@ -1420,27 +1417,27 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function check_attribute($attribute, $sanitize = FALSE, $type = NULL, $sub_type = NULL, $options = array()) { if (!is_int($attribute)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'attribute', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'attribute', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($sanitize)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'sanitize', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'sanitize', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($sub_type) && !is_int($sub_type) && !is_string($sub_type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'sub_type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'sub_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_array($options)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'options', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'options', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1573,12 +1570,12 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function set_tag($tag, $index = NULL) { if (!($tag instanceof c_base_markup_tag)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'tag', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'tag', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($index) && (!is_int($index) && $index < 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'index', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1611,7 +1608,7 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function unset_tag($index) { if (!is_null($index) && (!is_int($index) && $index < 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'index', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1653,7 +1650,7 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function get_tag($index) { if (!is_int($index) && $index < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'index', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'index', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1693,7 +1690,7 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function set_text($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1730,7 +1727,7 @@ class c_base_markup_tag extends c_base_rfc_string { */ public function set_type($type) { if (!is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -2071,7 +2068,7 @@ class c_base_markup_tag extends c_base_rfc_string { $value = (string) $this->attributes[$attribute]; } else { - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'value attribute', ':expected_format' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'value attribute', ':{expected_format}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } @@ -2082,7 +2079,7 @@ class c_base_markup_tag extends c_base_rfc_string { $this->attributes[$attribute] = NULL; - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'value attribute', ':expected_format' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'value attribute', ':{expected_format}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); if ($sanitize) { return c_base_return_error::s_true($error); @@ -2129,7 +2126,7 @@ class c_base_markup_tag extends c_base_rfc_string { if ($invalid) { unset($invalid); - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'value attribute', ':expected_format' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'value attribute', ':{expected_format}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); if ($changed) { unset($changed); return c_base_return_error::s_true($error); @@ -2168,7 +2165,7 @@ class c_base_markup_tag extends c_base_rfc_string { */ protected function pr_check_attribute_as_numeric($attribute, $sanitize = TRUE) { if (!is_numeric($this->attributes[$attribute])) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'value attribute', ':expected_format' => 'number', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'value attribute', ':{expected_format}' => 'number', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_mime.php b/common/base/classes/base_mime.php index 84e23e3..7e81740 100644 --- a/common/base/classes/base_mime.php +++ b/common/base/classes/base_mime.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing mime-type information. */ +require_once('common/base/classes/base_error.php'); +require_once('common/base/classes/base_return.php'); /** * A generic class for managing mime-type information. @@ -277,7 +279,7 @@ class c_base_mime { */ static function s_get_names_by_id($id, $category = NULL) { if (!is_int($id) && !is_numeric($id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'id', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -314,7 +316,7 @@ class c_base_mime { } else { if (!is_int($category)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'category', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'category', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -385,12 +387,12 @@ class c_base_mime { */ static function s_identify($mime, $lowercase = FALSE) { if (!is_string($mime)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'mime', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'mime', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($lowercase)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'lowercase', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'lowercase', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_path.php b/common/base/classes/base_path.php index b093988..6dc890d 100644 --- a/common/base/classes/base_path.php +++ b/common/base/classes/base_path.php @@ -15,16 +15,10 @@ * Then, for very specific cases, users should then be granted the ability to create path aliases. * However, aliases should not be able to override pre-define paths or the performance gains are lost by requiring loading of the aliases before each static path. */ - -// include required files. require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); -require_once('common/base/classes/base_ascii.php'); require_once('common/base/classes/base_utf8.php'); require_once('common/base/classes/base_http.php'); -require_once('common/base/classes/base_http_status.php'); -require_once('common/base/classes/base_markup.php'); -require_once('common/base/classes/base_html.php'); require_once('common/base/classes/base_cookie.php'); /** @@ -432,7 +426,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_id_group($id_group) { if (!is_int($id_group) || $id_group < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'id_group', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id_group', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -453,7 +447,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_field_destination($field_destination) { if (!is_string($field_destination) && !is_array($field_destination)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'field_destination', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'field_destination', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -473,7 +467,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_field_response_code($field_response_code) { if (!is_int($field_response_code)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'field_response_code', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'field_response_code', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -493,7 +487,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_date_created($date_created) { if (!is_float($date_created) && !is_int($date_created)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'date_created', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_created', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -513,7 +507,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_date_changed($date_changed) { if (!is_float($date_changed) && !is_int($date_changed)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'date_changed', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_changed', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -533,7 +527,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_date_locked($date_locked) { if (!is_float($date_locked) && !is_int($date_locked)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'date_locked', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'date_locked', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -577,7 +571,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_include_name($name) { if (!is_string($name) && !is_null($name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -600,12 +594,12 @@ class c_base_path extends c_base_rfc_string { */ public function set_allowed_method($method, $append = TRUE) { if (!is_int($method)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'method', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'method', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -629,7 +623,7 @@ class c_base_path extends c_base_rfc_string { */ public function set_allowed_methods($methods) { if (!is_array($methods)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'methods', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'methods', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -660,12 +654,12 @@ class c_base_path extends c_base_rfc_string { */ public function set_sanitize_html($flags = NULL, $encoding = NULL) { if (!is_null($flags) && !is_int($flags)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'flags', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'flags', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($encoding) && !is_string($encoding)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'encoding', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'encoding', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -713,7 +707,7 @@ class c_base_path extends c_base_rfc_string { */ public function is_content($is_content = NULL) { if (!is_null($is_content) && !is_bool($is_content)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'is_content', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_content', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -746,7 +740,7 @@ class c_base_path extends c_base_rfc_string { */ public function is_alias($is_alias = NULL) { if (!is_null($is_alias) && !is_bool($is_alias)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'is_alias', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_alias', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -779,7 +773,7 @@ class c_base_path extends c_base_rfc_string { */ public function is_redirect($is_redirect = NULL) { if (!is_null($is_redirect) && !is_bool($is_redirect)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'is_redirect', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_redirect', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -812,7 +806,7 @@ class c_base_path extends c_base_rfc_string { */ public function is_private($is_private = NULL) { if (!is_null($is_private) && !is_bool($is_private)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'is_private', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_private', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -845,7 +839,7 @@ class c_base_path extends c_base_rfc_string { */ public function is_locked($is_locked = NULL) { if (!is_null($is_locked) && !is_bool($is_locked)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'is_locked', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_locked', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -878,7 +872,7 @@ class c_base_path extends c_base_rfc_string { */ public function is_root($is_root = NULL) { if (!is_null($is_root) && !is_bool($is_root)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'is_root', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_root', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1072,26 +1066,31 @@ class c_base_path extends c_base_rfc_string { $executed = new c_base_path_executed(); if (!($http instanceof c_base_http)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'http', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'http', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); $executed->set_error($error); unset($error); } elseif (!($database instanceof c_base_database)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'database', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'database', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); $executed->set_error($error); unset($error); } elseif (!($session instanceof c_base_session)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'session', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'session', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); $executed->set_error($error); unset($error); } elseif (!is_array($settings)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'settings', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'settings', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); $executed->set_error($error); unset($error); } + if ($this->is_redirect) { + $http->set_response_location($this->field_destination); + $http->set_response_status($this->field_response_code); + } + return $executed; } @@ -1149,12 +1148,12 @@ class c_base_path extends c_base_rfc_string { */ protected function pr_sanitize($id, $type, $type_sub = NULL) { if (!is_string($id) && mb_strlen($id) > 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'id', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(NULL, 'c_base_return_null', $error); } if (!is_int($type)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'type', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(NULL, 'c_base_return_null', $error); } @@ -1242,7 +1241,7 @@ class c_base_path extends c_base_rfc_string { * The $cookies is meant to hold any HTTP cookies to be processed after the execution. * The $output is meant to hold the output for any non-HTML content in the event that HTML is not to be renderred.. * - * @see: c_base_path + * @see: c_base_path() */ class c_base_path_executed extends c_base_return_array { private $cookies = NULL; @@ -1308,12 +1307,12 @@ class c_base_path_executed extends c_base_return_array { */ public function set_cookies($cookie, $append = TRUE) { if (!($cookie instanceof c_base_cookie)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'cookie', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'cookie', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($append)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'append', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'append', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1338,7 +1337,7 @@ class c_base_path_executed extends c_base_return_array { */ public function set_output($output) { if (!is_null($output) && !($output instanceof c_base_return)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'output', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'output', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1361,358 +1360,3 @@ class c_base_path_executed extends c_base_return_array { return $this->output; } } - -/** - * Provides a collection of possible paths for selection and execution. - * - * This utilizes some very basic path based optimizations. - * First, the path group is optimized (an ordinal representing one of: NULL, a-z, A-Z, or 0-9). - * Second, the first character of the path string (expects utf-8). - * Third, the paths are exploded and searched based on all their sub-parts. - */ -class c_base_paths extends c_base_return { - private $paths = NULL; - private $root = NULL; - - - /** - * Class constructor. - */ - public function __construct() { - parent::__construct(); - - $this->paths = array(); - $this->root = NULL; - } - - /** - * Class destructor. - */ - public function __destruct() { - unset($this->paths); - unset($this->root); - - parent::__destruct(); - } - - /** - * @see: t_base_return_value::p_s_new() - */ - public static function s_new($value) { - return self::p_s_new($value, __CLASS__); - } - - /** - * @see: t_base_return_value::p_s_value() - */ - public static function s_value($return) { - return self::p_s_value($return, __CLASS__); - } - - /** - * @see: t_base_return_value_exact::p_s_value_exact() - */ - public static function s_value_exact($return) { - return self::p_s_value_exact($return, __CLASS__, array()); - } - - /** - * Assign a specific path handler. - * - * Duplicate paths overwrite previous paths. - * - * @todo: should redirect and alias booleans be added as parameters? - * - * @pram string $directory - * The first part of the file path - * @pram string $path - * The url path in which the handler applies to. - * @param string $handler - * The name of an implementation of c_base_path. - * @param string|null $directory - * (optional) The prefix path (relative to the PHP includes) to include that contains the requested path. - * When not NULL, both $directory and $name must not be NULL. - * @param string|null $name - * (optional) The suffix path (relative to the PHP includes) to include that contains the requested path. - * When not NULL, both $directory and $name must not be NULL. - * @param array|null $allowed_methods - * (optional) An array of ids of allowed methods. - * When NULL, this value is ignored. - * - * @return c_base_return_status - * TRUE is returned on success. - * FALSE with error bit set is returned on error. - */ - public function set_path($path, $handler, $include_directory = NULL, $include_name = NULL, $allowed_methods = NULL) { - if (!is_string($path)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'path', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_false($error); - } - - if (!is_string($handler)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'handler', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_false($error); - } - - if ((!is_null($include_directory) || (is_null($include_directory) && !is_null($include_name))) && !is_string($include_directory)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'include_directory', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_false($error); - } - - if ((!is_null($include_name) || (is_null($include_name) && !is_null($include_directory))) && !is_string($include_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'include_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_false($error); - } - - - // get allowed methods - $path_object = new c_base_path(); - if (is_null($allowed_methods)) { - $methods = $path_object->get_allowed_methods()->get_value_exact(); - if (!is_array($methods)) { - $methods = array(); - } - } - else { - $methods = $allowed_methods; - } - - - if (mb_strlen($path) == 0) { - unset($path_object); - $this->root = array('handler' => $handler, 'include_directory' => $include_directory, 'include_name' => $include_name, 'is_root' => TRUE, 'methods' => $methods); - return new c_base_return_true(); - } - - if (!is_null($allowed_methods) && !is_array($allowed_methods)) { - unset($path_object); - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'allowed_methods', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_false($error); - } - - $valid_path = $path_object->set_value($path); - if (!$valid_path) { - unset($path_object); - unset($valid_path); - - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'path', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_false($error); - } - unset($valid_path); - - $path_string = $path_object->get_value_exact(); - unset($path_object); - - // assign each path part to the path - $path_parts = explode('/', $path_string); - unset($path_string); - - - // load the path group, if available. - $id_group = 0; - if (mb_strlen($path_parts[0]) == 1) { - $ordinal = ord($path_parts[0]); - if (in_array($ordinal, c_base_defaults_global::RESERVED_PATH_GROUP)) { - $id_group = $ordinal; - } - unset($ordinal); - unset($path_parts[0]); - } - - if (!is_array($this->paths)) { - $this->paths = array(); - } - - if (!array_key_exists($id_group, $this->paths)) { - $this->paths[$id_group] = array(); - } - - $path_tree = &$this->paths[$id_group]; - - $depth_current = 1; - $depth_total = count($path_parts); - - // make sure the first path exists. - $path_part = array_shift($path_parts); - if (!array_key_exists($path_part, $path_tree)) { - $path_tree[$path_part] = array( - 'paths' => array(), - 'include_directory' => NULL, - 'include_name' => NULL, - 'handler' => NULL, - 'methods' => array(), - ); - } - - $path_tree = &$path_tree[$path_part]; - if ($depth_current == $depth_total) { - $path_tree['include_directory'] = $include_directory; - $path_tree['include_name'] = $include_name; - $path_tree['handler'] = $handler; - $path_tree['methods'] = $methods; - } - else { - foreach ($path_parts as $path_part) { - if (!isset($path_tree['paths'][$path_part])) { - $path_tree['paths'][$path_part] = array( - 'paths' => array(), - 'include_directory' => NULL, - 'include_name' => NULL, - 'handler' => NULL, - 'methods' => array(), - ); - } - - $path_tree = &$path_tree['paths'][$path_part]; - $depth_current++; - - if ($depth_current == $depth_total) { - $path_tree['include_directory'] = $include_directory; - $path_tree['include_name'] = $include_name; - $path_tree['handler'] = $handler; - $path_tree['methods'] = $methods; - break; - } - } - } - unset($path_part); - unset($path_parts); - unset($depth_current); - unset($depth_total); - - return new c_base_return_true(); - } - - /** - * Gets a path object for the specified path. - * - * @param string|null $path_string - * The URL path without any path arguments. - * This does not accept wildcards. - * Set to NULL or an empty string for the root path. - * - * @return c_base_return_array|c_base_return_int|c_base_return_null - * An array containing: - * - 'include_directory': the prefix path of the file to include that contains the handler class implementation. - * - 'include_name': the suffix path of the file to include that contains the handler class implementation. - * - 'handler': the name of the handler class. - * - 'redirect': if specified, then a redirect path (instead of include/handler). - * - 'code': if redirect is specified, then the http response code associated with the redirect. - * Wildcards are matched after all non-wildcards. - * NULL is returned if not found. - * FALSE with error bit set is returned on error. - * - * @see: self::set_login() - * @see: self::process_path() - */ - public function find_path($path_string) { - if (!is_null($path_string) && !is_string($path_string)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'path_string', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); - return c_base_return_error::s_false($error); - } - - if (is_null($path_string) || mb_strlen($path_string) == 0) { - if (is_array($this->root)) { - return c_base_return_array::s_new($this->root); - } - - return new c_base_return_null(); - } - - - // sanitize the url path. - $path = new c_base_path(); - if (!$path->set_value($path_string)) { - unset($path); - - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'path_string', ':expected_format' => 'Valid URL path', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); - return c_base_return_error::s_false($error); - } - - $sanitized = $path->get_value_exact(); - unset($path); - - // if the sanitized path is different from the original, then send a url redirect. - if (strcmp($path_string, $sanitized) != 0 && $path_string != '/' . $sanitized) { - return c_base_return_array::s_new(array('redirect' => $sanitized, 'code' => c_base_http_status::MOVED_PERMANENTLY)); - } - - $path_parts = explode('/', $sanitized); - unset($sanitized); - - - // load the path group, if available. - $id_group = 0; - if (mb_strlen($path_parts[0]) == 1) { - $ordinal = ord($path_parts[0]); - if (in_array($ordinal, c_base_defaults_global::RESERVED_PATH_GROUP)) { - $id_group = $ordinal; - } - unset($ordinal); - unset($path_parts[0]); - } - - - $depth_current = 1; - $depth_total = count($path_parts); - $found = NULL; - $path_tree = &$this->paths[$id_group]; - - // @fixme: the current design needs to handle multiple possible wildcard paths when searching (such as '/a/b/c/%', '/a/%/c', where '/a/b/c/%' would prevent '/a/%/c' from ever matching). - $path_part = array_shift($path_parts); - if (array_key_exists($path_part, $path_tree) || array_key_exists('%', $path_tree)) { - if (array_key_exists($path_part, $path_tree)) { - $path_tree = &$path_tree[$path_part]; - } - else { - $path_tree = &$path_tree['%']; - } - - if ($depth_current == $depth_total) { - $found = array( - 'include_directory' => $path_tree['include_directory'], - 'include_name' => $path_tree['include_name'], - 'handler' => $path_tree['handler'], - 'methods' => $path_tree['methods'], - ); - } - else { - foreach ($path_parts as $path_part) { - if (array_key_exists($path_part, $path_tree['paths'])) { - $path_tree = &$path_tree['paths'][$path_part]; - $depth_current++; - } - elseif (array_key_exists('%', $path_tree['paths'])) { - $path_tree = &$path_tree['paths']['%']; - $depth_current++; - } - else { - break; - } - - if ($depth_current == $depth_total) { - $found = array( - 'include_directory' => $path_tree['include_directory'], - 'include_name' => $path_tree['include_name'], - 'handler' => $path_tree['handler'], - 'methods' => $path_tree['methods'], - ); - break; - } - } - } - } - unset($path_part); - unset($path_parts); - unset($depth_current); - unset($depth_total); - unset($path_tree); - - if (is_array($found) && !is_null($found['handler'])) { - return c_base_return_array::s_new($found); - } - unset($found); - - return new c_base_return_null(); - } -} diff --git a/common/base/classes/base_paths.php b/common/base/classes/base_paths.php new file mode 100644 index 0000000..e15b81c --- /dev/null +++ b/common/base/classes/base_paths.php @@ -0,0 +1,367 @@ +paths = array(); + $this->root = NULL; + } + + /** + * Class destructor. + */ + public function __destruct() { + unset($this->paths); + unset($this->root); + + parent::__destruct(); + } + + /** + * @see: t_base_return_value::p_s_new() + */ + public static function s_new($value) { + return self::p_s_new($value, __CLASS__); + } + + /** + * @see: t_base_return_value::p_s_value() + */ + public static function s_value($return) { + return self::p_s_value($return, __CLASS__); + } + + /** + * @see: t_base_return_value_exact::p_s_value_exact() + */ + public static function s_value_exact($return) { + return self::p_s_value_exact($return, __CLASS__, array()); + } + + /** + * Assign a specific path handler. + * + * Duplicate paths overwrite previous paths. + * + * @todo: should redirect and alias booleans be added as parameters? + * + * @pram string $directory + * The first part of the file path + * @pram string $path + * The url path in which the handler applies to. + * @param string $handler + * The name of an implementation of c_base_path. + * @param string|null $directory + * (optional) The prefix path (relative to the PHP includes) to include that contains the requested path. + * When not NULL, both $directory and $name must not be NULL. + * @param string|null $name + * (optional) The suffix path (relative to the PHP includes) to include that contains the requested path. + * When not NULL, both $directory and $name must not be NULL. + * @param array|null $allowed_methods + * (optional) An array of ids of allowed methods. + * When NULL, this value is ignored. + * + * @return c_base_return_status + * TRUE is returned on success. + * FALSE with error bit set is returned on error. + */ + public function add_path($path, $handler, $include_directory = NULL, $include_name = NULL, $allowed_methods = NULL) { + if (!is_string($path)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_false($error); + } + + if (!is_string($handler)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'handler', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_false($error); + } + + if ((!is_null($include_directory) || (is_null($include_directory) && !is_null($include_name))) && !is_string($include_directory)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'include_directory', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_false($error); + } + + if ((!is_null($include_name) || (is_null($include_name) && !is_null($include_directory))) && !is_string($include_name)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'include_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_false($error); + } + + + // get allowed methods + $path_object = new c_base_path(); + if (is_null($allowed_methods)) { + $methods = $path_object->get_allowed_methods()->get_value_exact(); + if (!is_array($methods)) { + $methods = array(); + } + } + else { + $methods = $allowed_methods; + } + + + if (mb_strlen($path) == 0) { + unset($path_object); + $this->root = array('handler' => $handler, 'include_directory' => $include_directory, 'include_name' => $include_name, 'is_root' => TRUE, 'methods' => $methods); + return new c_base_return_true(); + } + + if (!is_null($allowed_methods) && !is_array($allowed_methods)) { + unset($path_object); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'allowed_methods', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_false($error); + } + + $valid_path = $path_object->set_value($path); + if (!$valid_path) { + unset($path_object); + unset($valid_path); + + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_false($error); + } + unset($valid_path); + + $path_string = $path_object->get_value_exact(); + unset($path_object); + + // assign each path part to the path + $path_parts = explode('/', $path_string); + unset($path_string); + + + // load the path group, if available. + $id_group = 0; + if (mb_strlen($path_parts[0]) == 1) { + $ordinal = ord($path_parts[0]); + if (in_array($ordinal, c_base_defaults_global::RESERVED_PATH_GROUP)) { + $id_group = $ordinal; + } + unset($ordinal); + unset($path_parts[0]); + } + + if (!is_array($this->paths)) { + $this->paths = array(); + } + + if (!array_key_exists($id_group, $this->paths)) { + $this->paths[$id_group] = array(); + } + + $path_tree = &$this->paths[$id_group]; + + $depth_current = 1; + $depth_total = count($path_parts); + + // make sure the first path exists. + $path_part = array_shift($path_parts); + if (!array_key_exists($path_part, $path_tree)) { + $path_tree[$path_part] = array( + 'paths' => array(), + 'include_directory' => NULL, + 'include_name' => NULL, + 'handler' => NULL, + 'methods' => array(), + ); + } + + $path_tree = &$path_tree[$path_part]; + if ($depth_current == $depth_total) { + $path_tree['include_directory'] = $include_directory; + $path_tree['include_name'] = $include_name; + $path_tree['handler'] = $handler; + $path_tree['methods'] = $methods; + } + else { + foreach ($path_parts as $path_part) { + if (!isset($path_tree['paths'][$path_part])) { + $path_tree['paths'][$path_part] = array( + 'paths' => array(), + 'include_directory' => NULL, + 'include_name' => NULL, + 'handler' => NULL, + 'methods' => array(), + ); + } + + $path_tree = &$path_tree['paths'][$path_part]; + $depth_current++; + + if ($depth_current == $depth_total) { + $path_tree['include_directory'] = $include_directory; + $path_tree['include_name'] = $include_name; + $path_tree['handler'] = $handler; + $path_tree['methods'] = $methods; + break; + } + } + } + unset($path_part); + unset($path_parts); + unset($depth_current); + unset($depth_total); + + return new c_base_return_true(); + } + + /** + * Gets a path object for the specified path. + * + * @param string|null $path_string + * The URL path without any path arguments. + * This does not accept wildcards. + * Set to NULL or an empty string for the root path. + * + * @return c_base_return_array|c_base_return_int|c_base_return_null + * An array containing: + * - 'include_directory': the prefix path of the file to include that contains the handler class implementation. + * - 'include_name': the suffix path of the file to include that contains the handler class implementation. + * - 'handler': the name of the handler class. + * - 'redirect': if specified, then a redirect path (instead of include/handler). + * - 'code': if redirect is specified, then the http response code associated with the redirect. + * Wildcards are matched after all non-wildcards. + * NULL is returned if not found. + * FALSE with error bit set is returned on error. + * + * @see: self::set_login() + * @see: self::process_path() + */ + public function find_path($path_string) { + if (!is_null($path_string) && !is_string($path_string)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'path_string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_false($error); + } + + if (is_null($path_string) || mb_strlen($path_string) == 0) { + if (is_array($this->root)) { + return c_base_return_array::s_new($this->root); + } + + return new c_base_return_null(); + } + + + // sanitize the url path. + $path = new c_base_path(); + if (!$path->set_value($path_string)) { + unset($path); + + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'path_string', ':{expected_format}' => 'Valid URL path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + return c_base_return_error::s_false($error); + } + + $sanitized = $path->get_value_exact(); + unset($path); + + // if the sanitized path is different from the original, then send a url redirect. + if (strcmp($path_string, $sanitized) != 0 && $path_string != '/' . $sanitized) { + return c_base_return_array::s_new(array('redirect' => $sanitized, 'code' => c_base_http_status::MOVED_PERMANENTLY)); + } + + $path_parts = explode('/', $sanitized); + unset($sanitized); + + + // load the path group, if available. + $id_group = 0; + if (mb_strlen($path_parts[0]) == 1) { + $ordinal = ord($path_parts[0]); + if (in_array($ordinal, c_base_defaults_global::RESERVED_PATH_GROUP)) { + $id_group = $ordinal; + } + unset($ordinal); + unset($path_parts[0]); + } + + + $depth_current = 1; + $depth_total = count($path_parts); + $found = NULL; + $path_tree = &$this->paths[$id_group]; + + // @fixme: the current design needs to handle multiple possible wildcard paths when searching (such as '/a/b/c/%', '/a/%/c', where '/a/b/c/%' would prevent '/a/%/c' from ever matching). + $path_part = array_shift($path_parts); + if (is_array($path_tree) && (array_key_exists($path_part, $path_tree) || array_key_exists('%', $path_tree))) { + if (array_key_exists($path_part, $path_tree)) { + $path_tree = &$path_tree[$path_part]; + } + else { + $path_tree = &$path_tree['%']; + } + + if ($depth_current == $depth_total) { + $found = array( + 'include_directory' => $path_tree['include_directory'], + 'include_name' => $path_tree['include_name'], + 'handler' => $path_tree['handler'], + 'methods' => $path_tree['methods'], + 'id_group' => $id_group, + ); + } + else { + foreach ($path_parts as $path_part) { + if (array_key_exists($path_part, $path_tree['paths'])) { + $path_tree = &$path_tree['paths'][$path_part]; + $depth_current++; + } + elseif (array_key_exists('%', $path_tree['paths'])) { + $path_tree = &$path_tree['paths']['%']; + $depth_current++; + } + else { + break; + } + + if ($depth_current == $depth_total) { + $found = array( + 'include_directory' => $path_tree['include_directory'], + 'include_name' => $path_tree['include_name'], + 'handler' => $path_tree['handler'], + 'methods' => $path_tree['methods'], + 'id_group' => $id_group, + ); + break; + } + } + } + } + unset($path_part); + unset($path_parts); + unset($depth_current); + unset($depth_total); + unset($path_tree); + + if (is_array($found) && !is_null($found['handler'])) { + return c_base_return_array::s_new($found); + } + unset($found); + + return new c_base_return_null(); + } +} diff --git a/common/base/classes/base_return.php b/common/base/classes/base_return.php index 630867a..c6a0886 100644 --- a/common/base/classes/base_return.php +++ b/common/base/classes/base_return.php @@ -17,8 +17,6 @@ * Functions defined in this class will return the normal TRUE/FALSE and not the class-based TRUE/FALSE as an exception to this rule. * - This is done because this class defines those objects. */ - -// include required files. require_once('common/base/classes/base_error.php'); /** @@ -275,6 +273,31 @@ class c_base_return { } /** + * Copy errors from one return type to another. + * + * Invalid parameters are silently ignored and no actions are performed. + * + * @param c_base_return $source + * The return value to copy errors from. + * @param c_base_return &$destination + * The return value to copy errors to. + */ + public static function s_copy_errors($source, &$destination) { + if (!($source instanceof c_base_return) || !($destination instanceof c_base_return)) { + return; + } + + $errors = $source->get_error()->get_value_exact(); + if (is_array($errors)) { + foreach ($errors as $error) { + $destination->set_error($error); + } + unset($error); + } + unset($errors); + } + + /** * Assign the error code. * * @param null|c_base_error $error diff --git a/common/base/classes/base_rfc_char.php b/common/base/classes/base_rfc_char.php index 122e578..df672db 100644 --- a/common/base/classes/base_rfc_char.php +++ b/common/base/classes/base_rfc_char.php @@ -3,8 +3,6 @@ * @file * Provides a class for managing common rfc character testing cases. */ - -// include required files. require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_ascii.php'); require_once('common/base/classes/base_utf8.php'); diff --git a/common/base/classes/base_rfc_string.php b/common/base/classes/base_rfc_string.php index ee7fe22..9bbe479 100644 --- a/common/base/classes/base_rfc_string.php +++ b/common/base/classes/base_rfc_string.php @@ -3,8 +3,7 @@ * @file * Provides a class for managing common rfc string testing cases. */ - -// include required files. +require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_ascii.php'); require_once('common/base/classes/base_utf8.php'); require_once('common/base/classes/base_rfc_char.php'); diff --git a/common/base/classes/base_roles.php b/common/base/classes/base_roles.php new file mode 100644 index 0000000..76b160f --- /dev/null +++ b/common/base/classes/base_roles.php @@ -0,0 +1,453 @@ +public = TRUE; + $this->system = FALSE; + $this->user = FALSE; + $this->requester = FALSE; + $this->drafter = FALSE; + $this->editer = FALSE; + $this->reviewer = FALSE; + $this->insurer = FALSE; + $this->financer = FALSE; + $this->publisher = FALSE; + $this->auditor = FALSE; + $this->manager = FALSE; + $this->administer = FALSE; + } + + /** + * Class destructor. + */ + public function __destruct() { + unset($this->public); + unset($this->system); + unset($this->user); + unset($this->requester); + unset($this->drafter); + unset($this->editer); + unset($this->reviewer); + unset($this->insurer); + unset($this->financer); + unset($this->publisher); + unset($this->auditor); + unset($this->manager); + unset($this->administer); + + parent::__destruct(); + } + + /** + * @see: t_base_return_value::p_s_new() + */ + public static function s_new($value) { + return self::p_s_new($value, __CLASS__); + } + + /** + * @see: t_base_return_value::p_s_value() + */ + public static function s_value($return) { + return self::p_s_value($return, __CLASS__); + } + + /** + * @see: t_base_return_value_exact::p_s_value_exact() + */ + public static function s_value_exact($return) { + return self::p_s_value_exact($return, __CLASS__, array()); + } + + /** + * Assign a role. + * + * When role is set to NONE, and value is TRUE, then all roles are set to FALSE. + * When role is set to NONE and value is FALSE, nothing happens. + * + * @param int $role + * The role id to assign. + * @param bool $value + * Set the role value to TRUE/FALSE. + * + * @return c_base_return_status + * TRUE on success, FALSE otherwise. + * FALSE with error bit set is returned on error. + */ + public function set_role($role, $value) { + if (!is_int($role)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'role', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_false($error); + } + + if (!is_bool($value)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_false($error); + } + + if ($role === self::NONE) { + if ($value) { + $this->public = FALSE; + $this->system = FALSE; + $this->user = FALSE; + $this->requester = FALSE; + $this->drafter = FALSE; + $this->editer = FALSE; + $this->reviewer = FALSE; + $this->insurer = FALSE; + $this->financer = FALSE; + $this->publisher = FALSE; + $this->auditor = FALSE; + $this->manager = FALSE; + $this->administer = FALSE; + } + } + elseif ($role === self::PUBLIC) { + $this->public = $value; + } + elseif ($role === self::SYSTEM) { + $this->system = $value; + } + elseif ($role === self::USER) { + $this->user = $value; + } + elseif ($role === self::REQUESTER) { + $this->requester = $value; + } + elseif ($role === self::DRAFTER) { + $this->drafter = $value; + } + elseif ($role === self::EDITOR) { + $this->editer = $value; + } + elseif ($role === self::REVIEWER) { + $this->reviewer = $value; + } + elseif ($role === self::INSURER) { + $this->insurer = $value; + } + elseif ($role === self::FINANCER) { + $this->financer = $value; + } + elseif ($role === self::PUBLISHER) { + $this->publisher = $value; + } + elseif ($role === self::AUDITOR) { + $this->auditor = $value; + } + elseif ($role === self::MANAGER) { + $this->manager = $value; + } + elseif ($role === self::ADMINISTER) { + $this->administer = $value; + } + else { + return new c_base_return_false(); + } + + return new c_base_return_true(); + } + + /** + * Assign multiple roles. + * + * This unassigns all roles and assigns only the provided roles. + * + * @param array $roles + * An array of role ids to set to TRUE. + * All others are set to FALSE, including PUBLIC. + * + * @return c_base_return_status + * TRUE on success, FALSE otherwise. + * FALSE with error bit set is returned on error. + */ + public function set_roles($roles) { + if (!is_array($roles)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'roles', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_false($error); + } + + $this->public = FALSE; + $this->system = FALSE; + $this->user = FALSE; + $this->requester = FALSE; + $this->drafter = FALSE; + $this->editer = FALSE; + $this->reviewer = FALSE; + $this->insurer = FALSE; + $this->financer = FALSE; + $this->publisher = FALSE; + $this->auditor = FALSE; + $this->manager = FALSE; + $this->administer = FALSE; + + foreach ($roles as $role) { + if ($role === self::PUBLIC) { + $this->public = TRUE; + } + elseif ($role === self::SYSTEM) { + $this->system = TRUE; + } + elseif ($role === self::USER) { + $this->user = TRUE; + } + elseif ($role === self::REQUESTER) { + $this->requester = TRUE; + } + elseif ($role === self::DRAFTER) { + $this->drafter = TRUE; + } + elseif ($role === self::EDITOR) { + $this->editer = TRUE; + } + elseif ($role === self::REVIEWER) { + $this->reviewer = TRUE; + } + elseif ($role === self::INSURER) { + $this->insurer = TRUE; + } + elseif ($role === self::FINANCER) { + $this->financer = TRUE; + } + elseif ($role === self::PUBLISHER) { + $this->publisher = TRUE; + } + elseif ($role === self::AUDITOR) { + $this->auditor = TRUE; + } + elseif ($role === self::MANAGER) { + $this->manager = TRUE; + } + elseif ($role === self::ADMINISTER) { + $this->administer = TRUE; + } + } + unset($role); + + return new c_base_return_true(); + } + + /** + * Get the current status of the specified role. + * + * When role is set to NONE, TRUE is returned when all values are set to FALSE. + * When role is set to NONE, FALSE is returned when any values are set to TRUE. + * + * @param int $role + * The role id to get the value of. + * + * @return c_base_return_status + * TRUE on enabled, FALSE on disabled. + * FALSE is returned for unknown role ids. + * FALSE with error bit set is returned on error. + */ + public function get_role($role) { + if (!is_int($role)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'role', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_false($error); + } + + if ($role === self::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) { + if ($this->public) { + return new c_base_return_true(); + } + } + elseif ($role === self::SYSTEM) { + if ($this->system) { + return new c_base_return_true(); + } + } + elseif ($role === self::USER) { + if ($this->user) { + return new c_base_return_true(); + } + } + elseif ($role === self::REQUESTER) { + if ($this->requester) { + return new c_base_return_true(); + } + } + elseif ($role === self::DRAFTER) { + if ($this->drafter) { + return new c_base_return_true(); + } + } + elseif ($role === self::EDITOR) { + if ($this->editer) { + return new c_base_return_true(); + } + } + elseif ($role === self::REVIEWER) { + if ($this->reviewer) { + return new c_base_return_true(); + } + } + elseif ($role === self::FINANCER) { + if ($this->financer) { + return new c_base_return_true(); + } + } + elseif ($role === self::INSURER) { + if ($this->insurer) { + return new c_base_return_true(); + } + } + elseif ($role === self::PUBLISHER) { + if ($this->publisher) { + return new c_base_return_true(); + } + } + elseif ($role === self::AUDITOR) { + if ($this->auditor) { + return new c_base_return_true(); + } + } + elseif ($role === self::MANAGER) { + if ($this->manager) { + return new c_base_return_true(); + } + } + elseif ($role === self::ADMINISTER) { + if ($this->administer) { + return new c_base_return_true(); + } + } + + return new c_base_return_false(); + } + + /** + * Get an array of all currently assigned roles. + * + * @return c_base_return_array + * An array of roles are returned. + * An array with error bit set is returned on error. + */ + public function get_roles() { + $roles = array(); + + if ($this->public) { + $roles[self::PUBLIC] = self::PUBLIC; + } + + if ($this->system) { + $roles[self::SYSTEM] = self::SYSTEM; + } + + if ($this->user) { + $roles[self::USER] = self::USER; + } + + if ($this->requester) { + $roles[self::REQUESTER] = self::REQUESTER; + } + + if ($this->drafter) { + $roles[self::DRAFTER] = self::DRAFTER; + } + + if ($this->editer) { + $roles[self::EDITOR] = self::EDITOR; + } + + if ($this->reviewer) { + $roles[self::REVIEWER] = self::REVIEWER; + } + + if ($this->financer) { + $roles[self::FINANCER] = self::FINANCER; + } + + if ($this->insurer) { + $roles[self::INSURER] = self::INSURER; + } + + if ($this->publisher) { + $roles[self::PUBLISHER] = self::PUBLISHER; + } + + if ($this->auditor) { + $roles[self::AUDITOR] = self::AUDITOR; + } + + if ($this->manager) { + $roles[self::MANAGER] = self::MANAGER; + } + + if ($this->administer) { + $roles[self::ADMINISTER] = self::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 8e318d4..aa8f044 100644 --- a/common/base/classes/base_session.php +++ b/common/base/classes/base_session.php @@ -3,8 +3,6 @@ * @file * Provides a class for managing sessions. */ - -// include required files. require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_form.php'); @@ -19,32 +17,44 @@ require_once('common/base/classes/base_form.php'); */ class c_base_session extends c_base_return { const PACKET_MAX_LENGTH = 8192; + const SOCKET_PATH_PREFIX = '/programs/sockets/sessionize_accounts/'; const SOCKET_PATH_SUFFIX = '/sessions.socket'; + const PASSWORD_CLEAR_TEXT_LENGTH = 2048; - private $socket; - private $socket_directory; - private $socket_path; - private $socket_timeout; - private $socket_error; + // @todo: currently not implemented, but added as concepts. + #const SESSION_TYPE_NONE = 0; + #const SESSION_TYPE_SESSIONIZE = 1; // currently implemented behavior. + #const SESSION_TYPE_PHP = 2; + #const SESSION_TYPE_DATABASE = 3; + + protected $socket; + protected $socket_directory; + protected $socket_path; + protected $socket_timeout; + protected $socket_error; - private $system_name; + protected $system_name; - private $cookie; + protected $cookie; - private $name; - private $host; - private $password; - private $session_id; - private $settings; + protected $name; + protected $host; + protected $password; + protected $session_id; + protected $settings; - private $timeout_expire; - private $timeout_max; + protected $timeout_expire; + protected $timeout_max; - private $problems; + protected $problems; - private $logged_in; + protected $user_current; + protected $user_session; + + protected $logged_in; + protected $expired; /** @@ -74,7 +84,11 @@ class c_base_session extends c_base_return { $this->problems = NULL; + $this->user_current = NULL; + $this->user_session = NULL; + $this->logged_in = FALSE; + $this->expired = FALSE; } /** @@ -109,7 +123,11 @@ class c_base_session extends c_base_return { unset($this->problems); + unset($this->user_current); + unset($this->user_session); + unset($this->logged_in); + unset($this->expired); parent::__destruct(); } @@ -150,7 +168,7 @@ class c_base_session extends c_base_return { */ public function set_socket_directory($socket_directory) { if (!is_null($socket_directory) && (!is_string($socket_directory) || empty($socket_directory))) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'socket_directory', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'socket_directory', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -160,7 +178,7 @@ class c_base_session extends c_base_return { } if (!is_dir($socket_directory)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':directory_name' => $socket_directory, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_DIRECTORY); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{directory_name}' => $socket_directory, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_DIRECTORY); return c_base_return_error::s_false($error); } @@ -189,7 +207,7 @@ class c_base_session extends c_base_return { */ public function set_cookie($cookie) { if (!is_null($cookie) && !($cookie instanceof c_base_cookie)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'cookie', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'cookie', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -211,7 +229,7 @@ class c_base_session extends c_base_return { */ public function set_system_name($system_name) { if (!is_null($system_name) && (!is_string($system_name) || empty($system_name))) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'system_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'system_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -239,7 +257,7 @@ class c_base_session extends c_base_return { */ public function set_name($name) { if (!is_null($name) && (!is_string($name) || empty($name))) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -249,7 +267,7 @@ class c_base_session extends c_base_return { } if (mb_strlen($name) == 0 || preg_match('/^(\w|-)+$/i', $name) != 1) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':format_name' => 'name', ':expected_format' => '. Alphanumeric and dash characters only', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{format_name}' => 'name', ':{expected_format}' => '. Alphanumeric and dash characters only', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_FORMAT); return c_base_return_error::s_false($error); } @@ -270,7 +288,7 @@ class c_base_session extends c_base_return { */ public function set_host($host) { if (!is_null($host) && (!is_string($host) || empty($host))) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'host', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -280,7 +298,7 @@ class c_base_session extends c_base_return { } if (mb_strlen($host) == 0 || ip2long($host) === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'host', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -306,7 +324,7 @@ class c_base_session extends c_base_return { */ public function set_password($password) { if (!is_null($password) && (!is_string($password) || empty($password))) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'password', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'password', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -317,7 +335,7 @@ class c_base_session extends c_base_return { // deny 0-length passwords. if (mb_strlen($password) == 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'password', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'password', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -340,7 +358,7 @@ class c_base_session extends c_base_return { */ public function set_setting($delta, $setting) { if (!is_int($delta) && !is_string($delta)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'delta', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -367,7 +385,7 @@ class c_base_session extends c_base_return { */ public function set_settings($settings) { if (!is_null($settings) && !is_array($settings)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'settings', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'settings', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -393,7 +411,7 @@ class c_base_session extends c_base_return { */ public function set_session_id($session_id) { if (!is_null($session_id) && (!is_string($session_id) || empty($session_id))) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'session_id', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'session_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -404,7 +422,7 @@ class c_base_session extends c_base_return { // deny 0-length session_id. if (mb_strlen($session_id) == 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'session_id', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'session_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -427,7 +445,7 @@ class c_base_session extends c_base_return { */ public function set_timeout_expire($timeout_expire) { if (!is_null($timeout_expire) && !is_int($timeout_expire)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'timeout_expire', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timeout_expire', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -450,7 +468,7 @@ class c_base_session extends c_base_return { */ public function set_timeout_max($timeout_max) { if (!is_null($timeout_max) && !is_int($timeout_max)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'timeout_max', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'timeout_max', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -471,7 +489,7 @@ class c_base_session extends c_base_return { */ public function set_problems($problems) { if (!is_null($problems) && !is_array($problems)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'problems', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'problems', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -512,17 +530,17 @@ class c_base_session extends c_base_return { */ public function set_socket_timeout($seconds, $microseconds = 0, $receive = TRUE) { if (!is_null($seconds) && (!is_int($seconds) || $seconds < 0)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'seconds', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'seconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($microseconds) || $microseconds < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'microseconds', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'microseconds', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_bool($receive)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'receive', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'receive', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -546,7 +564,7 @@ class c_base_session extends c_base_return { unset($result); $this->socket_error = @socket_last_error($this->socket); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'socket_set_option', ':socket_error' => $this->socket_error, ':socket_error_message' => @socket_strerror($this->socket_error), ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_set_option', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); return c_base_return_error::s_false($error); } unset($result); @@ -560,7 +578,7 @@ class c_base_session extends c_base_return { unset($result); $this->socket_error = @socket_last_error($this->socket); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'socket_set_option', ':socket_error' => $this->socket_error, ':socket_error_message' => @socket_strerror($this->socket_error), ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_set_option', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); return c_base_return_error::s_false($error); } unset($result); @@ -571,25 +589,56 @@ class c_base_session extends c_base_return { } /** - * Assigns the logged in session status. + * Assigns the current user object. * - * @param bool $logged_in - * Set to TRUE to designate logged in. - * Set to FALSE to designate logged out. + * @param c_base_users_user|null $user + * The current user object (generally populated from the database). + * If NULL, then the user object is removed. * * @return c_base_return_status * TRUE on success, FALSE otherwise. * FALSE with the error bit set is returned on error. + */ + public function set_user_current($user) { + if (!is_null($user) && !($user instanceof c_base_users_user)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'user', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_false($error); + } + + if (is_object($user)) { + $this->user_current = clone($user); + } + else { + $this->user_current = NULL; + } + + return new c_base_return_true(); + } + + /** + * Assigns the current user object. * - * @see: c_base_session::save() + * @param c_base_users_user|null $user + * The current user object (generally populated from the database). + * If NULL, then the user object is removed. + * + * @return c_base_return_status + * TRUE on success, FALSE otherwise. + * FALSE with the error bit set is returned on error. */ - public function set_logged_in($logged_in) { - if (!is_bool($logged_in)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'logged_in', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + public function set_user_session($user) { + if (!is_null($user) && !($user instanceof c_base_users_user)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'user', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } - $this->logged_in = $logged_in; + if (is_object($user)) { + $this->user_session = clone($user); + } + else { + $this->user_session = NULL; + } + return new c_base_return_true(); } @@ -710,7 +759,7 @@ class c_base_session extends c_base_return { */ public function get_setting($delta) { if (!is_int($delta) && !is_string($delta)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'delta', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'delta', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -719,7 +768,7 @@ class c_base_session extends c_base_return { } if (!array_key_exists($delta, $this->settings)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':index_name' => $delta, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); + $error = c_base_error::s_log(NULL, array('arguments' => array(':index_name' => $delta, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_ARRAY_INDEX); return c_base_return_error::s_false($error); } @@ -843,19 +892,115 @@ class c_base_session extends c_base_return { } /** - * Get the logged in status of the session. + * Get the current user object * - * @return c_base_return_status - * TRUE if logged in. - * FALSE if logged out. + * @return c_base_users_user|c_base_return_null + * The user object is returned on success. + * NULL is returned if there is no user object assigned. + * The error bit set is returned on error. + */ + public function get_user_current() { + if (is_object($this->user_current)) { + return clone($this->user_current); + } + + return new c_base_return_null(); + } + + /** + * Get the session user object + * + * @return c_base_users_user|c_base_return_null + * The user object is returned on success. + * NULL is returned if there is no user object assigned. * The error bit set is returned on error. */ - public function get_logged_in() { - if (!is_bool($this->logged_in)) { - $this->logged_in = FALSE; + public function get_user_session() { + if (is_object($this->user_session)) { + return clone($this->user_session); } - if ($this->logged_in) { + return new c_base_return_null(); + } + + /** + * Get or Assign the is logged_in boolean setting. + * + * @param bool|null $is_logged_in + * When a boolean, this is assigned as the current is logged_in setting. + * When NULL, the current setting is returned. + * + * @return c_base_return_bool|c_base_return_status + * When $is_logged_in is NULL, is logged_in boolean setting on success. + * FALSE with error bit is set on error. + */ + public function is_logged_in($is_logged_in = NULL) { + if (!is_null($is_logged_in) && !is_bool($is_logged_in)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_logged_in', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_false($error); + } + + if (is_null($is_logged_in)) { + if (!is_bool($this->logged_in)) { + $this->logged_in = FALSE; + } + + if ($this->logged_in) { + return new c_base_return_true(); + } + + return new c_base_return_false(); + } + + $this->logged_in = $is_logged_in; + return new c_base_return_true(); + } + + /** + * Get or Assign the is expired boolean setting. + * + * @param bool|null $is_expired + * When a boolean, this is assigned as the current is expired setting. + * When NULL, the current setting is returned. + * + * @return c_base_return_bool|c_base_return_status + * When $is_expired is NULL, is expired boolean setting on success. + * FALSE with error bit is set on error. + */ + public function is_expired($is_expired = NULL) { + if (!is_null($is_expired) && !is_bool($is_expired)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'is_expired', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_false($error); + } + + if (is_null($is_expired)) { + if (!is_bool($this->expired)) { + $this->expired = FALSE; + } + + if ($this->expired) { + return new c_base_return_true(); + } + + return new c_base_return_false(); + } + + $this->expired = $is_expired; + return new c_base_return_true(); + } + + /** + * Returns the connected status. + * + * This represents whether or not the self::do_connect() function was successfully called. + * The state of the connection should still be checked. + * + * @return c_base_return_status + * TRUE when connected, FALSE otherwise. + * FALSE with the error bit set is returned on error. + */ + public function is_connected() { + if (is_resource($this->socket)) { return new c_base_return_true(); } @@ -876,12 +1021,12 @@ class c_base_session extends c_base_return { */ function do_connect() { if (is_resource($this->socket)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->socket', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (is_null($this->system_name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->system_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->system_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -893,7 +1038,7 @@ class c_base_session extends c_base_return { @socket_clear_error(); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'socket_create', ':socket_error' => $this->socket_error, ':socket_error_message' => @socket_strerror($this->socket_error), ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_create', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); return c_base_return_error::s_false($error); } @@ -906,7 +1051,7 @@ class c_base_session extends c_base_return { $this->do_disconnect(); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'socket_connect', ':socket_error' => $this->socket_error, ':socket_error_message' => @socket_strerror($this->socket_error), ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_connect', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); return c_base_return_error::s_false($error); } unset($connected); @@ -933,7 +1078,7 @@ class c_base_session extends c_base_return { */ public function do_disconnect() { if (!is_resource($this->socket)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->socket', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -944,24 +1089,6 @@ class c_base_session extends c_base_return { } /** - * Returns the connected status. - * - * This represents whether or not the self::do_connect() function was successfully called. - * The state of the connection should still be checked. - * - * @return c_base_return_status - * TRUE when connected, FALSE otherwise. - * FALSE with the error bit set is returned on error. - */ - public function is_connected() { - if (is_resource($this->socket)) { - return new c_base_return_true(); - } - - return new c_base_return_false(); - } - - /** * Loads the session information from an open socket. * * @return c_base_return_status @@ -973,17 +1100,17 @@ class c_base_session extends c_base_return { */ public function do_pull() { if (is_null($this->host)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->host', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (is_null($this->session_id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->session_id', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->session_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (!is_resource($this->socket)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->socket', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -996,7 +1123,7 @@ class c_base_session extends c_base_return { if (empty($response['result']) || !is_array($response['result'])) { unset($response); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->p_transfer', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_transfer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1056,32 +1183,32 @@ class c_base_session extends c_base_return { */ public function do_push($interval_expire = NULL, $interval_max = NULL) { if (is_null($this->name)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (is_null($this->host)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->host', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (is_null($this->password)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->password', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->password', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (!is_resource($this->socket)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->socket', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (!is_null($interval_expire) && (!is_int($interval_expire) || $interval_expire < 1)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'interval_expires', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'interval_expires', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($interval_max) && (!is_int($interval_max) || $interval_max < 1)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'interval_max', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'interval_max', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -1097,7 +1224,7 @@ class c_base_session extends c_base_return { $response = c_base_return_array::s_value_exact($response); if (isset($response['error']) && isset($response['error']['message']) && is_string($response['error']['message'])) { - $error = c_base_error::s_log(' ' . $response['error']['message'], array('arguments' => array(':operation_name' => 'this->p_transfer', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(' ' . $response['error']['message'], array('arguments' => array(':{operation_name}' => 'this->p_transfer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); unset($response); return c_base_return_error::s_false($error); @@ -1105,7 +1232,7 @@ class c_base_session extends c_base_return { elseif (empty($response['result']) || !is_array($response['result'])) { unset($response); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->p_transfer', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_transfer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1145,17 +1272,17 @@ class c_base_session extends c_base_return { */ public function do_terminate() { if (is_null($this->host)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->host', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->host', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (is_null($this->session_id)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->session_id', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->session_id', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } if (!is_resource($this->socket)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->socket', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -1168,7 +1295,7 @@ class c_base_session extends c_base_return { if (empty($response['result']) || !is_array($response['result'])) { unset($response); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->p_transfer', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_transfer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1186,23 +1313,15 @@ class c_base_session extends c_base_return { } /** - * Closes (terminates) a session from an open socket. - * - * Unlike self::do_disconnect(), this does not close the connection to the socket, it closes the session itself. - * - * This is used to terminate a session before the expiration date and time is reached. - * Use this on logout operations. + * Send a flush command to the connected session. * * @return c_base_return_status * TRUE on success, FALSE on failure. * FALSE with the error bit set is returned on error. - * - * @see: self::do_connect() - * @see: self::p_transfer() */ public function do_flush() { if (!is_resource($this->socket)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':variable_name' => 'this->socket', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{variable_name}' => 'this->socket', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_VARIABLE); return c_base_return_error::s_false($error); } @@ -1215,7 +1334,7 @@ class c_base_session extends c_base_return { if (empty($response['result']) || !is_array($response['result'])) { unset($response); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->p_transfer', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_transfer', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -1248,13 +1367,13 @@ class c_base_session extends c_base_return { $this->socket_error = @socket_last_error($this->socket); @socket_clear_error($this->socket); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'socket_write', ':socket_error' => $this->socket_error, ':socket_error_message' => @socket_strerror($this->socket_error), ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_write', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); return c_base_return_error::s_false($error); } elseif ($written == 0) { unset($written); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'socket_write', ':socket_error' => NULL, ':socket_error_message' => 'No bytes written.', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_write', ':{socket_error}' => NULL, ':{socket_error_message}' => 'No bytes written.', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); return c_base_return_error::s_false($error); } unset($written); @@ -1266,7 +1385,7 @@ class c_base_session extends c_base_return { $this->socket_error = @socket_last_error($this->socket); @socket_clear_error($this->socket); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'socket_read', ':socket_error' => $this->socket_error, ':socket_error_message' => @socket_strerror($this->socket_error), ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'socket_read', ':{socket_error}' => $this->socket_error, ':{socket_error_message}' => @socket_strerror($this->socket_error), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::SOCKET_FAILURE); return c_base_return_error::s_false($error); } @@ -1274,7 +1393,7 @@ class c_base_session extends c_base_return { unset($json); if ($response === FALSE) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'json_decode', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'json_decode', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_users.php b/common/base/classes/base_users.php new file mode 100644 index 0000000..4591632 --- /dev/null +++ b/common/base/classes/base_users.php @@ -0,0 +1,167 @@ +value. + */ +class c_base_users_user extends c_base_return_array { + protected $id; + protected $id_external; + protected $id_sort; + + protected $name_machine; + protected $name_human; + + protected $address_email; + + protected $roles; + + protected $is_private; + protected $is_locked; + protected $is_deleted; + + protected $can_manage_roles; + + protected $date_created; + protected $date_changed; + protected $date_synced; + protected $date_locked; + protected $date_deleted; + + /** + * Class constructor. + */ + public function __construct() { + parent::__construct(); + + $this->id = NULL; + $this->id_external = NULL; + $this->id_sort = NULL; + + $this->name_machine = NULL; + $this->name_human = NULL; + + $this->address_email = NULL; + + $this->roles = new c_base_roles(); + + $this->is_private = NULL; + $this->is_locked = NULL; + $this->is_deleted = NULL; + + $this->can_manage_roles = NULL; + + $this->date_created = NULL; + $this->date_changed = NULL; + $this->date_synced = NULL; + $this->date_locked = NULL; + $this->date_deleted = NULL; + } + + /** + * Class destructor. + */ + public function __destruct() { + unset($this->id); + unset($this->id_external); + unset($this->id_sort); + + unset($this->name_machine); + unset($this->name_human); + + unset($this->address_email); + + unset($this->roles); + + unset($this->is_private); + unset($this->is_locked); + unset($this->is_deleted); + + unset($this->can_manage_roles); + + unset($this->date_created); + unset($this->date_changed); + unset($this->date_synced); + unset($this->date_locked); + unset($this->date_deleted); + + parent::__destruct(); + } + + /** + * @see: t_base_return_value::p_s_new() + */ + public static function s_new($value) { + return self::p_s_new($value, __CLASS__); + } + + /** + * @see: t_base_return_value::p_s_value() + */ + public static function s_value($return) { + return self::p_s_value($return, __CLASS__); + } + + /** + * @see: t_base_return_value_exact::p_s_value_exact() + */ + public static function s_value_exact($return) { + return self::p_s_value_exact($return, __CLASS__, array()); + } + + /** + * Wrapper to c_base_roles::set_role() + * + * @see: c_base_roles::set_role() + */ + public function set_role($role, $value) { + return $this->roles->set_role($role, $value); + } + + /** + * Wrapper to c_base_roles::get_role() + * + * @see: c_base_roles::get_role() + */ + public function get_role($role) { + return $this->roles->get_role($role); + } + + /** + * Wrapper to c_base_roles::get_roles() + * + * @see: c_base_roles::get_roles() + */ + public function get_roles() { + return $this->roles->get_roles(); + } + + /** + * Load user account from the specified database. + * + * @param c_base_database &$databae + * The already processed and ready to use database object. + * @param int|string|null|TRUE $user_name_or_id + * (optional) If an integer, represents the user id. + * If a string, represents the machine name of the user. + * If NULL, loads the roles for the current user. + * If TRUE, then load the current session user. + * @param bool $administrative + * (optional) When TRUE, loads as an administrative account, which may have access more accounts. + * When FALSE, load using normal methods. + * + * @return c_base_return_status + * TRUE on success. + * FALSE if unable to find roles. + * FALSE with error bit set on error. + */ + public function do_load(&$database, $user_name_or_id = NULL, $administrative = FALSE) { + return new c_base_return_false(); + } +} diff --git a/common/base/classes/base_utf8.php b/common/base/classes/base_utf8.php index 561f005..fc8258a 100644 --- a/common/base/classes/base_utf8.php +++ b/common/base/classes/base_utf8.php @@ -3,8 +3,6 @@ * @file * Provides UTF-8 support. */ - -// include required files. require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -77,7 +75,7 @@ class c_base_utf8 { */ public static function s_is_UTF_8($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -101,7 +99,7 @@ class c_base_utf8 { */ public static function s_character_to_ordinal($character) { if (!is_string($character)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'character', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'character', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -109,7 +107,7 @@ class c_base_utf8 { if ($ordinal === FALSE) { unset($ordinal); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'self::p_s_character_to_ordinal', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_character_to_ordinal', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -128,7 +126,7 @@ class c_base_utf8 { */ public static function s_ordinal_to_character($ordinal) { if (!is_int($ordinal)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'ordinal', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'ordinal', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -151,7 +149,7 @@ class c_base_utf8 { */ public static function s_length_string($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -159,7 +157,7 @@ class c_base_utf8 { if ($length === FALSE) { unset($length); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'self::p_s_length_string', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_length_string', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -181,12 +179,12 @@ class c_base_utf8 { */ public static function s_clean($text, $remove_bom = FALSE) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } if (!is_bool($remove_bom)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'remove_bom', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'remove_bom', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -194,7 +192,7 @@ class c_base_utf8 { if ($sanitized === FALSE) { unset($sanitized); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'self::p_s_clean', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_clean', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -215,12 +213,12 @@ class c_base_utf8 { */ public static function s_split($text, $split_length = 1) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } if (!is_int($split_length)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'split_length', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'split_length', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -228,7 +226,7 @@ class c_base_utf8 { if ($split === FALSE) { unset($split); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'self::p_s_split', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_split', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -247,7 +245,7 @@ class c_base_utf8 { */ public static function s_character_size_list($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -255,7 +253,7 @@ class c_base_utf8 { if ($size_list === FALSE) { unset($size_list); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'self::p_s_character_size_list', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_character_size_list', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -276,7 +274,7 @@ class c_base_utf8 { */ public static function s_character_max_width($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -284,7 +282,7 @@ class c_base_utf8 { if ($size_list === FALSE) { unset($size_list); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'self::p_s_character_size_list', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_character_size_list', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value(0, 'c_base_return_int', $error); } @@ -305,7 +303,7 @@ class c_base_utf8 { */ public static function s_encode_html_character($character) { if (!is_string($character)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'character', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'character', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -313,7 +311,7 @@ class c_base_utf8 { if ($encoded === FALSE) { unset($encoded); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'self::p_s_encode_html_character', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_encode_html_character', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -332,7 +330,7 @@ class c_base_utf8 { */ public static function s_encode_html($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -340,7 +338,7 @@ class c_base_utf8 { if ($split === FALSE) { unset($split); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'self::p_s_split', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_split', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -381,17 +379,17 @@ class c_base_utf8 { */ public static function s_substring($text, $start = 0, $length = NULL) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } if (!is_int($start)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'start', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'start', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } if (!is_null($length) && !is_int($length)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'length', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'length', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -414,7 +412,7 @@ class c_base_utf8 { */ public static function s_lowercase($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -437,7 +435,7 @@ class c_base_utf8 { */ public static function s_uppercase($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -457,7 +455,7 @@ class c_base_utf8 { */ public static function s_is_bom($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -479,12 +477,12 @@ class c_base_utf8 { */ public static function s_file_has_bom($file_path) { if (!is_string($file_path)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'file_path', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'file_path', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!file_exists($file_path)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':file_name' => $file_path, ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{file_name}' => $file_path, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_FILE); return c_base_return_error::s_false($error); } @@ -506,7 +504,7 @@ class c_base_utf8 { */ public static function s_string_has_bom($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -531,7 +529,7 @@ class c_base_utf8 { */ public static function s_prepend_bom($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -554,7 +552,7 @@ class c_base_utf8 { */ public static function s_reverse($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -562,7 +560,7 @@ class c_base_utf8 { if ($split === FALSE) { unset($split); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'self::p_s_split', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_split', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } @@ -591,17 +589,17 @@ class c_base_utf8 { */ public static function s_position_string($haystack, $needle, $offset = 0) { if (!is_string($haystack)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'haystack', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'haystack', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($needle) && !is_string($needle)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'needle', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'needle', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($offset) || $offset < 0) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'offset', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'offset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -628,7 +626,7 @@ class c_base_utf8 { */ public static function s_string_to_ordinals($text) { if (!is_string($text) && !is_array($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -648,7 +646,7 @@ class c_base_utf8 { */ public static function s_ordinals_to_string($ordinals) { if (!is_array($ordinals)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'ordinals', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'ordinals', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -657,7 +655,7 @@ class c_base_utf8 { foreach ($ordinals as $ordinal) { $character = self::p_s_ordinal_to_character($ordinal); if ($character === FALSE) { - $errors[] = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->p_s_ordinal_to_character', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $errors[] = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_s_ordinal_to_character', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); continue; } @@ -695,7 +693,7 @@ class c_base_utf8 { */ public static function s_ordinals_to_string_array($ordinals) { if (!is_array($ordinals)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'ordinals', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'ordinals', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_value(array(), 'c_base_return_array', $error); } @@ -704,7 +702,7 @@ class c_base_utf8 { foreach ($ordinals as $ordinal) { $character = self::p_s_ordinal_to_character($ordinal); if ($character === FALSE) { - $errors[] = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'this->p_s_ordinal_to_character', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $errors[] = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'this->p_s_ordinal_to_character', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); continue; } @@ -741,7 +739,7 @@ class c_base_utf8 { */ public static function s_ordinal_array_to_string($ordinals) { if (!is_array($ordinals)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'ordinals', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'ordinals', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -767,7 +765,7 @@ class c_base_utf8 { */ public static function s_ordinal_to_codepoint($ordinal) { if (!is_int($ordinal)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'ordinal', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'ordinal', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -775,7 +773,7 @@ class c_base_utf8 { if ($codepoint === FALSE) { unset($codepoint); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'self::p_s_orginal_to_codepoint', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_orginal_to_codepoint', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } @@ -800,22 +798,22 @@ class c_base_utf8 { */ public static function s_count_substrings($haystack, $needle, $offset = 0, $length = NULL) { if (!is_string($haystack)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'haystack', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'haystack', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($needle)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'needle', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'needle', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_int($offset)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'offset', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'offset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_null($length) && !is_int($length)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'length', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'length', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -842,7 +840,7 @@ class c_base_utf8 { */ public static function s_is_ascii($text) { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -867,12 +865,12 @@ class c_base_utf8 { */ public static function s_strip_tags($text, $allowable_tags = '') { if (!is_string($text)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'text', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'text', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } if (!is_string($allowable_tags)) { - $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'allowable_tags', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'allowable_tags', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); return c_base_return_error::s_false($error); } @@ -881,7 +879,7 @@ class c_base_utf8 { if ($sanitized === FALSE) { unset($sanitized); - $error = c_base_error::s_log(NULL, array('arguments' => array(':operation_name' => 'self::p_s_clean', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); + $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'self::p_s_clean', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_false($error); } diff --git a/common/base/classes/base_warning.php b/common/base/classes/base_warning.php index 9dc9c5e..e851d91 100644 --- a/common/base/classes/base_warning.php +++ b/common/base/classes/base_warning.php @@ -3,8 +3,6 @@ * @file * Provides a class for managing PHP warnings. */ - -// include required files. require_once('common/base/classes/base_return.php'); /** diff --git a/common/standard/classes/standard_database.php b/common/standard/classes/standard_database.php new file mode 100644 index 0000000..6feb20b --- /dev/null +++ b/common/standard/classes/standard_database.php @@ -0,0 +1,106 @@ + array(':{argument_name}' => 'log_type', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_false($error); + } + + if (!is_int($response_code)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'response_code', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT); + return c_base_return_error::s_false($error); + } + + $query_string = 'insert into v_log_users_self_insert (log_title, log_type, log_severity, request_client, response_code, log_details)'; + $query_string .= ' values ($1, $2, $3, ($4, $5, $6), $7, $8); '; + + $query_parameters = array(); + $query_parameters[3] = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0'; + $query_parameters[4] = isset($_SERVER['REMOTE_PORT']) ? $_SERVER['REMOTE_PORT'] : 0; + $query_parameters[5] = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '' ; + $query_parameters[6] = $response_code; + + if ($log_type === self::LOG_TYPE_LOGIN) { + $expires = NULL; + if (isset($data['expires']) && is_int($data['expires'])) { + $expires = $data['expires']; + } + + $query_parameters[0] = "Logging in to the system."; + $query_parameters[1] = 17; + $query_parameters[2] = 1; + $query_parameters[7] = json_encode(array('expires' => $expires)); + + unset($expires); + } + elseif ($log_type === self::LOG_TYPE_LOGOUT) { + $query_parameters[0] = "Logging out of the system."; + $query_parameters[1] = 18; + $query_parameters[2] = 1; + $query_parameters[7] = NULL; + } + elseif ($log_type === self::LOG_TYPE_CREATE) { + $query_parameters[0] = "Created the user account."; + $query_parameters[1] = 27; + $query_parameters[2] = 1; + $query_parameters[7] = NULL; + } + elseif ($log_type === self::LOG_TYPE_LOGIN_FAILURE) { + $user_name = NULL; + if (isset($data['user_name']) && is_string($data['user_name'])) { + $user_name = $data['user_name']; + } + + $query_parameters[0] = "Failed to login as the user '" . $user_name . "'."; + $query_parameters[1] = 17; + $query_parameters[2] = 2; + $query_parameters[7] = json_encode(array('user_name' => $user_name)); + + unset($user_name); + } + else { + return new c_base_return_false(); + } + + ksort($query_parameters); + + $query_result = $this->do_query($query_string, $query_parameters); + unset($query_string); + unset($query_parameters); + + if (c_base_return::s_has_error($query_result)) { + $last_error = $this->get_last_error()->get_value_exact(); + + $false = c_base_return_error::s_false($query_result->get_error()); + if (!empty($last_error)) { + $error = c_base_error::s_log(NULL, array('arguments' => array(':{database_error_message}' => $last_error, ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::POSTGRESQL_ERROR); + $false->set_error($error); + } + unset($last_error); + + return $false; + } + + return new c_base_return_true(); + } +} diff --git a/common/standard/classes/standard_index.php b/common/standard/classes/standard_index.php new file mode 100644 index 0000000..586222c --- /dev/null +++ b/common/standard/classes/standard_index.php @@ -0,0 +1,728 @@ +settings = array(); + + // database information + $this->settings['database_host'] = '127.0.0.1'; + $this->settings['database_port'] = 5432; + $this->settings['database_name'] = NULL; + $this->settings['database_user_public'] = NULL; + $this->settings['database_timeout'] = 4; + $this->settings['database_ssl_mode'] = 'disable'; + $this->settings['database_create_account_host'] = '127.0.0.1'; + $this->settings['database_create_account_port'] = 5433; + + // cookie/session information + $this->settings['cookie_name'] = NULL; + $this->settings['cookie_path'] = '/'; + $this->settings['cookie_domain'] = '.localhost'; + $this->settings['cookie_http_only'] = FALSE; // setting this to false will allow javascript to access this cookie, such as for ajax. + $this->settings['cookie_host_only'] = TRUE; + $this->settings['cookie_same_site'] = c_base_cookie::SAME_SITE_STRICT; + $this->settings['cookie_secure'] = TRUE; + $this->settings['session_socket'] = '/programs/sockets/sessionize_accounts/'; + $this->settings['session_system'] = 'standard'; + $this->settings['session_expire'] = 600; // 10 minutes + $this->settings['session_max'] = 1800; // 30 minutes + + // ldap information + $this->settings['ldap_server'] = NULL; // 'ldaps://127.0.0.1:1636/'; + $this->settings['ldap_bind_name'] = NULL; + $this->settings['ldap_bind_password'] = NULL; + $this->settings['ldap_base_dn'] = ''; + $this->settings['ldap_fields'] = array(); + + // base settings + $this->settings['base_scheme'] = 'https'; + $this->settings['base_host'] = 'localhost'; + $this->settings['base_path'] = $this->settings['cookie_path']; // must end in a trailing slash. + + if (!isset($_SERVER["HTTPS"])) { + $this->settings['base_scheme'] = 'http'; + } + + // The HTML tag

, represents a paragraph. + // However, many sites, services, and developers incorrectly use it to represent text. + // The definition of the word 'paragraph' contradicts this current usage of the HTML tag

. + // It is also important to note that many browsers will alter the content of the

tag to remove blocks of any kind, such as