2019-06-04 00:08:13 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2019. Invoice Ninja LLC (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Utils;
|
|
|
|
|
2019-10-16 22:12:38 +02:00
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
2019-06-04 00:08:13 +02:00
|
|
|
/**
|
|
|
|
* Class Ninja.
|
|
|
|
*/
|
|
|
|
class Ninja
|
|
|
|
{
|
2019-10-16 22:12:38 +02:00
|
|
|
public static function isSelfHost()
|
|
|
|
{
|
|
|
|
return config('ninja.environment') === 'selfhost';
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function isHosted()
|
|
|
|
{
|
|
|
|
return config('ninja.environment') === 'hosted';
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getDebugInfo()
|
|
|
|
{
|
|
|
|
$mysql_version = DB::select(DB::raw("select version() as version"))[0]->version;
|
|
|
|
|
|
|
|
$info = "App Version: v" . config('ninja.app_version') . "\\n" .
|
|
|
|
"White Label: " . "\\n" . // TODO: Implement white label with hasFeature.
|
|
|
|
"Server OS: " . php_uname('s') . ' ' . php_uname('r') . "\\n" .
|
|
|
|
"PHP Version: " . phpversion() . "\\n" .
|
|
|
|
"MySQL Version: " . $mysql_version;
|
2019-06-04 00:08:13 +02:00
|
|
|
|
2019-10-16 22:12:38 +02:00
|
|
|
return $info;
|
|
|
|
}
|
2019-06-04 00:08:13 +02:00
|
|
|
}
|