mirror of
https://github.com/cytopia/devilbox.git
synced 2024-12-22 06:07:48 +00:00
REL-0.9 Show version of installed toold
This commit is contained in:
parent
1c7c240874
commit
3f7fe50113
@ -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>
|
||||
|
@ -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] : '');
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user