REL-0.9 Show version of installed toold

This commit is contained in:
cytopia 2017-05-06 13:44:51 +02:00
parent 1c7c240874
commit 3f7fe50113
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
2 changed files with 51 additions and 5 deletions

View File

@ -440,23 +440,27 @@ function getCirle($name) {
<tbody>
<tr>
<th>composer</th>
<td>3.23</td>
<td><?php if (($version = loadClass('Php')->getComposerVersion()) === false) {echo '<span class="text-danger">not installed</span>';}else{echo $version;}; ?></td>
</tr>
<tr>
<th>drush</th>
<td>8</td>
<td><?php if (($version = loadClass('Php')->getDrushVersion()) === false) {echo '<span class="text-danger">not installed</span>';}else{echo $version;}; ?></td>
</tr>
<tr>
<th>drush-console</th>
<td>8</td>
<td><?php if (($version = loadClass('Php')->getDrushConsoleVersion()) === false) {echo '<span class="text-danger">not installed</span>';}else{echo $version;}; ?></td>
</tr>
<tr>
<th>git</th>
<td>3.2</td>
<td><?php if (($version = loadClass('Php')->getGitVersion()) === false) {echo '<span class="text-danger">not installed</span>';}else{echo $version;}; ?></td>
</tr>
<tr>
<th>node</th>
<td><?php if (($version = loadClass('Php')->getNodeVersion()) === false) {echo '<span class="text-danger">not installed</span>';}else{echo $version;}; ?></td>
</tr>
<tr>
<th>npm</th>
<td>3.85</td>
<td><?php if (($version = loadClass('Php')->getNpmVersion()) === false) {echo '<span class="text-danger">not installed</span>';}else{echo $version;}; ?></td>
</tr>
</tbody>
</table>

View File

@ -109,6 +109,48 @@ class Php extends _Base implements _iBase
$uid = $this->egrep('/[0-9]+/', $uid);
return $uid;
}
public function getGitVersion()
{
$output = null;
$return = $this->_exec('git --version', $output);
return $this->egrep('/[0-9.]+/', isset($output[0]) ? $output[0] : '');
}
public function getComposerVersion()
{
$output = null;
$return = $this->_exec('composer --version', $output);
return $this->egrep('/[0-9.]+/', isset($output[0]) ? $output[0] : '');
}
public function getDrushVersion()
{
$output = null;
$return = $this->_exec('drush --version', $output);
return $this->egrep('/[0-9.]+/', isset($output[0]) ? $output[0] : '');
}
public function getDrushConsoleVersion()
{
$output = null;
$return = $this->_exec('drush-console --version', $output);
return $this->egrep('/[0-9.]+/', isset($output[0]) ? $output[0] : '');
}
public function getNodeVersion()
{
$output = null;
$return = $this->_exec('node --version', $output);
return $this->egrep('/[0-9.]+/', isset($output[0]) ? $output[0] : '');
}
public function getNpmVersion()
{
$output = null;
$return = $this->_exec('npm --version', $output);
return $this->egrep('/[0-9.]+/', isset($output[0]) ? $output[0] : '');
}
/*********************************************************************************