source: trunk/bin/module_maker/_config.inc.php @ 19

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

Rebuilt the services/admins.php script and templates. Fixes since v2 conversion. Lots of bugs and more to come!

File size: 1.5 KB
Line 
1<?php
2/* module_maker/_config.inc.php
3 * code by strangecode :: www.strangecode.com :: this document contains copyrighted information. */
4
5// Determine common site directory.
6$common_base = realpath($_SERVER['argv'][1]);
7
8// Test argument.
9if ($_SERVER['argc'] > 1 && '' != $common_base && is_dir($common_base)) {
10    // First arg is path to current site. Realpath removes trailing /s
11    define('COMMON_BASE', $common_base);
12} else {
13    die("Error: First argument must be the directory path to an existing site (ex: /home/sc/www.strangecode.com).\n");
14}
15
16// Make sure necessary files exist.
17if (!file_exists(COMMON_BASE . '/global/db_auth.inc.php')) {
18    die("Error: First argument directory must contain the global/db_auth.inc.php file with valid MySQL credentials.\n");
19}
20
21// Set include path.
22ini_set('include_path', get_include_path()
23    . PATH_SEPARATOR . COMMON_BASE
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('module_maker');
32
33$app->setParam(array(
34    'site_name' => 'Module Maker',
35    'site_email' => 'codebase@strangecode.com',
36    'enable_session' => false,
37    'enable_db' => true,
38    'db_always_debug' => false,
39    'db_debug' => true,
40    'db_die_on_failure' => true,
41    'display_errors' => true,
42    'error_reporting' => E_ALL,
43    'log_screen_priority' => LOG_DEBUG,
44));
45
46require_once 'global/db_auth.inc.php';
47
48$app->start();
49
50?>
Note: See TracBrowser for help on using the repository browser.