// Configuration/info variables from everywhere: $confKeys = array('adminUsername', 'adminEmail', 'adminPass', 'adminPass2', 'apiKey', 'app', 'baseUrl', 'buildDate', 'currency', 'currency2', 'dbHost', 'dbName', 'dbUser', 'dbPass', 'dummy_data', 'db_type', 'edition', 'GD_support', 'language', 'php_version', 'receiveUpdates', 'test_db', 'test_url', 'time', 'timezone', 'unique_id', 'updaterVersion', 'user_agent', 'visibleModules', 'x2_version', 'type', 'startCron', 'cronSched', 'cron'); // Values that are safe to return in the configuration (in $_GET) in the case // that the user visits initialize.php before installing or is not using JavaScript $returnKeys = array('dbHost', 'dbName', 'dbUser', 'app', 'currency', 'currency2', 'language', 'adminUsername', 'adminEmail', 'dummy_data', 'receiveUpdates', 'timezone', 'unique_id'); // Configuration keys to be used in $dbConfig. Must coincide with those in $config, // and be present in protected/data/config.sql $dbKeys = array('adminEmail', 'adminUsername', 'adminPass', 'apiKey', 'currency', 'time', 'unique_id', 'edition', 'bulkEmail', 'language', 'timezone', 'visibleModules', 'app', 'baseUrl', 'baseUri'); // Values gathered for statistical/anonymous survey purposes: $sendArgs = array('language', 'currency', 'x2_version', 'dummy_data', 'php_version', 'db_type', 'GD_support', 'user_agent', 'timezone', 'unique_id', 'type'); // Old or inconsistent variable names in installConfig.php and the config file(s) $confMap = array('host' => 'dbHost', 'db' => 'dbName', 'dbname' => 'dbName', 'email' => 'adminEmail', 'user' => 'dbUser', 'pass' => 'dbPass', 'adminPassword' => 'adminPass', 'x2Version' => 'x2_version', 'lang' => 'language', 'dummyData' => 'dummy_data', 'appName' => 'app', 'version' => 'x2_version', 'installType' => 'type'); require_once implode(DIRECTORY_SEPARATOR, array(__DIR__, 'protected', 'components', 'util', 'ResponseUtil.php')); // AJAX-driven installation needs "OK" status to work properly, even if there // are errors to display: ResponseUtil::$errorCode = 200; // Response object for AJAX-driven installation $response = new ResponseUtil(); /** * Convenience wrapper for ResponseUtil::respond * * @param string $message */ function RIP($message) { ResponseUtil::respond($message, 1); } set_error_handler('ResponseUtil::respondWithError'); set_exception_handler('ResponseUtil::respondWithException'); register_shutdown_function('ResponseUtil::respondFatalErrorMessage'); ini_set('display_errors', 0);