mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-24 22:48:18 +00:00
Refactor many request related methods into (complex) trait.
This commit is contained in:
@@ -241,6 +241,31 @@ class DebugController extends Controller
|
||||
return redirect(route('home'));
|
||||
}
|
||||
|
||||
/**
|
||||
* All packages that are installed.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function collectPackages(): array // get configuration
|
||||
{
|
||||
$packages = [];
|
||||
$file = \dirname(__DIR__, 3) . '/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.
|
||||
*
|
||||
@@ -266,29 +291,4 @@ class DebugController extends Controller
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* All packages that are installed.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function collectPackages(): array // get configuration
|
||||
{
|
||||
$packages = [];
|
||||
$file = \dirname(__DIR__, 3) . '/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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user