* @version 1.2 * @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'; if (!preg_match('!^(/|[A-Z]:)!', __FILE__)) { 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); } // First things first. Define the globally used directory paths. // The parent directory of all application DocRoots. define('COMMON_BASE', realpath(dirname(__FILE__) . '/../')); // The DocRoot for this application. SITE_BASE is ifferent 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. ini_set('include_path', get_include_path() . PATH_SEPARATOR . COMMON_BASE . PATH_SEPARATOR . SITE_BASE . '/_templates' ); // 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('admin'); $app->setParam(array( 'site_name' => 'WWW Admin', 'site_email' => 'hello@example.com', 'redirect_home_url' => '/admin/', 'date_format' => 'd M Y', 'sql_date_format' => '%e %b %Y', 'sql_time_format' => '%k:%i', 'character_set' => 'utf-8', 'enable_session' => true, 'enable_db_session_handler' => false, 'session_use_cookies' => true, 'enable_db' => true, 'db_always_debug' => false, 'db_debug' => true, 'db_die_on_failure' => true, 'db_create_tables' => true, /// Disable after site launch. 'display_errors' => true, 'log_directory' => COMMON_BASE . '/log', 'log_filename' => 'admin_log', 'log_file_priority' => LOG_DEBUG, 'log_email_priority' => false, 'log_sms_priority' => false, 'log_screen_priority' => false, 'log_to_email_address' => 'log@example.com', 'log_to_sms_address' => 'sms@example.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'; // Most configuration parameters must be set before starting the App. $app->start(); // User authentication. $auth = new Auth_SQL('admin'); $auth->setParam(array( 'db_table' => 'admin_tbl', 'db_primary_key' => 'admin_id', 'login_url' => '/admin/login.php' )); // Set CSS files. require_once 'codebase/lib/CSS.inc.php'; $css = new CSS(); $css->setParam(array('cache_css' => true)); $css->setFile('codebase/css/codebase.inc.css'); $css->setFile('codebase/css/utilities.inc.css'); $css->setFile('codebase/css/admin.inc.css'); // Nav class for titles, breadcrumbs, and page features. require_once 'codebase/lib/Nav.inc.php'; $nav = new Nav(); $nav->path_delimiter = ' / '; $nav->last_crumb_format = '%s'; ?>