installer changes

This commit is contained in:
rahul shukla 2019-01-25 11:45:10 +05:30
parent 363efffaaa
commit 7e00d0a06f
3 changed files with 39 additions and 87 deletions

View File

@ -2,7 +2,7 @@
$install = require __DIR__.'/installer/install.php';
if (0 && !is_null($install)) {
if (!is_null($install)) {
header("Location: $install");

View File

@ -117,45 +117,45 @@ class Requirement {
];
}
/**
* check installation for composer
* @return boolean
*/
private static function composerInstall()
{
$command = 'cd ../.. ; export HOME=/root && export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update; composer --version';
exec($command, $data['composer'], $data['composer_install']);
// /**
// * check installation for composer
// * @return boolean
// */
// private static function composerInstall()
// {
// $command = 'cd ../.. ; export HOME=/root && export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update; composer --version';
// exec($command, $data['composer'], $data['composer_install']);
return $data['composer_install'];
}
// return $data['composer_install'];
// }
/**
* check installation for mysql
* @return boolean
*/
private static function mysqlInstall()
{
$command = 'mysql --version';
exec($command, $data['mysql'], $data['mysql_install']);
$mysqlVersion = explode(",", $data['mysql'][0]);
$mysqlVersion = explode(" ", $mysqlVersion[0]);
$supported = false;
$minMysqlVersion = '5.7.23';
// /**
// * check installation for mysql
// * @return boolean
// */
// private static function mysqlInstall()
// {
// $command = 'mysql --version';
// exec($command, $data['mysql'], $data['mysql_install']);
// $mysqlVersion = explode(",", $data['mysql'][0]);
// $mysqlVersion = explode(" ", $mysqlVersion[0]);
// $supported = false;
// $minMysqlVersion = '5.7.23';
if ($data['mysql_install'] == 0) {
if (version_compare(end($mysqlVersion), $minMysqlVersion, '>=')) {
$supported = true;
}
}
// if ($data['mysql_install'] == 0) {
// if (version_compare(end($mysqlVersion), $minMysqlVersion, '>=')) {
// $supported = true;
// }
// }
$mysqlStatus = [
'current' => end($mysqlVersion),
'minimum' => $minMysqlVersion,
'supported' => $supported
];
// $mysqlStatus = [
// 'current' => end($mysqlVersion),
// 'minimum' => $minMysqlVersion,
// 'supported' => $supported
// ];
return $mysqlStatus;
}
// return $mysqlStatus;
// }
// /**
@ -180,9 +180,9 @@ class Requirement {
$phpVersion = $this->checkPHPversion();
$composerInstall = $this->composerInstall();
// $composerInstall = $this->composerInstall();
$sqlInstall = $this->mysqlInstall();
// $sqlInstall = $this->mysqlInstall();
// $nodeInstall = $this->nodeInstall();

View File

@ -18,20 +18,6 @@
Please wait while we are checking the requirements
</div>
<?php foreach($requirements['requirements'] as $type => $require): ?>
<?php foreach($requirements['requirements'][$type] as $extention => $enabled) : ?>
<div class="check" style="margin-left: 25%">
<?php if($enabled ? $src = 'Images/green-check.svg' : $src = 'Images/red-check.svg' ): ?>
<img src="<?php echo $src ?>">
<?php endif; ?>
<span style="margin-left: 10px"><b><?php echo $extention ?></b></span>
<span>(<?php echo $extention ?> Required)</span>
</div>
<?php endforeach; ?>
<?php endforeach; ?>
<div class="check" style="margin-left: 25%">
<?php if($phpVersion['supported'] ? $src = 'Images/green-check.svg' : $src = 'Images/red-check.svg' ): ?>
<img src="<?php echo $src ?>">
@ -39,31 +25,9 @@
<span style="margin-left: 10px"><b>PHP</b></span>
<span>(<?php echo $phpVersion['minimum'] ?> or Higher)</span>
</div>
<div class="check" style="margin-left: 25%">
<?php if($sqlInstall['supported'] ? $src = 'Images/green-check.svg' : $src = 'Images/red-check.svg' ): ?>
<img src="<?php echo $src ?>">
<?php endif; ?>
<span style="margin-left: 11px"><b>Mysql</b></span>
<span>(<?php echo $sqlInstall['minimum'] ?> or Higher)</span>
</div>
<div class="check" style="margin-left: 25%;">
<?php if(($composerInstall == 0) ? $src = 'Images/green-check.svg' : $src = 'Images/red-check.svg' ): ?>
<img src="<?php echo $src ?>">
<?php endif; ?>
<span style="margin-left: 10px"><b>Composer</b></span>
</div>
<div style="margin-left: 30%;">
<?php if(!($composerInstall == 0)): ?>
<a href="https://getcomposer.org/" style="color: #0041FF; font-size: 16px">https://getcomposer.org/</a>
<?php endif; ?>
</div>
</div>
<?php if(!isset($requirements['errors']) && $phpVersion['supported'] && $sqlInstall['supported'] && ($composerInstall == 0) ): ?>
<?php if($phpVersion['supported']): ?>
<div>
<button type="button" class="prepare-btn" id="requirement-check">Continue</button>
@ -83,16 +47,4 @@
</div>
</body>
</html>
</html>