mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
feat(occ): Add profiler link after occ output
Enable easy access to the profile when the profiler app is enabled. Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
This commit is contained in:
parent
47669f5f38
commit
41fe5d4e29
1 changed files with 9 additions and 1 deletions
10
console.php
10
console.php
|
|
@ -81,7 +81,8 @@ try {
|
|||
/* base.php will have removed eventual debug options from argv in $_SERVER */
|
||||
$argv = $_SERVER['argv'];
|
||||
$input = new ArgvInput($argv);
|
||||
$application->loadCommands($input, new ConsoleOutput());
|
||||
$output = new ConsoleOutput();
|
||||
$application->loadCommands($input, $output);
|
||||
|
||||
$eventLogger->end('console:build_application');
|
||||
$eventLogger->start('console:run', 'Run the command');
|
||||
|
|
@ -98,6 +99,13 @@ try {
|
|||
$profile->setMethod('occ');
|
||||
$profile->setUrl(implode(' ', $argv));
|
||||
$profiler->saveProfile($profile);
|
||||
|
||||
$urlGenerator = Server::get(\OCP\IURLGenerator::class);
|
||||
$url = $urlGenerator->linkToRouteAbsolute('profiler.main.profiler', [
|
||||
'profiler' => 'db',
|
||||
'token' => $profile->getToken(),
|
||||
]);
|
||||
$output->writeln('Profiler output available at ' . $url);
|
||||
}
|
||||
|
||||
if ($exitCode > 255) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue