* Returns whether or not the database has been installed * * @return true|false Whether the database has been installed */ function is_db_installed() { global $CONFIG; if (isset($CONFIG->db_installed)) { return $CONFIG->db_installed; } if ($dblink = get_db_link('read')) { mysql_query("select name from {$CONFIG->dbprefix}datalists limit 1",$dblink); if (mysql_errno($dblink) > 0) return false; } else return false; $CONFIG->db_installed = true; // Set flag if db is installed (if false then we want to check every time) return true; } /** * Returns whether or not other settings have been set * * @return true|false Whether or not the rest of the installation has been followed through with */ function is_installed() { global $CONFIG; return datalist_get('installed'); } /** * Copy and create a new settings.php from settings.example.php, substituting the variables in * $vars where appropriate. * * $vars is an associate array of $key => $value, where $key is the variable text you wish to substitute (eg * CONFIG_DBNAME will replace {{CONFIG_DBNAME}} in the settings file. * * @param array $vars The array of vars * @param string $in_file Optional input file (if not settings.example.php) * @return string The file containing substitutions. */ function create_settings(array $vars, $in_file="engine/se * Returns whether or not the database has been installed * * @return true|false Whether the database has been installed */ function is_db_installed() { global $CONFIG; if (isset($CONFIG->db_installed)) { return $CONFIG->db_installed; } if ($dblink = get_db_link('read')) { mysql_query("select name from {$CONFIG->dbprefix}datalists limit 1",$dblink); if (mysql_errno($dblink) > 0) return false; } else return false; $CONFIG->db_installed = true; // Set flag if db is installed (if false then we want to check every time) return true; } /** * Returns whether or not other settings have been set * * @return true|false Whether or not the rest of the installation has been followed through with */ function is_installed() { global $CONFIG; return datalist_get('installed'); } /** * Copy and create a new settings.php from settings.example.php, substituting the variables in * $vars where appropriate. * * $vars is an associate array of $key => $value, where $key is the variable text you wish to substitute (eg * CONFIG_DBNAME will replace {{CONFIG_DBNAME}} in the settings file. * * @param array $vars The array of vars * @param string $in_file Optional input file (if not settings.example.php) * @return string The file containing substitutions. */ function create_settings(array $vars, $in_file="engine/settings.example.php") { $file = file_get_contents($in_file); if (!$file) return false; foreach ($vars as $k => $v) $file = str_replace("{{".$k."}}", $v, $file); return $file; } /** * Initialisation for installation functions * */ function install_init() { register_action("systemsettings/install",true); } register_elgg_event_handler("boot","system","install_init"); ?> Welcome to Elgg.

Welcome to Elgg.

Elgg couldn't find its settings file. Most of Elgg's settings will be handled for you, but we need you to supply your database details. To do this:

1. Rename engine/settings.example.php to settings.php in your Elgg installation.

2. Open it with a text editor and enter your MySQL database details. If you don't know these, ask your system administrator or technical support for help.

Alternatively, you can enter your database settings below and we will try and do this for you...

Enter your database settings below and hit save:

Database user
Database password
Elgg database
Database hostname (usually 'localhost')
Database table prefix (usually 'elgg')

Once you've corrected any configuration issues, press reload to try again.