some additional version info added

This commit is contained in:
Sevan Nerse 2021-12-24 18:44:10 +03:00
parent 6fa079d8b4
commit 0580b10452

View File

@ -4,6 +4,7 @@ namespace App\Utilities;
use App\Models\Auth\User;
use App\Models\Common\Company;
use Composer\InstalledVersions;
use DB;
class Info
@ -22,8 +23,12 @@ class Info
{
return [
'akaunting' => version('short'),
'laravel' => app()->version(),
'php' => static::phpVersion(),
'mysql' => static::mysqlVersion(),
'vuejs' => static::nodePackageVersion('vue'),
'livewire' => InstalledVersions::getPrettyVersion('livewire/livewire'),
'tailwindcss' => static::nodePackageVersion('tailwindcss'),
];
}
@ -51,4 +56,16 @@ class Info
return 'N/A';
}
public static function nodePackageVersion($package)
{
$version = '-';
$shell_exec_result = shell_exec('npm list ' . $package . ' --depth=0');
if (!strpos($shell_exec_result, '(empty)')) {
$version = trim(substr($shell_exec_result, strpos($shell_exec_result, $package . '@') + strlen($package) + 1));
}
return $version;
}
}