/**
  * The constructor.
  */
 public function __construct(Database $db, $logCategory = null, $checkForUpgrades = true)
 {
     //assign the database object.
     if (is_object($db)) {
         $this->db = $db;
     } else {
         throw new exception(__METHOD__ . ":: invalid database object");
     }
     $this->set_version_file_location(__DIR__ . '/../VERSION');
     parent::__construct(true);
     //see if there's an upgrade to perform...
     if ($checkForUpgrades === true) {
         $this->suspendLogging = true;
         $upgObj = new cs_webdbupgrade(__DIR__ . '/../VERSION', __DIR__ . '/../upgrades/upgrade.ini', $db);
         $upgObj->check_versions(true);
         $this->suspendLogging = false;
         $this->handle_suspended_logs();
     }
     //assign the category_id.
     if (strlen($logCategory)) {
         if (!is_numeric($logCategory)) {
             //attempt to retreive the logCategoryId (assuming they passed a name)
             $this->logCategoryId = $this->get_category_id($logCategory);
         } else {
             //it was numeric: set it!
             $this->logCategoryId = $logCategory;
         }
     }
     //check for a uid in the session.
     $this->defaultUid = $this->get_uid();
     //build our cache.
     $this->build_cache();
 }
 /**
  * Constructor (must be called from extending class)
  * 
  * @param $db	(cs_phpDB) database object
  */
 function __construct(cs_phpDB $db)
 {
     $this->set_version_file_location(dirname(__FILE__) . '/../VERSION');
     $this->gfObj = new cs_globalFunctions();
     // TODO: this makes the site take ~6x longer to load (3 seconds vs. 0.5 seconds)... enable once it's optimized
     $upg = new cs_webdbupgrade(dirname(__FILE__) . '/../VERSION', dirname(__FILE__) . '/../upgrades/upgrade.ini', $db);
     $upg->check_versions(true);
     //check that some required constants exist.
     if (!defined('CSBLOG_TITLE_MINLEN')) {
         define('CSBLOG_TITLE_MINLEN', 4);
     }
     $this->db = $db;
 }
 public function reconnect_db()
 {
     return parent::reconnect_db();
 }