if (substr($current_url, 0, $len) != $Config['SiteURL']) {
- dieprint_r(GENERAL_ERROR, "Edit includes/config.php and specify the correct site URL<br /><strong>Current value:</strong> $Config[SiteURL]<br /><strong>Expected value:</strong> a string starting by " . get_server_url(), "Setup");
+ dieprint_r(GENERAL_ERROR, "Edit includes/config.php and specify the correct site URL<br /><strong>Current value:</strong> $Config[SiteURL]<br /><strong>Expected value:</strong> a string starting by $server_url", "Setup");
}
if (array_key_exists('REDIRECT_URL', $_SERVER)) {
//With mod_rewrite, we can use REDIRECT_URL
//We takes the end of the URL, ie *FROM* $len position
+ * Gets the database instance, initializing it if needed
+ *
+ * The correct database instance to initialize will be determined from the
+ * $Config['database']['product'] preference.
+ *
+ * The database class to use will be Database + (preference engine, capitalized)
+ *
+ * This method will creates an instance of the specified object,
+ * calling the load static method from this object class.
+ *
+ * Example:
+ *
+ * <code>
+ * $Config['database']['engine'] = 'quux';
+ * $db = Database::load($Config['database']);
+ * </code>
+ *
+ * Database:load() will call DatabaseQuux:load();
+ *
+ * @return Database the database instance
+ */
+ static function load ($config) {
+ if (!isset($config['product'])) {
+ throw new Exception("A database engine (a MySQL variant is recommended) should be configured. Please ensure you have a database block with an [\"engine\"] value in the configuration.");