diff --git a/index.php b/index.php index af6922c..2dcd90a 100644 --- a/index.php +++ b/index.php @@ -305,7 +305,7 @@ function check_have_inno($link)

Previous - disabled diff --git a/step2.php b/step2.php index b2e9ecb..8fad4ff 100644 --- a/step2.php +++ b/step2.php @@ -1,3 +1,12 @@ + + @@ -45,6 +54,18 @@

Below you should enter your database connection details. If you’re not sure about these, contact your host.

+ + +
+ +

+
+ +
@@ -57,14 +78,14 @@
- + - + - - + +
@@ -224,15 +245,15 @@
-
+
-
+

Previous - +

@@ -364,3 +385,7 @@ + diff --git a/step2a.php b/step2a.php index 5a4428f..338217d 100644 --- a/step2a.php +++ b/step2a.php @@ -1,3 +1,17 @@ + @@ -19,19 +33,19 @@ - "; // echo $database_name."
"; @@ -40,29 +54,29 @@ // echo $database_username."
"; // echo $database_password."
"; - class TestResult - { - public $message; - public $status; - - public function TestResult($message, $status = STATUS_OK) - { - $this->message = $message; - $this->status = $status; - } - } // TestResult - function check_have_inno($link) - { - // if($result = mysqli_query('SHOW ENGINES', $link)) { - if ($result = $link('SHOW ENGINES')) { - while ($engine = mysqli_fetch_assoc($result)) { - if (strtolower($engine['Engine']) == 'innodb' && in_array(strtolower($engine['Support']), ['yes', 'default'])) { - return true; - } // if - } // while - } // if - return true; - } // check_have_inno + class TestResult + { + public $message; + public $status; + + public function testResult($message, $status = STATUS_OK) + { + $this->message = $message; + $this->status = $status; + } + } // TestResult + function check_have_inno($link) + { + // if($result = mysqli_query('SHOW ENGINES', $link)) { + if ($result = $link('SHOW ENGINES')) { + while ($engine = mysqli_fetch_assoc($result)) { + if (strtolower($engine['Engine']) == 'innodb' && in_array(strtolower($engine['Support']), ['yes', 'default'])) { + return true; + } // if + } // while + } // if + return true; + } // check_have_inno ?>

faveo

@@ -89,25 +103,33 @@ function check_have_inno($link) select_db($database_name)) { - // $results[] = new TestResult('Database "' . $database_username . '" selected', STATUS_OK); + $sql = "SELECT COUNT(DISTINCT `table_name`) FROM `information_schema`.`columns` WHERE `table_schema` = '$database_name'"; + $res = mysqli_query($connection, $sql); + $value = mysqli_fetch_assoc($res); + foreach ($value as $val) { + if ($val == 0) { + $mysqli_version = $connection->server_version; + $results[] = new TestResult("Database '$database_name' looks fine.", STATUS_OK); + $mysql_ok = true; + if ($connection->select_db($database_name)) { + // $results[] = new TestResult('Database "' . $database_username . '" selected', STATUS_OK); //$mysql_version = mysql_get_server_info($connection); - $mysqli_version = $connection->server_version; - $results[] = new TestResult('Connected to database as '.$database_username.'@'.$database_host, STATUS_OK); + $mysqli_version = $connection->server_version; + $results[] = new TestResult('Connected to database as '.$database_username.'@'.$database_host, STATUS_OK); - if (version_compare($mysqli_version, '5.0') >= 0) { - $results[] = new TestResult('MySQL version is '.$mysqli_version, STATUS_OK); + if (version_compare($mysqli_version, '5.0') >= 0) { + $results[] = new TestResult('MySQL version is '.$mysqli_version, STATUS_OK); + $mysql_ok = true; //$have_inno = check_have_inno($connection); @@ -117,55 +139,67 @@ function check_have_inno($link) // $results[] = new TestResult('No InnoDB support. Although activeCollab can use MyISAM storage engine InnoDB is HIGHLY recommended!', STATUS_WARNING); // } // } else { - $results[] = new TestResult('Your MySQL version is '.$mysqli_version.'. We recommend upgrading to at least MySQL5!', STATUS_ERROR); - $mysql_ok = false; - } // if + } else { + $results[] = new TestResult('Your MySQL version is '.$mysqli_version.'. We recommend upgrading to at least MySQL5!', STATUS_ERROR); + $mysql_ok = false; + } + // if + } else { + $results[] = new TestResult('Failed to select database. MySQL said: '.mysqli_error($connection), STATUS_ERROR); + $mysql_ok = false; + } // if + } else { + $results[] = new TestResult('Faveo installation needs an empty database.', STATUS_ERROR); + $mysql_ok = false; + } + // code... + } } else { - $results[] = new TestResult('Failed to select database. MySQL said: '.mysqli_error(), STATUS_ERROR); + $results[] = new TestResult('Failed to connect to database. MySQL said: '.mysqli_error($connection), STATUS_ERROR); $mysql_ok = false; } // if - } else { - $results[] = new TestResult('Failed to connect to database. MySQL said: '.mysqli_error(), STATUS_ERROR); - $mysql_ok = false; - } // if // --------------------------------------------------- // Validators // --------------------------------------------------- - foreach ($results as $result) { - echo '
'.$result->status.' — '.$result->message.''; - } // foreach +foreach ($results as $result) { + echo '
'.$result->status.' — '.$result->message.''; +} // foreach ?>
- + -

Database connection successful. This system can run Faveo

-

Database connection unsuccessful. This system does not meet Faveo system requirements

- - +

- disabled> + ?>disabled> - Previous + Previous

@@ -185,4 +219,11 @@ function check_have_inno($link) - \ No newline at end of file + + \ No newline at end of file diff --git a/step3.php b/step3.php new file mode 100644 index 0000000..10a3d59 --- /dev/null +++ b/step3.php @@ -0,0 +1,85 @@ + + + + + + + + + Faveo HELPDESK + + + + + + + + + + + + + +

Faveo

+
    + +
  1. Environment Test
  2. + +
  3. Database Test
  4. + +
  5. Ready
  6. +
+
+ + + + +

Your System is Ready!

+ +
+

All right, sparky! Your system is ready for installation.

+ +
+ +
+
+

Next Steps

+ +
+
+

Learn More

+ +
+
+
+ +

Copyright © 2015 - 2016 · Ladybird Web Solution Pvt Ltd. All Rights Reserved. Powered by Faveo

+ + + + + \ No newline at end of file