1 && '' != $common_base && is_dir($common_base)) { // First arg is path to current site. Realpath removes trailing /s define('COMMON_BASE', $common_base); } else { die("Error: First argument must be the directory path to an existing site (ex: /home/sc/www.strangecode.com).\n"); } // Make sure necessary files exist. if (!file_exists(COMMON_BASE . '/global/db_auth.inc.php')) { die("Error: First argument directory must contain the global/db_auth.inc.php file with valid MySQL credentials.\n"); } // Set include path. ini_set('include_path', get_include_path() . PATH_SEPARATOR . COMMON_BASE ); // Include core libraries. require_once 'codebase/lib/App.inc.php'; require_once 'codebase/lib/Utilities.inc.php'; require_once 'codebase/lib/Auth_SQL.inc.php'; $app =& App::getInstance('module_maker'); $app->setParam(array( 'site_name' => 'Module Maker', 'site_email' => 'codebase@strangecode.com', 'enable_session' => false, 'enable_db' => true, 'db_always_debug' => false, 'db_debug' => true, 'db_die_on_failure' => true, 'display_errors' => true, 'error_reporting' => E_ALL, 'log_screen_priority' => LOG_DEBUG, )); require_once 'global/db_auth.inc.php'; $app->start(); ?>