Merge pull request #406 from cytopia/intranet-drush-versions

#401 Fix display of drush versions
This commit is contained in:
cytopia 2018-11-01 10:22:08 +01:00 committed by GitHub
commit 0188970367
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 7 deletions

View File

@ -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') {

View File

@ -391,8 +391,16 @@ $HEALTH_PERCENT = 100 - ceil(100 * $HEALTH_FAILS / $HEALTH_TOTAL);
<td id="app_drupalc"></td>
</tr>
<tr>
<th>drush</th>
<td id="app_drush"></td>
<th>drush7</th>
<td id="app_drush7"></td>
</tr>
<tr>
<th>drush8</th>
<td id="app_drush8"></td>
</tr>
<tr>
<th>drush9</th>
<td id="app_drush9"></td>
</tr>
<tr>
<th>git</th>
@ -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');

View File

@ -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()