aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/install.php
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-19 14:12:35 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-19 14:12:35 +0000
commit1f851e08ba9274fa524db6f75b2c2cc21ec4dcf2 (patch)
treec508d6c61e6bb80c69df42a089b00dea2fa33f52 /engine/lib/install.php
parent386ae51928196b85b371ced288ccbf9393ff89c7 (diff)
downloadelgg-1f851e08ba9274fa524db6f75b2c2cc21ec4dcf2.tar.gz
elgg-1f851e08ba9274fa524db6f75b2c2cc21ec4dcf2.tar.bz2
Refs #256: Basic installation parameters checked.
Fixes #266: If the install flag isn't set then elgg_view will no longer attempt to load data from the database. git-svn-id: https://code.elgg.org/elgg/trunk@2016 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/install.php')
-rw-r--r--engine/lib/install.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/engine/lib/install.php b/engine/lib/install.php
index ca615c473..c0ed7ab91 100644
--- a/engine/lib/install.php
+++ b/engine/lib/install.php
@@ -11,6 +11,40 @@
* @copyright Curverider Ltd 2008
* @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.2.0', '>='))
+ 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;
+ }
/**
* Returns whether or not the database has been installed