Changeset 484 for trunk/lib


Ignore:
Timestamp:
Jul 30, 2014 10:43:49 PM (10 years ago)
Author:
anonymous
Message:

Changed private methods and properties to protected. A few minor bug fixes.

Location:
trunk/lib
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/ACL.inc.php

    r479 r484  
    4040
    4141    // A place to keep an object instance for the singleton pattern.
    42     private static $instance = null;
     42    protected static $instance = null;
    4343
    4444    // Configuration parameters for this object.
    45     private $_params = array(
     45    protected $_params = array(
    4646        // If false nothing will be cached or retrieved. Useful for testing realtime data requests.
    4747        'enable_cache' => true,
  • trunk/lib/App.inc.php

    r480 r484  
    4343
    4444    // A place to keep an object instance for the singleton pattern.
    45     private static $instance = null;
     45    protected static $instance = null;
    4646
    4747    // Namespace of this application instance.
    48     private $_ns;
     48    protected $_ns;
    4949
    5050    // If $app->start has run successfully.
     
    5555
    5656    // Array of query arguments will be carried persistently between requests.
    57     private $_carry_queries = array();
     57    protected $_carry_queries = array();
    5858
    5959    // Dictionary of global application parameters.
    60     private $_params = array();
     60    protected $_params = array();
    6161
    6262    // Default parameters.
    63     private $_param_defaults = array(
     63    protected $_param_defaults = array(
    6464
    6565        // Public name and email address for this application.
  • trunk/lib/Auth_File.inc.php

    r478 r484  
    4949
    5050    // Namespace of this auth object.
    51     private $_ns;
     51    protected $_ns;
    5252
    5353    // Parameters to be specified by setParam().
    54     private $_params = array();
    55     private $_default_params = array(
     54    protected $_params = array();
     55    protected $_default_params = array(
    5656
    5757        // Full path to htpasswd file.
     
    7777
    7878    // Associative array of usernames to hashed passwords.
    79     private $_users = array();
     79    protected $_users = array();
    8080
    8181    /*
     
    350350    * @since    18 Apr 2006 18:17:48
    351351    */
    352     private function _loadHTPasswdFile()
     352    protected function _loadHTPasswdFile()
    353353    {
    354354        $app = &App::getInstance();
     
    387387    * @return string  The hashed password.
    388388    */
    389     private function _encrypt($password, $encrypted_password=null)
     389    protected function _encrypt($password, $encrypted_password=null)
    390390    {
    391391        switch ($this->_params['encryption_type']) {
  • trunk/lib/Auth_SQL.inc.php

    r479 r484  
    4141
    4242    // Namespace of this auth object.
    43     private $_ns;
     43    protected $_ns;
    4444
    4545    // Static var for test.
    46     private $_authentication_tested;
     46    protected $_authentication_tested;
    4747
    4848    // Parameters to be configured by setParam.
    49     private $_params = array();
    50     private $_default_params = array(
     49    protected $_params = array();
     50    protected $_default_params = array(
    5151
    5252        // Automatically create table and verify columns. Better set to false after site launch.
     
    171171            // The minimal columns for a table compatable with the Auth_SQL class.
    172172            $db->query("CREATE TABLE IF NOT EXISTS " . $db->escapeString($this->getParam('db_table')) . " (
    173                 " . $this->getParam('db_primary_key') . " smallint(11) NOT NULL auto_increment,
     173                " . $this->getParam('db_primary_key') . " MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
    174174                " . $this->getParam('db_username_column') . " varchar(255) NOT NULL default '',
    175175                userpass VARCHAR(255) NOT NULL DEFAULT '',
     
    189189                added_datetime DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
    190190                modified_datetime DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
    191                 PRIMARY KEY (" . $this->getParam('db_primary_key') . "),
    192191                KEY " . $this->getParam('db_username_column') . " (" . $this->getParam('db_username_column') . "),
    193192                KEY userpass (userpass),
     
    226225                }
    227226                $db->query("CREATE TABLE IF NOT EXISTS " . $this->getParam('db_login_table') . " (
    228                     " . $this->getParam('db_primary_key') . " SMALLINT(11) NOT NULL DEFAULT '0',
     227                    " . $this->getParam('db_primary_key') . " MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
    229228                    login_datetime DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
    230229                    remote_ip_binary CHAR(32) NOT NULL DEFAULT '',
  • trunk/lib/AuthorizeNet.inc.php

    r479 r484  
    6262
    6363    public $post_url = ''; // The URL to post data to.
    64     private $_results = array();
    65     private $_params = array();
    66     private $_default_params = array(
     64    protected $_results = array();
     65    protected $_params = array();
     66    protected $_default_params = array(
    6767        'x_version'         => '3.1',
    6868        'x_relay_response'  => 'FALSE',
     
    8080
    8181    // Array of response names. Used in the results array.
    82     private $_result_fields = Array(
     82    protected $_result_fields = Array(
    8383        'x_response_code',
    8484        'x_response_subcode',
     
    297297     * @return integer      Transaction result code.
    298298     */
    299     private function _processResult($result)
     299    protected function _processResult($result)
    300300    {
    301301        $this->_results = Array();
  • trunk/lib/CSS.inc.php

    r479 r484  
    3232
    3333    // Include these style sheets.
    34     private $_css_files = array('default' => array());
     34    protected $_css_files = array('default' => array());
    3535
    3636    // CSS object parameters.
    37     private $_params = array(
     37    protected $_params = array(
    3838        'character_set' => 'utf-8',
    3939        'cache_css' => false,
  • trunk/lib/Cache.inc.php

    r480 r484  
    3535
    3636    // A place to keep object instances for the singleton pattern.
    37     private static $instances = array();
     37    protected static $instances = array();
    3838
    3939    // Namespace of this instance of Prefs.
    40     private $_ns;
     40    protected $_ns;
    4141
    4242    // Configuration parameters for this object.
    43     private $_params = array(
     43    protected $_params = array(
    4444
    4545        // Type of cache. Currently only 'session' is supported.
  • trunk/lib/Cart.inc.php

    r479 r484  
    7171
    7272    // Namespace of this instance.
    73     private $_ns;
     73    protected $_ns;
    7474
    7575    // Configuration parameters for this object.
    76     private $_params = array(
     76    protected $_params = array(
    7777    );
    7878
  • trunk/lib/Currency.inc.php

    r479 r484  
    4141
    4242    // Configuration parameters for this object.
    43     private $_params = array(
     43    protected $_params = array(
    4444        'cache_result' => true,
    4545        'cache_dir' => '',
     
    180180     * @access private
    181181     */
    182     private function _performAPICall($parameters=null)
     182    protected function _performAPICall($parameters=null)
    183183    {
    184184        $app =& App::getInstance();
  • trunk/lib/DB.inc.php

    r479 r484  
    3333
    3434    // A place to keep an object instance for the singleton pattern.
    35     private static $instance = null;
     35    protected static $instance = null;
    3636
    3737    // If $db->connect has successfully opened a db connection.
    38     private $_connected = false;
     38    protected $_connected = false;
    3939
    4040    // Database handle.
     
    4242
    4343    // Count how many queries run during the whole instance.
    44     private $_query_count = 0;
     44    protected $_query_count = 0;
    4545
    4646    // Hash of DB parameters.
    47     private $_params = array();
     47    protected $_params = array();
    4848
    4949    // Default parameters.
    50     private $_param_defaults = array(
     50    protected $_param_defaults = array(
    5151
    5252        // DB passwords should be set as apache environment variables in httpd.conf, readable only by root.
     
    7373
    7474    // Caches.
    75     private $existing_tables;
    76     private $table_columns;
     75    protected $existing_tables;
     76    protected $table_columns;
    7777
    7878    /**
     
    147147
    148148        // Connect to database. Always create a new link to the server.
     149        // Connection errors are surpressed so we can do our own error management below.
    149150        if ($this->dbh = @mysql_connect($this->getParam('db_server'), $this->getParam('db_user'), $this->getParam('db_pass'), true)) {
    150151            // Select database
     
    222223    * @since    15 Jan 2007 15:59:00
    223224    */
    224     private function _fail()
     225    protected function _fail()
    225226    {
    226227        if ($this->getParam('db_die_on_failure')) {
    227             header(' ', true, 503);
    228             echo _("This page is temporarily unavailable. Please try again in a few minutes.");
     228            if (!defined('_CLI')) {
     229                // For http requests, send a Service Unavailable header.
     230                header(' ', true, 503);
     231                echo _("This page is temporarily unavailable. Please try again in a few minutes.");
     232            }
    229233            die;
    230234        } else {
     
    318322            $app->logMsg(sprintf('MySQL error %s: %s in query: %s', mysql_errno($this->dbh), mysql_error($this->dbh), $debugqry), LOG_EMERG, __FILE__, __LINE__);
    319323            if ($this->getParam('db_debug')) {
    320                 echo '<pre style="padding:2em; background:#ddd; font:9px monaco;">' . wordwrap(mysql_error($this->dbh)) . '<hr>' . htmlspecialchars($debugqry) . '</pre>';
     324                if (!defined('_CLI')) {
     325                    echo '<pre style="padding:2em; background:#ddd; font:9px monaco;">' . wordwrap(mysql_error($this->dbh)) . '<hr>' . htmlspecialchars($debugqry) . '</pre>';
     326                }
    321327            }
    322328            // Die if db_die_on_failure = true, or just continue without connection
     
    355361            return true;
    356362        } else {
    357             $app->logMsg(sprintf('Nonexistent DB table: %s.%s', $this->getParam('db_name'), $table), LOG_ALERT, __FILE__, __LINE__);
     363            $app->logMsg(sprintf('Nonexistent DB table: %s.%s', $this->getParam('db_name'), $table), LOG_INFO, __FILE__, __LINE__);
    358364            return false;
    359365        }
  • trunk/lib/DBSessionHandler.inc.php

    r479 r484  
    3434    public $db; // DB object.
    3535
    36     private $_params = array(
     36    protected $_params = array(
    3737        'db_table' => 'session_tbl',
    3838
  • trunk/lib/Email.inc.php

    r479 r484  
    5656
    5757    // Default parameters, to be overwritten by setParam() and read with getParam()
    58     private $_params = array(
     58    protected $_params = array(
    5959        'to' => null,
    6060        'from' => null,
     
    7474
    7575    // String that contains the email body.
    76     private $_template;
     76    protected $_template;
    7777
    7878    // String that contains the email body after replacements.
    79     private $_template_replaced;
     79    protected $_template_replaced;
    8080
    8181    /**
  • trunk/lib/FormValidator.inc.php

    r479 r484  
    6161
    6262    // Class parameters.
    63     private $_params = array(
     63    protected $_params = array(
    6464        'error' => ' sc-msg-error ',
    6565        'warning' => ' sc-msg-warning ',
  • trunk/lib/Image.inc.php

    r479 r484  
    3131
    3232    // Object parameters.
    33     private $_params = array();
     33    protected $_params = array();
    3434
    3535    /**
  • trunk/lib/ImageThumb.inc.php

    r479 r484  
    4343
    4444    // General object parameters.
    45     private $_params = array(
     45    protected $_params = array(
    4646        // The location for images to create thumbnails from.
    4747        'source_dir' => null,
     
    7272
    7373    // Default image size specs.
    74     private $_default_image_specs = array(
     74    protected $_default_image_specs = array(
    7575        // The destination for an image thumbnail size.
    7676        // Use initial / to specify absolute paths, leave off to specify a path relative to source_dir (eg: ../thumbs).
     
    108108
    109109    // Final specifications for image sizes, set with setSpec().
    110     private $_image_specs = array();
     110    protected $_image_specs = array();
    111111
    112112    /**
     
    452452    * @since    19 May 2006 13:55:46
    453453    */
    454     private function _resizeWithNetpbm($source_file, $dest_file, $spec)
     454    protected function _resizeWithNetpbm($source_file, $dest_file, $spec)
    455455    {
    456456        $app =& App::getInstance();
     
    521521    * @since    19 May 2006 15:46:02
    522522    */
    523     private function _resizeWithGD($source_file, $dest_file, $spec)
     523    protected function _resizeWithGD($source_file, $dest_file, $spec)
    524524    {
    525525        $app =& App::getInstance();
     
    754754     * @return  bool    True on success, false on failure.
    755755     */
    756     private function _validFileExtension($file_name)
     756    protected function _validFileExtension($file_name)
    757757    {
    758758        preg_match('/.*?\.(\w+)$/i', $file_name, $ext);
     
    766766     * @return  bool true on success, false on failure.
    767767     */
    768     private function _createDestDirs($filename=null)
     768    protected function _createDestDirs($filename=null)
    769769    {
    770770        $app =& App::getInstance();
     
    824824     * @param string $line    __LINE__.
    825825     */
    826     private function _raiseMsg($message, $type, $file, $line)
     826    protected function _raiseMsg($message, $type, $file, $line)
    827827    {
    828828        $app =& App::getInstance();
     
    844844     * @since   15 Nov 2005 20:55:22
    845845     */
    846     private function _glob($pattern, $directory)
     846    protected function _glob($pattern, $directory)
    847847    {
    848848        $file_list = glob(sprintf('%s/%s', $directory, $pattern));
  • trunk/lib/JS.inc.php

    r479 r484  
    3232
    3333    // Include these style sheets.
    34     private $_js_files = array('default' => array());
     34    protected $_js_files = array('default' => array());
    3535
    3636    // JS object parameters.
    37     private $_params = array(
     37    protected $_params = array(
    3838        'character_set' => 'utf-8',
    3939        'cache_js' => false,
  • trunk/lib/Lock.inc.php

    r479 r484  
    3232
    3333    // A place to keep an object instance for the singleton pattern.
    34     private static $instance = null;
     34    protected static $instance = null;
    3535
    3636    // Configuration of this object.
    37     private $_params = array(
     37    protected $_params = array(
    3838        'timeout' => 600,
    3939        'auto_timeout' => 1800,
     
    4747
    4848    // Store lock data from DB.
    49     private $data = array();
     49    protected $data = array();
    5050
    5151    // Auth_SQL object from which to access a current user_id.
    52     private $_auth;
     52    protected $_auth;
    5353
    5454    /**
     
    109109            }
    110110            $db->query("CREATE TABLE IF NOT EXISTS " . $db->escapeString($this->getParam('db_table')) . " (
    111                 lock_id int NOT NULL auto_increment,
     111                lock_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
    112112                record_table varchar(255) NOT NULL default '',
    113113                record_key varchar(255) NOT NULL default '',
     
    116116                set_by_admin_id smallint(11) NOT NULL default '0',
    117117                lock_datetime datetime NOT NULL default '0000-00-00 00:00:00',
    118                 PRIMARY KEY (lock_id),
    119118                KEY record_table (record_table),
    120119                KEY record_key (record_key),
  • trunk/lib/Navigation.inc.php

    r479 r484  
    3737
    3838    // Configuration parameters for this object.
    39     private $_params = array(
     39    protected $_params = array(
    4040        'head_title' => true,
    4141        'body_title' => true,
  • trunk/lib/PEdit.inc.php

    r479 r484  
    7070
    7171    // PEdit object parameters.
    72     private $_params = array(
     72    protected $_params = array(
    7373        'data_dir' => '',
    7474        'character_set' => 'utf-8',
     
    7777    );
    7878
    79     private $_data = array(); // Array to store loaded data.
    80     private $_data_file = ''; // Full file path to the pedit data file.
    81     private $_authorized = false; // User is authenticated to see extended functions.
    82     private $_data_loaded = false;
     79    protected $_data = array(); // Array to store loaded data.
     80    protected $_data_file = ''; // Full file path to the pedit data file.
     81    protected $_authorized = false; // User is authenticated to see extended functions.
     82    protected $_data_loaded = false;
    8383    public $op = '';
    8484
     
    442442    * @since    12 Apr 2006 10:52:35
    443443    */
    444     private function _fileHash()
     444    protected function _fileHash()
    445445    {
    446446        $app =& App::getInstance();
     
    457457    * @since    11 Apr 2006 20:36:26
    458458    */
    459     private function _loadDataFile()
     459    protected function _loadDataFile()
    460460    {
    461461        $app =& App::getInstance();
     
    496496    * @since    11 Apr 2006 20:53:42
    497497    */
    498     private function _initializeDataFile()
     498    protected function _initializeDataFile()
    499499    {
    500500        $app =& App::getInstance();
     
    512512     * @return bool  False if unauthorized or on failure. True on success.
    513513     */
    514     private function _writeData()
     514    protected function _writeData()
    515515    {
    516516        $app =& App::getInstance();
     
    560560    * @since    11 Apr 2006 22:48:30
    561561    */
    562     private function _filePutContents($filename, $content)
     562    protected function _filePutContents($filename, $content)
    563563    {
    564564        $app =& App::getInstance();
     
    610610     * @return bool  False on failure. True on success.
    611611     */
    612     private function _createVersion()
     612    protected function _createVersion()
    613613    {
    614614        $app =& App::getInstance();
     
    648648    * @since    12 Apr 2006 11:08:11
    649649    */
    650     private function _deleteOldVersions()
     650    protected function _deleteOldVersions()
    651651    {
    652652        $app =& App::getInstance();
     
    676676     * @return array  Array of versions.
    677677     */
    678     private function _getVersions()
     678    protected function _getVersions()
    679679    {
    680680        $version_files = array();
     
    707707     * @return bool  False on failure. True on success.
    708708     */
    709     private function _restoreVersion($version)
     709    protected function _restoreVersion($version)
    710710    {
    711711        $app =& App::getInstance();
  • trunk/lib/PageNumbers.inc.php

    r479 r484  
    4545    public $last_item;         // The counter for the last item on this page (zero index).
    4646    public $max_num_links = 9; // The max number of links to show on page (odd numbers look best).
    47     private $_num_links;        // The number of links to show on page.
    48     private $_per_page = 25;    // Items per page.
     47    protected $_num_links;        // The number of links to show on page.
     48    protected $_per_page = 25;    // Items per page.
    4949
    5050    // Flags to ensure all necessary values have been set before calling calculate().
  • trunk/lib/PageSequence.inc.php

    r479 r484  
    342342     * Deletes all data that are older than auto_timeout. Set current time if not not expired or not set.
    343343     */
    344     private function _auto_timeout()
     344    protected function _auto_timeout()
    345345    {
    346346        $app =& App::getInstance();
  • trunk/lib/PayPal.inc.php

    r479 r484  
    3333
    3434    // General object parameters.
    35     private $_params = array(
     35    protected $_params = array(
    3636        'paypal_url' => 'https://www.paypal.com/cgi-bin/webscr',
    3737        'test_mode' => false,
     
    3939
    4040    // Options used for specific buttons and links.
    41     private $_default_button_options = array();
     41    protected $_default_button_options = array();
    4242
    4343    // Array of buttons created by newButton().
    44     private $_buttons = array();
     44    protected $_buttons = array();
    4545
    4646    // Store the response from the last IPN.
    47     private $_ipn_response;
     47    protected $_ipn_response;
    4848
    4949    /**
  • trunk/lib/Prefs.inc.php

    r481 r484  
    5555
    5656    // Namespace of this instance of Prefs.
    57     private $_ns;
     57    protected $_ns;
    5858
    5959    // Configuration parameters for this object.
    60     private $_params = array(
     60    protected $_params = array(
    6161
    6262        // Store preferences in one of the available storage mechanisms: session, cookie, database
     
    497497    * @since    04 Jun 2006 17:12:44
    498498    */
    499     private function _isLoaded()
     499    protected function _isLoaded()
    500500    {
    501501        if ('database' != $this->getParam('storagetype')) {
     
    584584    * @since    02 May 2014 18:17:04
    585585    */
    586     private function _getCookieName($key)
     586    protected function _getCookieName($key)
    587587    {
    588588        $app =& App::getInstance();
  • trunk/lib/ScriptTimer.inc.php

    r479 r484  
    2727
    2828    public $time_format = '%.3f';
    29     private $_timing_start_times = array();
    30     private $_timing_stop_times = array();
    31     private $_timing_cumulative_times = array();
     29    protected $_timing_start_times = array();
     30    protected $_timing_stop_times = array();
     31    protected $_timing_cumulative_times = array();
    3232   
    3333    public function start($name='default')
  • trunk/lib/SortOrder.inc.php

    r479 r484  
    3737class SortOrder {
    3838
    39     private $_columns;
     39    protected $_columns;
    4040    public $sort_by;
    4141    public $order;
  • trunk/lib/SpellCheck.inc.php

    r479 r484  
    6161class SpellCheck {
    6262
    63     private $_params = array(
     63    protected $_params = array(
    6464        'language' => 'en',
    6565        'personal_wordlist' => '', // Text file to save custom words to.
     
    7070    );
    7171
    72     private $_pspell_cfg_handle;
    73     private $_pspell_handle;
    74     private $_use_personal_wordlist = false;
    75     private $_errors = array();
     72    protected $_pspell_cfg_handle;
     73    protected $_pspell_handle;
     74    protected $_use_personal_wordlist = false;
     75    protected $_errors = array();
    7676
    7777    /**
  • trunk/lib/Upload.inc.php

    r479 r484  
    4141
    4242    // General object parameters.
    43     private $_params = array(
     43    protected $_params = array(
    4444
    4545        // Which messages do we pass to raiseMsg?
  • trunk/lib/Version.inc.php

    r479 r484  
    4040
    4141    // A place to keep an object instance for the singleton pattern.
    42     private static $instance = null;
     42    protected static $instance = null;
    4343
    4444    // Configuration of this object.
    45     private $_params = array(
     45    protected $_params = array(
    4646        'max_qty' => 100, // Never have more than this many versions of each record.
    4747        'min_qty' => 25, // Keep at least this many versions of each record.
     
    5757
    5858    // Auth_SQL object from which to access a current user_id.
    59     private $_auth;
     59    protected $_auth;
    6060
    6161    /**
     
    116116            }
    117117            $db->query("CREATE TABLE IF NOT EXISTS " . $db->escapeString($this->getParam('db_table')) . " (
    118                 version_id INT NOT NULL AUTO_INCREMENT,
     118                version_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
    119119                record_table VARCHAR(255) NOT NULL DEFAULT '',
    120120                record_key VARCHAR(255) NOT NULL DEFAULT '',
     
    126126                saved_by_user_id SMALLINT(11) NOT NULL DEFAULT '0',
    127127                version_datetime DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
    128                 PRIMARY KEY (version_id),
    129128                KEY record_table (record_table),
    130129                KEY record_key (record_key),
Note: See TracChangeset for help on using the changeset viewer.