Making a lot of previously-private methods and ivars public or protected
authorRobert Sesek <rsesek@bluestatic.org>
Thu, 3 Apr 2008 16:37:30 +0000 (12:37 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Thu, 3 Apr 2008 16:37:30 +0000 (12:37 -0400)
Api.php
CHANGES
Db.php
Template.php

diff --git a/Api.php b/Api.php
index 89d8dd90b318640fef09c625a641551b5dd8ac34..a89747c9d1aa01759cb06e289d38bc075c619ee5 100644 (file)
--- 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 5219aa34429609a26f6fbe1fd10e48a4b769fb3c..32e7941bdcbafb94cf491c1d38fef35984474392 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -5,3 +5,4 @@
 - New: BSPrinterRootPage::setHeaderCode() allows injecting in between the <head> 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 57dc5e60ac23901d866645bf40a4e9f625a0a512..20a1d50b0a7de5f910806efa08a976554c00d173 100644 (file)
--- 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
index 5e135667f8b904776c0ed388a73051a97c56c3bb..eb6c5788f82fce6ff8f323d7c92a908cccdc603b 100644 (file)
@@ -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 = '<lang ';
                $tagEnd = '</lang>';
@@ -512,7 +512,7 @@ class BSTemplate
         *
         * @return      string  Parsed template data
         */
-       private function _parseConditionals($template)
+       protected function _parseConditionals($template)
        {
                // tag data
                $tag_start = '<if condition=\"';