Clean up debug views.

This commit is contained in:
James Cole 2018-11-02 21:17:07 +01:00
parent 2283f3e786
commit 66f309f5ed
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
3 changed files with 10 additions and 32 deletions

View File

@ -133,13 +133,14 @@ class DebugController extends Controller
$toSandbox = var_export(env('BUNQ_USE_SANDBOX', 'unknown'), true);
$trustedProxies = env('TRUSTED_PROXIES', '(none)');
$displayErrors = ini_get('display_errors');
$storageDisks = implode(', ', config('filesystems.disks.upload.disks'));
$errorReporting = $this->errorReporting((int)ini_get('error_reporting'));
$appEnv = env('APP_ENV', '');
$appDebug = var_export(env('APP_DEBUG', false), true);
$logChannel = env('LOG_CHANNEL', '');
$appLogLevel = env('APP_LOG_LEVEL', 'info');
$packages = $this->collectPackages();
$cacheDriver = env('CACHE_DRIVER', 'unknown');
$loginProvider = env('LOGIN_PROVIDER', 'unknown');
// set languages, see what happens:
$original = setlocale(LC_ALL, 0);
@ -170,13 +171,15 @@ class DebugController extends Controller
}
}
}
// last few lines
$logContent = 'Truncated from this point <----|' . substr($logContent, -8192);
if (strlen($logContent) > 0) {
// last few lines
$logContent = 'Truncated from this point <----|' . substr($logContent, -8192);
}
return view(
'debug', compact(
'phpVersion', 'extensions', 'localeAttempts', 'appEnv', 'appDebug', 'logChannel', 'appLogLevel', 'now', 'packages', 'drivers',
'currentDriver',
'phpVersion', 'extensions', 'localeAttempts', 'appEnv', 'appDebug', 'logChannel', 'appLogLevel', 'now', 'drivers',
'currentDriver', 'loginProvider','storageDisks',
'userAgent', 'displayErrors', 'errorReporting', 'phpOs', 'interface', 'logContent', 'cacheDriver', 'isDocker', 'isSandstorm',
'trustedProxies',
'toSandbox'

View File

@ -33,32 +33,6 @@ use Log;
*/
trait GetConfigurationData
{
/**
* All packages that are installed.
*
* @return array
*/
protected function collectPackages(): array // get configuration
{
$packages = [];
$file = \dirname(__DIR__, 4) . '/vendor/composer/installed.json';
if (file_exists($file)) {
// file exists!
$content = file_get_contents($file);
$json = json_decode($content, true);
foreach ($json as $package) {
$packages[]
= [
'name' => $package['name'],
'version' => $package['version'],
];
}
}
return $packages;
}
/**
* Some common combinations.
*

View File

@ -34,6 +34,8 @@ Debug information generated at {{ now }} for Firefly III version **{{ FF_VERSION
{% endfor %}
| DB drivers | {{ drivers }} |
| Current driver | {{ currentDriver }} |
| Login provider | {{ loginProvider }} |
| Storage disks | {{ storageDisks }} |
| Using Sandstorm? | {% if SANDSTORM == true %}yes{% else %}no{% endif %} |
{% if SANDSTORM == true %}| Sandstorm anon? | {% if SANDSTORM_ANON == true %}yes{% else %}no{% endif %} |{% endif %}
| Is Sandstorm (.env) | {{ isSandstorm }} |
@ -42,7 +44,6 @@ Debug information generated at {{ now }} for Firefly III version **{{ FF_VERSION
| Trusted proxies (.env) | {{ trustedProxies }} |
| User agent | {{ userAgent }} |
| Loaded extensions | {{ extensions }} |
| Installed packages | {% for package in packages %}{{ package.name }}@{{ package.version }}, {% endfor %} |
</textarea>
<p style="font-family:Arial, Arial, Helvetica, sans-serif;font-size:12pt;width:600px;color:#a00;">