[1] | 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. |
---|
[10] | 6 | $common_base = realpath($_SERVER['argv'][1]); |
---|
| 7 | |
---|
[19] | 8 | // Test argument. |
---|
| 9 | if ($_SERVER['argc'] > 1 && '' != $common_base && is_dir($common_base)) { |
---|
[1] | 10 | // First arg is path to current site. Realpath removes trailing /s |
---|
| 11 | define('COMMON_BASE', $common_base); |
---|
| 12 | } else { |
---|
[19] | 13 | die("Error: First argument must be the directory path to an existing site (ex: /home/sc/www.strangecode.com).\n"); |
---|
[1] | 14 | } |
---|
| 15 | |
---|
[19] | 16 | // Make sure necessary files exist. |
---|
| 17 | if (!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 | |
---|
[1] | 21 | // Set include path. |
---|
| 22 | ini_set('include_path', get_include_path() |
---|
| 23 | . PATH_SEPARATOR . COMMON_BASE |
---|
| 24 | ); |
---|
| 25 | |
---|
| 26 | // Include core libraries. |
---|
| 27 | require_once 'codebase/lib/App.inc.php'; |
---|
| 28 | require_once 'codebase/lib/Utilities.inc.php'; |
---|
| 29 | require_once 'codebase/lib/Auth_SQL.inc.php'; |
---|
| 30 | |
---|
| 31 | $app =& App::getInstance('module_maker'); |
---|
| 32 | |
---|
| 33 | $app->setParam(array( |
---|
| 34 | 'site_name' => 'Module Maker', |
---|
[10] | 35 | 'site_email' => 'codebase@strangecode.com', |
---|
[1] | 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 | |
---|
| 46 | require_once 'global/db_auth.inc.php'; |
---|
| 47 | |
---|
| 48 | $app->start(); |
---|
| 49 | |
---|
| 50 | ?> |
---|