From 6606581f431f52330b8bcc28e1aa1b55a4b5b408 Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 6 Oct 2010 11:21:47 +0000 Subject: removed several parts of the old installer from the core git-svn-id: http://code.elgg.org/elgg/trunk@7021 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/install.php | 97 +++++--------------------------------------------- 1 file changed, 8 insertions(+), 89 deletions(-) (limited to 'engine/lib/install.php') diff --git a/engine/lib/install.php b/engine/lib/install.php index f1ad74b23..9deec9e26 100644 --- a/engine/lib/install.php +++ b/engine/lib/install.php @@ -10,63 +10,6 @@ * @link http://elgg.org/ */ -/** - * Check that the installed version of PHP meets the minimum requirements (currently 5.2 or greater). - * - * @return bool - */ -function php_check_version() { - if (version_compare(phpversion(), '5.1.2', '>=')) { - return true; - } - - return false; -} - -/** - * Validate the platform Elgg is being installed on. - * - * @throws ConfigurationException if the validation fails. - * @return bool - */ -function validate_platform() { - // Get database version - if (!db_check_version()) { - throw new ConfigurationException(elgg_echo('ConfigurationException:BadDatabaseVersion')); - } - - // Now check PHP - if (!php_check_version()) { - throw new ConfigurationException(elgg_echo('ConfigurationException:BadPHPVersion')); - } - - // @todo Consider checking for installed modules etc - return true; -} - -/** - * Confirm the settings for the database - * - * @param string $user - * @param string $password - * @param string $dbname - * @param string $host - * @return bool - * @since 1.7.1 - */ -function db_check_settings($user, $password, $dbname, $host) { - $mysql_dblink = mysql_connect($host, $user, $password, true); - if ($mysql_dblink == FALSE) { - return $FALSE; - } - - $result = mysql_select_db($dbname, $mysql_dblink); - - mysql_close($mysql_dblink); - - return $result; -} - /** * Returns whether or not the database has been installed * @@ -104,37 +47,13 @@ function is_installed() { 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); +function verify_installation() { + $installed = FALSE; + try { + $installed = is_installed(); + } catch (DatabaseException $e) {} + if (!$installed) { + header("Location: install.php"); + exit; } - - return $file; -} - -/** - * Initialisation for installation functions - * - */ -function install_init() { - register_action("systemsettings/install",true); } - -register_elgg_event_handler("boot","system","install_init"); \ No newline at end of file -- cgit v1.2.3