Browse files

added requirement check to installer

  • Loading branch information...
1 parent 14e73b6 commit 2515151ba2c43d3dc08ef7f7ec8ce3699ad785f5 Gregory Hugaerts committed Apr 5, 2012
Showing with 29 additions and 1 deletion.
  1. +11 −1 install/index.php
  2. +18 −0 install/install.php
View
12 install/index.php
@@ -15,6 +15,7 @@
$install = new install();
$database_check = $install->check_connect();
+$requirement_check = $install->check_requirements();
if(!$database_check['error'])
{
@@ -77,6 +78,15 @@
<td colspan="2">
<h2>Installation</h2>
<?php
+ if ($requirement_check) {
+ echo "Please install all required extensions.<br />";
+ foreach ($requirement_check as $key => $value) {
+ echo $value;
+ }
+ die();
+ }
+ ?>
+ <?php
if($database_check['error'])
{
echo 'Please fix your config.app.php - '.$database_check['error'];
@@ -124,4 +134,4 @@
</div>
</body>
-</html>
+</html>
View
18 install/install.php
@@ -30,6 +30,24 @@ public function check_connect()
return $check_db;
}
+ public function check_requirements()
+ {
+ $errors = array();
+ if (!extension_loaded('pdo'))
+ {
+ $errors[] = '<strong>pdo extension not found.<strong>';
+ }
+ if (!extension_loaded('pdo_mysql'))
+ {
+ $errors[] = '<strong>mysql driver not found.<strong>';
+ }
+ if (!extension_loaded('mcrypt'))
+ {
+ $errors[] = '<strong>mcrypt extension not found.<strong>';
+ }
+ return $errors;
+ }
+
public function create_tables()
{
foreach($this->mysql_structure as $query)

0 comments on commit 2515151

Please sign in to comment.