Skip to content

Commit

Permalink
Merge pull request #406 from cytopia/intranet-drush-versions
Browse files Browse the repository at this point in the history
#401 Fix display of drush versions
  • Loading branch information
cytopia authored Nov 1, 2018
2 parents 14cd1f0 + 7769e34 commit 0188970
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
14 changes: 12 additions & 2 deletions .devilbox/www/htdocs/_ajax_callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,19 @@
$_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') {
Expand Down
16 changes: 13 additions & 3 deletions .devilbox/www/htdocs/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,16 @@
<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>
Expand Down Expand Up @@ -907,7 +915,9 @@ function updateVersions(app) {
}
updateVersions('composer');
updateVersions('drupalc');
updateVersions('drush');
updateVersions('drush7');
updateVersions('drush8');
updateVersions('drush9');
updateVersions('git');
updateVersions('laravel');
updateVersions('mds');
Expand Down
4 changes: 2 additions & 2 deletions .devilbox/www/include/lib/container/Php.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public function getComposerVersion()
$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()
Expand Down

0 comments on commit 0188970

Please sign in to comment.