* Copyright 2001-2012 Strangecode, LLC * * This file is part of The Strangecode Codebase. * * The Strangecode Codebase is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your option) * any later version. * * The Strangecode Codebase is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * The Strangecode Codebase. If not, see . */ /* module_maker/_config.inc.php */ // Test argument. if ($_SERVER['argc'] > 1 && isset($_SERVER['argv'][1]) && '' != $_SERVER['argv'][1] && is_dir($_SERVER['argv'][1])) { // Determine common site directory. $common_base = realpath($_SERVER['argv'][1]); // 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', PATH_SEPARATOR . '/usr/lib/php' . 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'; // Start application-based functionality: database, session, environment, ini setup, etc. // Most configuration parameters must be set before starting the App. $app->start(); // Global DB object. Automatically pre-configured by $app->start(). $db =& DB::getInstance(); ?>