Index: /trunk/bin/acl.cli.php
===================================================================
--- /trunk/bin/acl.cli.php	(revision 483)
+++ /trunk/bin/acl.cli.php	(revision 484)
@@ -58,5 +58,4 @@
 );
 
-
 /********************************************************************
 * CONFIG
@@ -67,4 +66,5 @@
 require_once 'codebase/lib/Utilities.inc.php';
 
+define('_CLI', true);
 $app =& App::getInstance('module_maker');
 $app->setParam(array(
@@ -102,4 +102,9 @@
 ********************************************************************/
 
+if (!$db->tableExists('acl_tbl')) {
+    printf("This project doesn't appear to be using ACL (there is no acl_tbl in the %s DB).\n", $app->getParam('db_name'));
+    die;
+}
+
 $op = $_SERVER['argv'][1];
 switch ($op) {
@@ -246,10 +251,9 @@
 (he can edit any object).
 
-Each access object is stored as a node in hierarchical tree structures.
+Each access object is stored as a node in hierarchical tree structure.
 A permission granted to a node is applied to all its children. If a child
-node is specified a different permission that is more specific than
-anything on the branch it will take precedence. If no permission is
-specified, root is used for that object. Root, in this case, means
-"anything" since it is at the top of all branches.
+node is specified with a permission more specific than its ancestors, the
+child will take precedence. If no permission is specified, root is used,
+implying access to any object of that type.
 
 Usage: <?php echo $this_script; ?> command [args]
@@ -272,5 +276,4 @@
     revoke aro [aco] [axo]
     delete aro aco axo
-
 
 For the add*, mv*, grant, and revoke commands if any of the optional
Index: /trunk/lib/ACL.inc.php
===================================================================
--- /trunk/lib/ACL.inc.php	(revision 483)
+++ /trunk/lib/ACL.inc.php	(revision 484)
@@ -40,8 +40,8 @@
 
     // A place to keep an object instance for the singleton pattern.
-    private static $instance = null;
+    protected static $instance = null;
 
     // Configuration parameters for this object.
-    private $_params = array(
+    protected $_params = array(
         // If false nothing will be cached or retrieved. Useful for testing realtime data requests.
         'enable_cache' => true,
Index: /trunk/lib/App.inc.php
===================================================================
--- /trunk/lib/App.inc.php	(revision 483)
+++ /trunk/lib/App.inc.php	(revision 484)
@@ -43,8 +43,8 @@
 
     // A place to keep an object instance for the singleton pattern.
-    private static $instance = null;
+    protected static $instance = null;
 
     // Namespace of this application instance.
-    private $_ns;
+    protected $_ns;
 
     // If $app->start has run successfully.
@@ -55,11 +55,11 @@
 
     // Array of query arguments will be carried persistently between requests.
-    private $_carry_queries = array();
+    protected $_carry_queries = array();
 
     // Dictionary of global application parameters.
-    private $_params = array();
+    protected $_params = array();
 
     // Default parameters.
-    private $_param_defaults = array(
+    protected $_param_defaults = array(
 
         // Public name and email address for this application.
Index: /trunk/lib/Auth_File.inc.php
===================================================================
--- /trunk/lib/Auth_File.inc.php	(revision 483)
+++ /trunk/lib/Auth_File.inc.php	(revision 484)
@@ -49,9 +49,9 @@
 
     // Namespace of this auth object.
-    private $_ns;
+    protected $_ns;
 
     // Parameters to be specified by setParam().
-    private $_params = array();
-    private $_default_params = array(
+    protected $_params = array();
+    protected $_default_params = array(
 
         // Full path to htpasswd file.
@@ -77,5 +77,5 @@
 
     // Associative array of usernames to hashed passwords.
-    private $_users = array();
+    protected $_users = array();
 
     /*
@@ -350,5 +350,5 @@
     * @since    18 Apr 2006 18:17:48
     */
-    private function _loadHTPasswdFile()
+    protected function _loadHTPasswdFile()
     {
         $app = &App::getInstance();
@@ -387,5 +387,5 @@
     * @return string  The hashed password.
     */
-    private function _encrypt($password, $encrypted_password=null)
+    protected function _encrypt($password, $encrypted_password=null)
     {
         switch ($this->_params['encryption_type']) {
Index: /trunk/lib/Auth_SQL.inc.php
===================================================================
--- /trunk/lib/Auth_SQL.inc.php	(revision 483)
+++ /trunk/lib/Auth_SQL.inc.php	(revision 484)
@@ -41,12 +41,12 @@
 
     // Namespace of this auth object.
-    private $_ns;
+    protected $_ns;
 
     // Static var for test.
-    private $_authentication_tested;
+    protected $_authentication_tested;
 
     // Parameters to be configured by setParam.
-    private $_params = array();
-    private $_default_params = array(
+    protected $_params = array();
+    protected $_default_params = array(
 
         // Automatically create table and verify columns. Better set to false after site launch.
@@ -171,5 +171,5 @@
             // The minimal columns for a table compatable with the Auth_SQL class.
             $db->query("CREATE TABLE IF NOT EXISTS " . $db->escapeString($this->getParam('db_table')) . " (
-                " . $this->getParam('db_primary_key') . " smallint(11) NOT NULL auto_increment,
+                " . $this->getParam('db_primary_key') . " MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
                 " . $this->getParam('db_username_column') . " varchar(255) NOT NULL default '',
                 userpass VARCHAR(255) NOT NULL DEFAULT '',
@@ -189,5 +189,4 @@
                 added_datetime DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
                 modified_datetime DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
-                PRIMARY KEY (" . $this->getParam('db_primary_key') . "),
                 KEY " . $this->getParam('db_username_column') . " (" . $this->getParam('db_username_column') . "),
                 KEY userpass (userpass),
@@ -226,5 +225,5 @@
                 }
                 $db->query("CREATE TABLE IF NOT EXISTS " . $this->getParam('db_login_table') . " (
-                    " . $this->getParam('db_primary_key') . " SMALLINT(11) NOT NULL DEFAULT '0',
+                    " . $this->getParam('db_primary_key') . " MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
                     login_datetime DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
                     remote_ip_binary CHAR(32) NOT NULL DEFAULT '',
Index: /trunk/lib/AuthorizeNet.inc.php
===================================================================
--- /trunk/lib/AuthorizeNet.inc.php	(revision 483)
+++ /trunk/lib/AuthorizeNet.inc.php	(revision 484)
@@ -62,7 +62,7 @@
 
     public $post_url = ''; // The URL to post data to.
-    private $_results = array();
-    private $_params = array();
-    private $_default_params = array(
+    protected $_results = array();
+    protected $_params = array();
+    protected $_default_params = array(
         'x_version'         => '3.1',
         'x_relay_response'  => 'FALSE',
@@ -80,5 +80,5 @@
 
     // Array of response names. Used in the results array.
-    private $_result_fields = Array(
+    protected $_result_fields = Array(
         'x_response_code',
         'x_response_subcode',
@@ -297,5 +297,5 @@
      * @return integer      Transaction result code.
      */
-    private function _processResult($result)
+    protected function _processResult($result)
     {
         $this->_results = Array();
Index: /trunk/lib/CSS.inc.php
===================================================================
--- /trunk/lib/CSS.inc.php	(revision 483)
+++ /trunk/lib/CSS.inc.php	(revision 484)
@@ -32,8 +32,8 @@
 
     // Include these style sheets.
-    private $_css_files = array('default' => array());
+    protected $_css_files = array('default' => array());
 
     // CSS object parameters.
-    private $_params = array(
+    protected $_params = array(
         'character_set' => 'utf-8',
         'cache_css' => false,
Index: /trunk/lib/Cache.inc.php
===================================================================
--- /trunk/lib/Cache.inc.php	(revision 483)
+++ /trunk/lib/Cache.inc.php	(revision 484)
@@ -35,11 +35,11 @@
 
     // A place to keep object instances for the singleton pattern.
-    private static $instances = array();
+    protected static $instances = array();
 
     // Namespace of this instance of Prefs.
-    private $_ns;
+    protected $_ns;
 
     // Configuration parameters for this object.
-    private $_params = array(
+    protected $_params = array(
 
         // Type of cache. Currently only 'session' is supported.
Index: /trunk/lib/Cart.inc.php
===================================================================
--- /trunk/lib/Cart.inc.php	(revision 483)
+++ /trunk/lib/Cart.inc.php	(revision 484)
@@ -71,8 +71,8 @@
 
     // Namespace of this instance.
-    private $_ns;
+    protected $_ns;
 
     // Configuration parameters for this object.
-    private $_params = array(
+    protected $_params = array(
     );
 
Index: /trunk/lib/Currency.inc.php
===================================================================
--- /trunk/lib/Currency.inc.php	(revision 483)
+++ /trunk/lib/Currency.inc.php	(revision 484)
@@ -41,5 +41,5 @@
 
     // Configuration parameters for this object.
-    private $_params = array(
+    protected $_params = array(
         'cache_result' => true,
         'cache_dir' => '',
@@ -180,5 +180,5 @@
      * @access private
      */
-    private function _performAPICall($parameters=null)
+    protected function _performAPICall($parameters=null)
     {
         $app =& App::getInstance();
Index: /trunk/lib/DB.inc.php
===================================================================
--- /trunk/lib/DB.inc.php	(revision 483)
+++ /trunk/lib/DB.inc.php	(revision 484)
@@ -33,8 +33,8 @@
 
     // A place to keep an object instance for the singleton pattern.
-    private static $instance = null;
+    protected static $instance = null;
 
     // If $db->connect has successfully opened a db connection.
-    private $_connected = false;
+    protected $_connected = false;
 
     // Database handle.
@@ -42,11 +42,11 @@
 
     // Count how many queries run during the whole instance.
-    private $_query_count = 0;
+    protected $_query_count = 0;
 
     // Hash of DB parameters.
-    private $_params = array();
+    protected $_params = array();
 
     // Default parameters.
-    private $_param_defaults = array(
+    protected $_param_defaults = array(
 
         // DB passwords should be set as apache environment variables in httpd.conf, readable only by root.
@@ -73,6 +73,6 @@
 
     // Caches.
-    private $existing_tables;
-    private $table_columns;
+    protected $existing_tables;
+    protected $table_columns;
 
     /**
@@ -147,4 +147,5 @@
 
         // Connect to database. Always create a new link to the server.
+        // Connection errors are surpressed so we can do our own error management below.
         if ($this->dbh = @mysql_connect($this->getParam('db_server'), $this->getParam('db_user'), $this->getParam('db_pass'), true)) {
             // Select database
@@ -222,9 +223,12 @@
     * @since    15 Jan 2007 15:59:00
     */
-    private function _fail()
+    protected function _fail()
     {
         if ($this->getParam('db_die_on_failure')) {
-            header(' ', true, 503);
-            echo _("This page is temporarily unavailable. Please try again in a few minutes.");
+            if (!defined('_CLI')) {
+                // For http requests, send a Service Unavailable header.
+                header(' ', true, 503);
+                echo _("This page is temporarily unavailable. Please try again in a few minutes.");
+            }
             die;
         } else {
@@ -318,5 +322,7 @@
             $app->logMsg(sprintf('MySQL error %s: %s in query: %s', mysql_errno($this->dbh), mysql_error($this->dbh), $debugqry), LOG_EMERG, __FILE__, __LINE__);
             if ($this->getParam('db_debug')) {
-                echo '<pre style="padding:2em; background:#ddd; font:9px monaco;">' . wordwrap(mysql_error($this->dbh)) . '<hr>' . htmlspecialchars($debugqry) . '</pre>';
+                if (!defined('_CLI')) {
+                    echo '<pre style="padding:2em; background:#ddd; font:9px monaco;">' . wordwrap(mysql_error($this->dbh)) . '<hr>' . htmlspecialchars($debugqry) . '</pre>';
+                }
             }
             // Die if db_die_on_failure = true, or just continue without connection
@@ -355,5 +361,5 @@
             return true;
         } else {
-            $app->logMsg(sprintf('Nonexistent DB table: %s.%s', $this->getParam('db_name'), $table), LOG_ALERT, __FILE__, __LINE__);
+            $app->logMsg(sprintf('Nonexistent DB table: %s.%s', $this->getParam('db_name'), $table), LOG_INFO, __FILE__, __LINE__);
             return false;
         }
Index: /trunk/lib/DBSessionHandler.inc.php
===================================================================
--- /trunk/lib/DBSessionHandler.inc.php	(revision 483)
+++ /trunk/lib/DBSessionHandler.inc.php	(revision 484)
@@ -34,5 +34,5 @@
     public $db; // DB object.
 
-    private $_params = array(
+    protected $_params = array(
         'db_table' => 'session_tbl',
 
Index: /trunk/lib/Email.inc.php
===================================================================
--- /trunk/lib/Email.inc.php	(revision 483)
+++ /trunk/lib/Email.inc.php	(revision 484)
@@ -56,5 +56,5 @@
 
     // Default parameters, to be overwritten by setParam() and read with getParam()
-    private $_params = array(
+    protected $_params = array(
         'to' => null,
         'from' => null,
@@ -74,8 +74,8 @@
 
     // String that contains the email body.
-    private $_template;
+    protected $_template;
 
     // String that contains the email body after replacements.
-    private $_template_replaced;
+    protected $_template_replaced;
 
     /**
Index: /trunk/lib/FormValidator.inc.php
===================================================================
--- /trunk/lib/FormValidator.inc.php	(revision 483)
+++ /trunk/lib/FormValidator.inc.php	(revision 484)
@@ -61,5 +61,5 @@
 
     // Class parameters.
-    private $_params = array(
+    protected $_params = array(
         'error' => ' sc-msg-error ',
         'warning' => ' sc-msg-warning ',
Index: /trunk/lib/Image.inc.php
===================================================================
--- /trunk/lib/Image.inc.php	(revision 483)
+++ /trunk/lib/Image.inc.php	(revision 484)
@@ -31,5 +31,5 @@
 
     // Object parameters.
-    private $_params = array();
+    protected $_params = array();
 
     /**
Index: /trunk/lib/ImageThumb.inc.php
===================================================================
--- /trunk/lib/ImageThumb.inc.php	(revision 483)
+++ /trunk/lib/ImageThumb.inc.php	(revision 484)
@@ -43,5 +43,5 @@
 
     // General object parameters.
-    private $_params = array(
+    protected $_params = array(
         // The location for images to create thumbnails from.
         'source_dir' => null,
@@ -72,5 +72,5 @@
 
     // Default image size specs.
-    private $_default_image_specs = array(
+    protected $_default_image_specs = array(
         // The destination for an image thumbnail size.
         // Use initial / to specify absolute paths, leave off to specify a path relative to source_dir (eg: ../thumbs).
@@ -108,5 +108,5 @@
 
     // Final specifications for image sizes, set with setSpec().
-    private $_image_specs = array();
+    protected $_image_specs = array();
 
     /**
@@ -452,5 +452,5 @@
     * @since    19 May 2006 13:55:46
     */
-    private function _resizeWithNetpbm($source_file, $dest_file, $spec)
+    protected function _resizeWithNetpbm($source_file, $dest_file, $spec)
     {
         $app =& App::getInstance();
@@ -521,5 +521,5 @@
     * @since    19 May 2006 15:46:02
     */
-    private function _resizeWithGD($source_file, $dest_file, $spec)
+    protected function _resizeWithGD($source_file, $dest_file, $spec)
     {
         $app =& App::getInstance();
@@ -754,5 +754,5 @@
      * @return  bool    True on success, false on failure.
      */
-    private function _validFileExtension($file_name)
+    protected function _validFileExtension($file_name)
     {
         preg_match('/.*?\.(\w+)$/i', $file_name, $ext);
@@ -766,5 +766,5 @@
      * @return  bool true on success, false on failure.
      */
-    private function _createDestDirs($filename=null)
+    protected function _createDestDirs($filename=null)
     {
         $app =& App::getInstance();
@@ -824,5 +824,5 @@
      * @param string $line    __LINE__.
      */
-    private function _raiseMsg($message, $type, $file, $line)
+    protected function _raiseMsg($message, $type, $file, $line)
     {
         $app =& App::getInstance();
@@ -844,5 +844,5 @@
      * @since   15 Nov 2005 20:55:22
      */
-    private function _glob($pattern, $directory)
+    protected function _glob($pattern, $directory)
     {
         $file_list = glob(sprintf('%s/%s', $directory, $pattern));
Index: /trunk/lib/JS.inc.php
===================================================================
--- /trunk/lib/JS.inc.php	(revision 483)
+++ /trunk/lib/JS.inc.php	(revision 484)
@@ -32,8 +32,8 @@
 
     // Include these style sheets.
-    private $_js_files = array('default' => array());
+    protected $_js_files = array('default' => array());
 
     // JS object parameters.
-    private $_params = array(
+    protected $_params = array(
         'character_set' => 'utf-8',
         'cache_js' => false,
Index: /trunk/lib/Lock.inc.php
===================================================================
--- /trunk/lib/Lock.inc.php	(revision 483)
+++ /trunk/lib/Lock.inc.php	(revision 484)
@@ -32,8 +32,8 @@
 
     // A place to keep an object instance for the singleton pattern.
-    private static $instance = null;
+    protected static $instance = null;
 
     // Configuration of this object.
-    private $_params = array(
+    protected $_params = array(
         'timeout' => 600,
         'auto_timeout' => 1800,
@@ -47,8 +47,8 @@
 
     // Store lock data from DB.
-    private $data = array();
+    protected $data = array();
 
     // Auth_SQL object from which to access a current user_id.
-    private $_auth;
+    protected $_auth;
 
     /**
@@ -109,5 +109,5 @@
             }
             $db->query("CREATE TABLE IF NOT EXISTS " . $db->escapeString($this->getParam('db_table')) . " (
-                lock_id int NOT NULL auto_increment,
+                lock_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
                 record_table varchar(255) NOT NULL default '',
                 record_key varchar(255) NOT NULL default '',
@@ -116,5 +116,4 @@
                 set_by_admin_id smallint(11) NOT NULL default '0',
                 lock_datetime datetime NOT NULL default '0000-00-00 00:00:00',
-                PRIMARY KEY (lock_id),
                 KEY record_table (record_table),
                 KEY record_key (record_key),
Index: /trunk/lib/Navigation.inc.php
===================================================================
--- /trunk/lib/Navigation.inc.php	(revision 483)
+++ /trunk/lib/Navigation.inc.php	(revision 484)
@@ -37,5 +37,5 @@
 
     // Configuration parameters for this object.
-    private $_params = array(
+    protected $_params = array(
         'head_title' => true,
         'body_title' => true,
Index: /trunk/lib/PEdit.inc.php
===================================================================
--- /trunk/lib/PEdit.inc.php	(revision 483)
+++ /trunk/lib/PEdit.inc.php	(revision 484)
@@ -70,5 +70,5 @@
 
     // PEdit object parameters.
-    private $_params = array(
+    protected $_params = array(
         'data_dir' => '',
         'character_set' => 'utf-8',
@@ -77,8 +77,8 @@
     );
 
-    private $_data = array(); // Array to store loaded data.
-    private $_data_file = ''; // Full file path to the pedit data file.
-    private $_authorized = false; // User is authenticated to see extended functions.
-    private $_data_loaded = false;
+    protected $_data = array(); // Array to store loaded data.
+    protected $_data_file = ''; // Full file path to the pedit data file.
+    protected $_authorized = false; // User is authenticated to see extended functions.
+    protected $_data_loaded = false;
     public $op = '';
 
@@ -442,5 +442,5 @@
     * @since    12 Apr 2006 10:52:35
     */
-    private function _fileHash()
+    protected function _fileHash()
     {
         $app =& App::getInstance();
@@ -457,5 +457,5 @@
     * @since    11 Apr 2006 20:36:26
     */
-    private function _loadDataFile()
+    protected function _loadDataFile()
     {
         $app =& App::getInstance();
@@ -496,5 +496,5 @@
     * @since    11 Apr 2006 20:53:42
     */
-    private function _initializeDataFile()
+    protected function _initializeDataFile()
     {
         $app =& App::getInstance();
@@ -512,5 +512,5 @@
      * @return bool  False if unauthorized or on failure. True on success.
      */
-    private function _writeData()
+    protected function _writeData()
     {
         $app =& App::getInstance();
@@ -560,5 +560,5 @@
     * @since    11 Apr 2006 22:48:30
     */
-    private function _filePutContents($filename, $content)
+    protected function _filePutContents($filename, $content)
     {
         $app =& App::getInstance();
@@ -610,5 +610,5 @@
      * @return bool  False on failure. True on success.
      */
-    private function _createVersion()
+    protected function _createVersion()
     {
         $app =& App::getInstance();
@@ -648,5 +648,5 @@
     * @since    12 Apr 2006 11:08:11
     */
-    private function _deleteOldVersions()
+    protected function _deleteOldVersions()
     {
         $app =& App::getInstance();
@@ -676,5 +676,5 @@
      * @return array  Array of versions.
      */
-    private function _getVersions()
+    protected function _getVersions()
     {
         $version_files = array();
@@ -707,5 +707,5 @@
      * @return bool  False on failure. True on success.
      */
-    private function _restoreVersion($version)
+    protected function _restoreVersion($version)
     {
         $app =& App::getInstance();
Index: /trunk/lib/PageNumbers.inc.php
===================================================================
--- /trunk/lib/PageNumbers.inc.php	(revision 483)
+++ /trunk/lib/PageNumbers.inc.php	(revision 484)
@@ -45,6 +45,6 @@
     public $last_item;         // The counter for the last item on this page (zero index).
     public $max_num_links = 9; // The max number of links to show on page (odd numbers look best).
-    private $_num_links;        // The number of links to show on page.
-    private $_per_page = 25;    // Items per page.
+    protected $_num_links;        // The number of links to show on page.
+    protected $_per_page = 25;    // Items per page.
 
     // Flags to ensure all necessary values have been set before calling calculate().
Index: /trunk/lib/PageSequence.inc.php
===================================================================
--- /trunk/lib/PageSequence.inc.php	(revision 483)
+++ /trunk/lib/PageSequence.inc.php	(revision 484)
@@ -342,5 +342,5 @@
      * Deletes all data that are older than auto_timeout. Set current time if not not expired or not set.
      */
-    private function _auto_timeout()
+    protected function _auto_timeout()
     {
         $app =& App::getInstance();
Index: /trunk/lib/PayPal.inc.php
===================================================================
--- /trunk/lib/PayPal.inc.php	(revision 483)
+++ /trunk/lib/PayPal.inc.php	(revision 484)
@@ -33,5 +33,5 @@
 
     // General object parameters.
-    private $_params = array(
+    protected $_params = array(
         'paypal_url' => 'https://www.paypal.com/cgi-bin/webscr',
         'test_mode' => false,
@@ -39,11 +39,11 @@
 
     // Options used for specific buttons and links.
-    private $_default_button_options = array();
+    protected $_default_button_options = array();
 
     // Array of buttons created by newButton().
-    private $_buttons = array();
+    protected $_buttons = array();
 
     // Store the response from the last IPN.
-    private $_ipn_response;
+    protected $_ipn_response;
 
     /**
Index: /trunk/lib/Prefs.inc.php
===================================================================
--- /trunk/lib/Prefs.inc.php	(revision 483)
+++ /trunk/lib/Prefs.inc.php	(revision 484)
@@ -55,8 +55,8 @@
 
     // Namespace of this instance of Prefs.
-    private $_ns;
+    protected $_ns;
 
     // Configuration parameters for this object.
-    private $_params = array(
+    protected $_params = array(
 
         // Store preferences in one of the available storage mechanisms: session, cookie, database
@@ -497,5 +497,5 @@
     * @since    04 Jun 2006 17:12:44
     */
-    private function _isLoaded()
+    protected function _isLoaded()
     {
         if ('database' != $this->getParam('storagetype')) {
@@ -584,5 +584,5 @@
     * @since    02 May 2014 18:17:04
     */
-    private function _getCookieName($key)
+    protected function _getCookieName($key)
     {
         $app =& App::getInstance();
Index: /trunk/lib/ScriptTimer.inc.php
===================================================================
--- /trunk/lib/ScriptTimer.inc.php	(revision 483)
+++ /trunk/lib/ScriptTimer.inc.php	(revision 484)
@@ -27,7 +27,7 @@
 
     public $time_format = '%.3f';
-    private $_timing_start_times = array();
-    private $_timing_stop_times = array();
-    private $_timing_cumulative_times = array();
+    protected $_timing_start_times = array();
+    protected $_timing_stop_times = array();
+    protected $_timing_cumulative_times = array();
     
     public function start($name='default')
Index: /trunk/lib/SortOrder.inc.php
===================================================================
--- /trunk/lib/SortOrder.inc.php	(revision 483)
+++ /trunk/lib/SortOrder.inc.php	(revision 484)
@@ -37,5 +37,5 @@
 class SortOrder {
 
-    private $_columns;
+    protected $_columns;
     public $sort_by;
     public $order;
Index: /trunk/lib/SpellCheck.inc.php
===================================================================
--- /trunk/lib/SpellCheck.inc.php	(revision 483)
+++ /trunk/lib/SpellCheck.inc.php	(revision 484)
@@ -61,5 +61,5 @@
 class SpellCheck {
 
-    private $_params = array(
+    protected $_params = array(
         'language' => 'en',
         'personal_wordlist' => '', // Text file to save custom words to.
@@ -70,8 +70,8 @@
     );
 
-    private $_pspell_cfg_handle;
-    private $_pspell_handle;
-    private $_use_personal_wordlist = false;
-    private $_errors = array();
+    protected $_pspell_cfg_handle;
+    protected $_pspell_handle;
+    protected $_use_personal_wordlist = false;
+    protected $_errors = array();
 
     /**
Index: /trunk/lib/Upload.inc.php
===================================================================
--- /trunk/lib/Upload.inc.php	(revision 483)
+++ /trunk/lib/Upload.inc.php	(revision 484)
@@ -41,5 +41,5 @@
 
     // General object parameters.
-    private $_params = array(
+    protected $_params = array(
 
         // Which messages do we pass to raiseMsg?
Index: /trunk/lib/Version.inc.php
===================================================================
--- /trunk/lib/Version.inc.php	(revision 483)
+++ /trunk/lib/Version.inc.php	(revision 484)
@@ -40,8 +40,8 @@
 
     // A place to keep an object instance for the singleton pattern.
-    private static $instance = null;
+    protected static $instance = null;
 
     // Configuration of this object.
-    private $_params = array(
+    protected $_params = array(
         'max_qty' => 100, // Never have more than this many versions of each record.
         'min_qty' => 25, // Keep at least this many versions of each record.
@@ -57,5 +57,5 @@
 
     // Auth_SQL object from which to access a current user_id.
-    private $_auth;
+    protected $_auth;
 
     /**
@@ -116,5 +116,5 @@
             }
             $db->query("CREATE TABLE IF NOT EXISTS " . $db->escapeString($this->getParam('db_table')) . " (
-                version_id INT NOT NULL AUTO_INCREMENT,
+                version_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
                 record_table VARCHAR(255) NOT NULL DEFAULT '',
                 record_key VARCHAR(255) NOT NULL DEFAULT '',
@@ -126,5 +126,4 @@
                 saved_by_user_id SMALLINT(11) NOT NULL DEFAULT '0',
                 version_datetime DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
-                PRIMARY KEY (version_id),
                 KEY record_table (record_table),
                 KEY record_key (record_key),
