From 7769e3479474a7983da004101a4aad8fecfc43d9 Mon Sep 17 00:00:00 2001 From: cytopia Date: Thu, 1 Nov 2018 10:19:43 +0100 Subject: [PATCH] #401 Fix display of drush versions --- .devilbox/www/htdocs/_ajax_callback.php | 14 ++++++++++++-- .devilbox/www/htdocs/index.php | 16 +++++++++++++--- .devilbox/www/include/lib/container/Php.php | 4 ++-- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.devilbox/www/htdocs/_ajax_callback.php b/.devilbox/www/htdocs/_ajax_callback.php index f002edab..d6ae14d0 100644 --- a/.devilbox/www/htdocs/_ajax_callback.php +++ b/.devilbox/www/htdocs/_ajax_callback.php @@ -48,9 +48,19 @@ if (loadClass('Helper')->isLoggedIn()) { $_GET['software'] => (($version = loadClass('Php')->getDrupalConsoleVersion()) !== false) ? $version : $no )); } - else if ($_GET['software'] == 'drush') { + else if ($_GET['software'] == 'drush7') { echo json_encode(array( - $_GET['software'] => (($version = loadClass('Php')->getDrushVersion()) !== false) ? $version : $no + $_GET['software'] => (($version = loadClass('Php')->getDrushVersion(7)) !== false) ? $version : $no + )); + } + else if ($_GET['software'] == 'drush8') { + echo json_encode(array( + $_GET['software'] => (($version = loadClass('Php')->getDrushVersion(8)) !== false) ? $version : $no + )); + } + else if ($_GET['software'] == 'drush9') { + echo json_encode(array( + $_GET['software'] => (($version = loadClass('Php')->getDrushVersion(9)) !== false) ? $version : $no )); } else if ($_GET['software'] == 'git') { diff --git a/.devilbox/www/htdocs/index.php b/.devilbox/www/htdocs/index.php index dfa806c2..a9a2acd9 100644 --- a/.devilbox/www/htdocs/index.php +++ b/.devilbox/www/htdocs/index.php @@ -391,8 +391,16 @@ $HEALTH_PERCENT = 100 - ceil(100 * $HEALTH_FAILS / $HEALTH_TOTAL); - drush - + drush7 + + + + drush8 + + + + drush9 + git @@ -907,7 +915,9 @@ $HEALTH_PERCENT = 100 - ceil(100 * $HEALTH_FAILS / $HEALTH_TOTAL); } updateVersions('composer'); updateVersions('drupalc'); - updateVersions('drush'); + updateVersions('drush7'); + updateVersions('drush8'); + updateVersions('drush9'); updateVersions('git'); updateVersions('laravel'); updateVersions('mds'); diff --git a/.devilbox/www/include/lib/container/Php.php b/.devilbox/www/include/lib/container/Php.php index 682c118b..5394a919 100644 --- a/.devilbox/www/include/lib/container/Php.php +++ b/.devilbox/www/include/lib/container/Php.php @@ -45,9 +45,9 @@ class Php extends BaseClass implements BaseInterface $output = loadClass('Helper')->exec('composer --version', $output); return loadClass('Helper')->egrep('/[0-9.]+/', $output); } - public function getDrushVersion() + public function getDrushVersion($version) { - $output = loadClass('Helper')->exec('drush --version', $output); + $output = loadClass('Helper')->exec('drush'.$version.' --version', $output); return loadClass('Helper')->egrep('/[0-9.]+/', $output); } public function getDrupalConsoleVersion()