Changeset 27 for trunk/docs
- Timestamp:
- Dec 4, 2005 3:18:03 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/example_config.inc.php
r26 r27 1 1 <?php 2 2 /** 3 * _config.inc.php lives in the document root of yoursite/application. It is the beginning of everything.3 * _config.inc.php lives in the document root of the site/application. It is the beginning of everything. 4 4 * 5 5 * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information. 6 6 * @author Quinn Comendant <quinn@strangecode.com> 7 * @version 1. 08 * @since 2005-08-307 * @version 1.2 8 * @since 03 Dec 2005 19:09:32 9 9 */ 10 10 11 // __FILE__ must be an absolute directory path, starting with / on unix and X: on windows. 12 if (!preg_match('!^/|^[A-Z]:!', __FILE__)) { 11 // The constant __FILE__ must be an absolute directory path, starting with / on unix or C: on windows. 12 // To work around a PHP bug always include this config file with: require_once dirname(__FILE__) . '/_config.inc.php'; 13 if (!preg_match('!^(/|[A-Z]:)!', __FILE__)) { 13 14 trigger_error('_config.inc.php include must be specified with an absolute file path (eg: "require_once dirname(__FILE__) . \'/_config.inc.php\';"', E_USER_ERROR); 14 15 } 15 16 17 // First things first. Define the globally used directory paths. 18 // The parent directory of all application DocRoots. 16 19 define('COMMON_BASE', realpath(dirname(__FILE__) . '/../')); 17 define('CODE_BASE', COMMON_BASE . '/codebase'); 20 21 // The DocRoot for this application. SITE_BASE is ifferent from $_SERVER['DOCUMENT_ROOT'] because the 22 // latter does not change when using the apache Alias directive or URL Rewriting to define a site. 18 23 define('SITE_BASE', dirname(__FILE__)); 19 24 20 // Set include path .25 // Set include path for all tempates. 21 26 ini_set('include_path', get_include_path() 22 27 . PATH_SEPARATOR . COMMON_BASE … … 25 30 26 31 // Include core libraries. 27 require_once 'codebase/lib/App.inc.php';28 32 require_once 'codebase/lib/Utilities.inc.php'; 29 33 require_once 'codebase/lib/Auth_SQL.inc.php'; 34 require_once 'codebase/lib/App.inc.php'; 30 35 36 // Primary application class. 31 37 $app =& App::getInstance('admin'); 32 33 38 $app->setParam(array( 34 39 'site_name' => 'WWW Admin', … … 42 47 43 48 'enable_session' => true, 44 'enable_db_session_handler' => true,49 'enable_db_session_handler' => false, 45 50 'session_use_cookies' => true, 46 51 … … 49 54 'db_debug' => true, 50 55 'db_die_on_failure' => true, 56 'db_create_tables' => true, /// Disable after site launch. 51 57 52 58 'display_errors' => true, … … 61 67 'log_to_sms_address' => 'sms@example.com', 62 68 )); 63 69 // DB credentials for command line scripts stored in a file with read rights 70 // given only to the user who will be executing the scripts: -rw------- 71 // This file includes App:: method calls so must be included after App. 64 72 require_once 'global/db_auth.inc.php'; 65 73 74 // Most configuration parameters must be set before starting the App. 66 75 $app->start(); 67 76 68 77 // User authentication. 69 78 $auth = new Auth_SQL('admin'); 70 79 $auth->setParam(array( … … 74 83 )); 75 84 76 // Set up CSS files to include. These will always be available.85 // Set CSS files. 77 86 require_once 'codebase/lib/CSS.inc.php'; 78 87 $css = new CSS(); 79 88 $css->setParam(array('cache_css' => true)); 80 $css->setFile(CODE_BASE . '/css/depreciated.inc.css'); 81 $css->setFile(CODE_BASE . '/css/codebase.inc.css'); 82 $css->setFile(CODE_BASE . '/css/utilities.inc.css'); 83 $css->setFile(CODE_BASE . '/css/admin.inc.css'); 89 $css->setFile('codebase/css/codebase.inc.css'); 90 $css->setFile('codebase/css/utilities.inc.css'); 91 $css->setFile('codebase/css/admin.inc.css'); 84 92 93 // Nav class for titles, breadcrumbs, and page features. 85 94 require_once 'codebase/lib/Nav.inc.php'; 86 95 $nav = new Nav();
Note: See TracChangeset
for help on using the changeset viewer.