source: trunk/docs/example_config.inc.php @ 10

Last change on this file since 10 was 10, checked in by scdev, 19 years ago

update module_maker to print module variables instead of writing files

File size: 2.6 KB
Line 
1<?php
2/**
3 * _config.inc.php lives in the document root of your site/application. It is the beginning of everything.
4 *
5 * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information.
6 * @author  Quinn Comendant <quinn@strangecode.com>
7 * @version 1.0
8 * @since   2005-08-30
9 */
10
11// __FILE__ must be an absolute directory path, starting with / on unix and X: on windows.
12if (!preg_match('!^/|^[A-Z]:!', __FILE__)) {
13    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
16define('COMMON_BASE', realpath(dirname(__FILE__) . '/../'));
17define('CODE_BASE', COMMON_BASE . '/codebase');
18define('SITE_BASE', dirname(__FILE__));
19
20// Set include path.
21ini_set('include_path', get_include_path()
22    . PATH_SEPARATOR . COMMON_BASE
23    . PATH_SEPARATOR . SITE_BASE . '/_templates'
24);
25
26// Include core libraries.
27require_once 'codebase/lib/App.inc.php';
28require_once 'codebase/lib/Utilities.inc.php';
29require_once 'codebase/lib/Auth_SQL.inc.php';
30
31$app =& App::getInstance('admin');
32
33$app->setParam(array(
34    'site_name' => 'WWW Admin',
35    'site_email' => 'hello@example.com',
36    'redirect_home_url' => '/admin/',
37
38    'date_format' => 'd M Y',
39    'sql_date_format' => '%e %b %Y',
40    'sql_time_format' => '%k:%i',
41    'character_set' => 'utf-8',
42
43    'enable_session' => true,
44    'enable_db_session_handler' => true,
45    'session_use_cookies' => true,
46
47    'enable_db' => true,
48    'db_always_debug' => false,
49    'db_debug' => true,
50    'db_die_on_failure' => true,
51
52    'display_errors' => true,
53
54    'log_directory' => COMMON_BASE . '/log',
55    'log_filename' => 'admin_log',
56    'log_file_priority' => LOG_DEBUG,
57    'log_email_priority' => false,
58    'log_sms_priority' => false,
59    'log_screen_priority' => false,
60    'log_to_email_address' => 'log@example.com',
61    'log_to_sms_address' => 'sms@example.com',
62));
63
64require_once 'global/db_auth.inc.php';
65
66$app->start();
67
68
69$auth = new Auth_SQL('admin');
70$auth->setParam(array(
71    'db_table'          => 'admin_tbl',
72    'db_primary_key'    => 'admin_id',
73    'login_url'         => '/admin/login.php'
74));
75
76// Setup CSS files to include. These will always be available.
77require_once 'codebase/lib/CSS.inc.php';
78$css = new CSS();
79$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');
84
85require_once 'codebase/lib/Nav.inc.php';
86$nav = new Nav();
87$nav->path_delimiter = ' / ';
88$nav->last_crumb_format = '<b>%s</b>';
89
90?>
Note: See TracBrowser for help on using the repository browser.