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

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

module_maker _config.inc.php now tests for no arguments

File size: 1.2 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
9if (2 == $_SERVER['argc'] && '' != $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: Single argument must be the directory path to an existing site (ex: /home/sc/www.strangecode.com).\n");
14}
15
16// Set include path.
17ini_set('include_path', get_include_path()
18    . PATH_SEPARATOR . COMMON_BASE
19);
20
21// Include core libraries.
22require_once 'codebase/lib/App.inc.php';
23require_once 'codebase/lib/Utilities.inc.php';
24require_once 'codebase/lib/Auth_SQL.inc.php';
25
26$app =& App::getInstance('module_maker');
27
28$app->setParam(array(
29    'site_name' => 'Module Maker',
30    'site_email' => 'codebase@strangecode.com',
31    'enable_session' => false,
32    'enable_db' => true,
33    'db_always_debug' => false,
34    'db_debug' => true,
35    'db_die_on_failure' => true,
36    'display_errors' => true,
37    'error_reporting' => E_ALL,
38    'log_screen_priority' => LOG_DEBUG,
39));
40
41require_once 'global/db_auth.inc.php';
42
43$app->start();
44
45?>
Note: See TracBrowser for help on using the repository browser.