Index: trunk/docs/examples/_config.inc.php
===================================================================
--- trunk/docs/examples/_config.inc.php	(revision 288)
+++ trunk/docs/examples/_config.inc.php	(revision 295)
@@ -1,12 +1,11 @@
 <?php
-/**
- * _config.inc.php lives in the document root of the site/application. It is the beginning of everything.
+/** * _config.inc.php lives in the document root of the site/application. It is the beginning of everything.
  *
  * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information.
  * @author  Quinn Comendant <quinn@strangecode.com>
- * @version 1.2
+ * @version 1.3
  * @since   03 Dec 2005 19:09:32
  */
-
+ 
 // The constant __FILE__ must be an absolute directory path, starting with / on unix or C: on windows.
 // To work around a PHP bug always include this config file with: require_once dirname(__FILE__) . '/_config.inc.php';
@@ -19,9 +18,9 @@
 define('COMMON_BASE', realpath(dirname(__FILE__) . '/../'));
 
-// The DocRoot for this application. SITE_BASE is ifferent from $_SERVER['DOCUMENT_ROOT'] because the
+// The DocRoot for this application. SITE_BASE is different from $_SERVER['DOCUMENT_ROOT'] because the 
 // latter does not change when using the apache Alias directive or URL Rewriting to define a site.
 define('SITE_BASE', dirname(__FILE__));
 
-// Set include path for all tempates.
+// Set include path for all templates.
 ini_set('include_path', join(PATH_SEPARATOR, array(
     COMMON_BASE,
@@ -32,11 +31,10 @@
 // Include core libraries.
 require_once 'codebase/lib/Utilities.inc.php';
-require_once 'codebase/lib/Auth_SQL.inc.php';
 require_once 'codebase/lib/App.inc.php';
 
 // Primary application class.
-$app =& App::getInstance('example.org');
+$app =& App::getInstance('public');
 $app->setParam(array(
-    'site_name' => 'My example site',
+    'site_name' => 'WWW Public Site',
     'site_email' => 'hello@example.com',
     'redirect_home_url' => '/',
@@ -47,13 +45,17 @@
     'character_set' => 'utf-8',
 
-    'enable_session' => false,
+    'enable_session' => true,
     'enable_db_session_handler' => false,
     'session_use_cookies' => true,
+    'session_use_trans_sid' => true, // Disable this for high-security sites where session-ID theft is a risk.
 
-    'enable_db' => false,
+    // 'ssl_domain' => 'www.example.com',
+    // 'ssl_enabled' => ($_SERVER['SERVER_NAME'] == 'www.example.com'),
+
+    'enable_db' => true,
     'db_always_debug' => false,
     'db_debug' => true,
     'db_die_on_failure' => true,
-    'db_create_tables' => true, /// Disable after site launch.
+    'db_create_tables' => true, // Disable after site launch.
 
     'display_errors' => true,
@@ -65,11 +67,14 @@
     'log_sms_priority' => false,
     'log_screen_priority' => false,
-    'log_to_email_address' => 'log@example.com',
-    'log_to_sms_address' => 'sms@example.com',
+    'log_to_email_address' => 'log@strangecode.com',
+    'log_to_sms_address' => 'sms-quinn@strangecode.com',
 ));
-// DB credentials for command line scripts stored in a file with read rights
-// given only to the user who will be executing the scripts: -rw-------
-// This file includes $app-> method calls so must be included after App.
-// require_once 'global/db_auth.inc.php';
+
+if (defined('_CLI')) {
+    // DB credentials for command line scripts stored in a file with read rights
+    // given only to the user who will be executing the scripts: -rw-------
+    // This file includes $app-> method calls so this must be included after App::getInstance().
+    require_once 'global/db_auth.inc.php';
+}
 
 // Start application-based functionality: database, session, environment, ini setup, etc.
@@ -77,24 +82,57 @@
 $app->start();
 
-// Global DB object. Automatically preconfigured by $app->start().
+// Global DB object. Automatically pre-configured by $app->start().
 $db =& DB::getInstance();
 
-// User authentication.
-$auth = new Auth_SQL('user');
+// Global Auth object.
+require_once 'codebase/lib/Auth_SQL.inc.php';
+$auth = new Auth_SQL('public');
 $auth->setParam(array(
     'db_table'          => 'user_tbl',
     'db_primary_key'    => 'user_id',
-    'login_url'         => '/login.php'
+    'login_url'         => '/login.php',
+    'login_timeout' => 260000, // 72 hours
+    'idle_timeout' => 86400, // 24 hours
 ));
 
-// Set CSS files.
+// Load preferences for the user.
+require_once 'codebase/lib/Prefs.inc.php';
+$prefs = new Prefs('permanent');
+$prefs->setParam(array(
+    'persistent' => $auth->isLoggedIn(),
+    'user_id' => $auth->get('user_id'),
+));
+$prefs->setDefaults(array(
+));
+$prefs->load();
+// Temporary prefs.
+$tmp_prefs = new Prefs('temporary');
+$tmp_prefs->setDefaults(array(
+));
+
+// Global record-locking object.
+require_once 'codebase/lib/Lock.inc.php';
+$lock =& Lock::getInstance($auth);
+$lock->setParam(array(
+    'timeout' => 0,
+    'auto_timeout' => 1800,
+    'error_url' => '/lock.php',
+));
+
+// Global cache object.
+require_once 'codebase/lib/Cache.inc.php';
+$cache = new Cache('global');
+$cache->setParam(array('enabled' => true));
+
+// Setup CSS files to include. These will always be available.
 require_once 'codebase/lib/CSS.inc.php';
 $css = new CSS();
-$css->setParam(array('cache_css' => true));
+$css->setParam(array('cache_css' => false)); /// Enable caching after site launch.
 $css->setFile('codebase/css/codebase.inc.css');
 $css->setFile('codebase/css/utilities.inc.css');
-$css->setFile('html/css/screen.inc.css');
+// $css->setFile('html/css/screen.inc.css');
 
-// Global navigation elements object.
+// Nav class for titles, breadcrumbs, and page features.
+// Global navigation titles, breadcrumbs, and page features.
 require_once 'codebase/lib/Navigation.inc.php';
 $nav = new Navigation(array(
@@ -103,3 +141,7 @@
 ));
 
+// Global site-specific configuration.
+// $cfg = array();
+// require_once 'global/config.inc.php';
+
 ?>
