Changeset 27 for trunk/docs


Ignore:
Timestamp:
Dec 4, 2005 3:18:03 AM (18 years ago)
Author:
scdev
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/example_config.inc.php

    r26 r27  
    11<?php
    22/**
    3  * _config.inc.php lives in the document root of your site/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.
    44 *
    55 * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information.
    66 * @author  Quinn Comendant <quinn@strangecode.com>
    7  * @version 1.0
    8  * @since   2005-08-30
     7 * @version 1.2
     8 * @since   03 Dec 2005 19:09:32
    99 */
    1010
    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';
     13if (!preg_match('!^(/|[A-Z]:)!', __FILE__)) {
    1314    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);
    1415}
    1516
     17// First things first. Define the globally used directory paths.
     18// The parent directory of all application DocRoots.
    1619define('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.
    1823define('SITE_BASE', dirname(__FILE__));
    1924
    20 // Set include path.
     25// Set include path for all tempates.
    2126ini_set('include_path', get_include_path()
    2227    . PATH_SEPARATOR . COMMON_BASE
     
    2530
    2631// Include core libraries.
    27 require_once 'codebase/lib/App.inc.php';
    2832require_once 'codebase/lib/Utilities.inc.php';
    2933require_once 'codebase/lib/Auth_SQL.inc.php';
     34require_once 'codebase/lib/App.inc.php';
    3035
     36// Primary application class.
    3137$app =& App::getInstance('admin');
    32 
    3338$app->setParam(array(
    3439    'site_name' => 'WWW Admin',
     
    4247
    4348    'enable_session' => true,
    44     'enable_db_session_handler' => true,
     49    'enable_db_session_handler' => false,
    4550    'session_use_cookies' => true,
    4651
     
    4954    'db_debug' => true,
    5055    'db_die_on_failure' => true,
     56    'db_create_tables' => true, /// Disable after site launch.
    5157
    5258    'display_errors' => true,
     
    6167    'log_to_sms_address' => 'sms@example.com',
    6268));
    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.
    6472require_once 'global/db_auth.inc.php';
    6573
     74// Most configuration parameters must be set before starting the App.
    6675$app->start();
    6776
    68 
     77// User authentication.
    6978$auth = new Auth_SQL('admin');
    7079$auth->setParam(array(
     
    7483));
    7584
    76 // Setup CSS files to include. These will always be available.
     85// Set CSS files.
    7786require_once 'codebase/lib/CSS.inc.php';
    7887$css = new CSS();
    7988$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');
    8492
     93// Nav class for titles, breadcrumbs, and page features.
    8594require_once 'codebase/lib/Nav.inc.php';
    8695$nav = new Nav();
Note: See TracChangeset for help on using the changeset viewer.