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

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

added example_config.inc.php

File size: 2.5 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
11if (!preg_match('!^/!', __FILE__)) {
12    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);
13}
14
15define('COMMON_BASE', realpath(dirname(__FILE__) . '/../'));
16define('CODE_BASE', COMMON_BASE . '/codebase');
17define('SITE_BASE', dirname(__FILE__));
18
19// Set include path.
20ini_set('include_path', get_include_path()
21    . PATH_SEPARATOR . COMMON_BASE
22    . PATH_SEPARATOR . SITE_BASE . '/_templates'
23);
24
25// Include core libraries.
26require_once 'codebase/lib/App.inc.php';
27require_once 'codebase/lib/Utilities.inc.php';
28require_once 'codebase/lib/Auth_SQL.inc.php';
29
30$app =& App::getInstance('admin');
31
32$app->setParam(array(
33    'site_name' => 'WWW Admin',
34    'site_email' => 'hello@example.com',
35    'redirect_home_url' => '/admin/',
36
37    'date_format' => 'd M Y',
38    'sql_date_format' => '%e %b %Y',
39    'sql_time_format' => '%k:%i',
40    'character_set' => 'utf-8',
41
42    'enable_session' => true,
43    'enable_db_session_handler' => true,
44    'session_use_cookies' => true,
45
46    'enable_db' => true,
47    'db_always_debug' => false,
48    'db_debug' => true,
49    'db_die_on_failure' => true,
50
51    'display_errors' => true,
52
53    'log_directory' => COMMON_BASE . '/log',
54    'log_filename' => 'admin_log',
55    'log_file_priority' => LOG_DEBUG,
56    'log_email_priority' => false,
57    'log_sms_priority' => false,
58    'log_screen_priority' => false,
59    'log_to_email_address' => 'log@example.com',
60    'log_to_sms_address' => 'sms@example.com',
61));
62
63require_once 'global/db_auth.inc.php';
64
65$app->start();
66
67
68$auth = new Auth_SQL('admin');
69$auth->setParam(array(
70    'db_table'          => 'admin_tbl',
71    'db_primary_key'    => 'admin_id',
72    'login_url'         => '/admin/login.php'
73));
74
75// Setup CSS files to include. These will always be available.
76require_once 'codebase/lib/CSS.inc.php';
77$css = new CSS();
78$css->setParam(array('cache_css' => true));
79$css->setFile(CODE_BASE . '/css/depreciated.inc.css');
80$css->setFile(CODE_BASE . '/css/codebase.inc.css');
81$css->setFile(CODE_BASE . '/css/utilities.inc.css');
82$css->setFile(CODE_BASE . '/css/admin.inc.css');
83
84require_once 'codebase/lib/Nav.inc.php';
85$nav = new Nav();
86$nav->path_delimiter = ' / ';
87$nav->last_crumb_format = '<b>%s</b>';
88
89?>
Note: See TracBrowser for help on using the repository browser.