From 047ae3934ead91c858dcc7ab487c28abe0293a86 Mon Sep 17 00:00:00 2001 From: rahul shukla Date: Fri, 29 Mar 2019 11:59:29 +0530 Subject: [PATCH] issue #725 --- public/installer/Classes/Requirement.php | 26 +++++++++++++++++++ public/installer/Composer.php | 20 +------------- public/installer/Migration.php | 3 --- public/installer/Views/requirements.blade.php | 16 +++++++++++- 4 files changed, 42 insertions(+), 23 deletions(-) diff --git a/public/installer/Classes/Requirement.php b/public/installer/Classes/Requirement.php index e8343e0ed..e6ecf5160 100755 --- a/public/installer/Classes/Requirement.php +++ b/public/installer/Classes/Requirement.php @@ -116,6 +116,30 @@ class Requirement { ]; } + /** + * Check composer installation. + * + * @return array + */ + public function composerInstall() + { + $location = str_replace('\\', '/', getcwd()); + $currentLocation = explode("/", $location); + array_pop($currentLocation); + array_pop($currentLocation); + $desiredLocation = implode("/", $currentLocation); + $autoLoadFile = $desiredLocation . '/' . 'vendor' . '/' . 'autoload.php'; + + if (file_exists($autoLoadFile)) { + $data['composer_install'] = 0; + } else { + $data['composer_install'] = 1; + $data['composer'] = 'Composer dependencies is not Installed.Go to root of project, run "composer install" command to install composer dependencies & refresh page again.'; + } + + return $data; + } + /** * Render view for class. * @@ -126,6 +150,8 @@ class Requirement { $phpVersion = $this->checkPHPversion(); + $composerInstall = $this->composerInstall(); + ob_start(); include __DIR__ . '/../Views/requirements.blade.php'; diff --git a/public/installer/Composer.php b/public/installer/Composer.php index 66f240929..35ce0a0a9 100755 --- a/public/installer/Composer.php +++ b/public/installer/Composer.php @@ -1,25 +1,7 @@ Click the below button to run following : -
- Check Composer dependency -
Database Migartion
diff --git a/public/installer/Views/requirements.blade.php b/public/installer/Views/requirements.blade.php index fdd26f595..a746ac2a4 100755 --- a/public/installer/Views/requirements.blade.php +++ b/public/installer/Views/requirements.blade.php @@ -39,9 +39,23 @@ + + + + + Composer + + + +
+ + + +
+ - +