From fac619cedb341605b982816cdee867ae2c142fb8 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 3 Apr 2008 12:37:30 -0400 Subject: [PATCH] Making a lot of previously-private methods and ivars public or protected --- Api.php | 8 ++++---- CHANGES | 1 + Db.php | 4 ++-- Template.php | 22 +++++++++++----------- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Api.php b/Api.php index 89d8dd9..a89747c 100644 --- a/Api.php +++ b/Api.php @@ -166,7 +166,7 @@ abstract class BSApi * This simply throws the ApiException if it exists, which inside holds * all of the individual and specific errors */ - private function _processErrorQueue() + protected function _processErrorQueue() { if ($this->exception) { @@ -396,7 +396,7 @@ abstract class BSApi /** * Verifies that all required fields are set */ - private function _verifyRequired() + protected function _verifyRequired() { foreach ($this->fields as $name => $options) { @@ -420,7 +420,7 @@ abstract class BSApi * @param string Action to run * @param bool Actually run it? */ - private function _runActionMethod($method, $doRun) + protected function _runActionMethod($method, $doRun) { if (!$doRun || !method_exists($this, $method)) { @@ -438,7 +438,7 @@ abstract class BSApi * * @return string Prepared value entry */ - private function _prepareFieldForSql($name) + protected function _prepareFieldForSql($name) { $type = $this->fields["$name"][F_TYPE]; diff --git a/CHANGES b/CHANGES index 5219aa3..32e7941 100644 --- a/CHANGES +++ b/CHANGES @@ -5,3 +5,4 @@ - New: BSPrinterRootPage::setHeaderCode() allows injecting in between the tag of the root page element (creates BSPrinterRootPage::$headerCode) - New: BSPrinterAbstract::setId() allows all elements to have an id attribute added in _prepareStyle() - New: Added an ability to quick-set API information via an array with BSApi::setArray() +- New: Made many private members protected or public diff --git a/Db.php b/Db.php index 57dc5e6..20a1d50 100644 --- a/Db.php +++ b/Db.php @@ -352,7 +352,7 @@ abstract class BSDbResult * The result resource * @var resource */ - private $result; + protected $result; /** * Sets the resource and returns a result object @@ -471,7 +471,7 @@ class BSDbException extends Exception * The query string that caused the error * @var string */ - private $query; + protected $query; /** * Initializes a new database exception diff --git a/Template.php b/Template.php index 5e13566..eb6c578 100644 --- a/Template.php +++ b/Template.php @@ -49,31 +49,31 @@ class BSTemplate * The path, from the path of the application, where templates are stored * @var string */ - private $templateDir = ''; + protected $templateDir = ''; /** * The extension all the template files have * @var string */ - private $extension = 'tpl'; + protected $extension = 'tpl'; /** * The database table name for the template cache * @var string */ - private $dbCacheTable = null; + protected $dbCacheTable = null; /** * The name of the function phrases are fetched with * @var string */ - private $langcall = 'gettext'; + public $langcall = 'gettext'; /** * The name of the function phrases are sprintf() parsed with * @var string */ - private $langconst = 'sprintf'; + public $langconst = 'sprintf'; /** * Array of pre-compiled templates that are stored to decrease server load @@ -91,13 +91,13 @@ class BSTemplate * Whether or not the page has been flush()'d already * @var bool */ - private $doneflush = false; + protected $doneflush = false; /** * The name of a function that is called before template parsing of phrases and conditionals occurs * @var string */ - private $preParseHook = ':undefined:'; + protected $preParseHook = ':undefined:'; /** * Sets the template directory name @@ -326,7 +326,7 @@ class BSTemplate * * @return string Parsed template data */ - private function _parseBlocksAndTokens($template) + protected function _parseBlocksAndTokens($template) { $stack = array(); $tokens = array(); @@ -381,7 +381,7 @@ class BSTemplate * * @return string Parsed value */ - private function _parseToken($token) + protected function _parseToken($token) { // knock of the braces $token = substr($token, 1, strlen($token) - 2); @@ -405,7 +405,7 @@ class BSTemplate * * @return string Language-ready template data */ - private function _parsePhrases($template) + protected function _parsePhrases($template) { $tagStart = '