diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-07-04 16:11:05 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-07-04 16:19:36 +0200 |
commit | 612088bef27418fb6f05fd913aed69c97e381c10 (patch) | |
tree | 84634465bde28fa563cd8d5daaa74adacfe8cc55 /core | |
parent | 9baf8fea8c6faf88ddf0fc969426b893f2fe2071 (diff) | |
download | nextcloud-server-612088bef27418fb6f05fd913aed69c97e381c10.tar.gz nextcloud-server-612088bef27418fb6f05fd913aed69c97e381c10.zip |
feat: Add reserved options in a new OCP class so that applications know about them
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/Listener/BeforeMessageLoggedEventListener.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/Listener/BeforeMessageLoggedEventListener.php b/core/Listener/BeforeMessageLoggedEventListener.php index a0581f25830..ef771ca0a81 100644 --- a/core/Listener/BeforeMessageLoggedEventListener.php +++ b/core/Listener/BeforeMessageLoggedEventListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); namespace OC\Core\Listener; +use OCP\Console\ReservedOptions; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventDispatcher; use OCP\EventDispatcher\IEventListener; @@ -54,10 +55,10 @@ class BeforeMessageLoggedEventListener implements IEventListener { $argv = $_SERVER['argv']; $level = 0; foreach ($argv as $key => $arg) { - if ($arg === '--debug-log') { + if ($arg === '--'.ReservedOptions::DEBUG_LOG) { unset($argv[$key]); - } elseif (str_starts_with($arg, '--debug-log-level=')) { - $level = (int)substr($arg, strlen('--debug-log-level=')); + } elseif (str_starts_with($arg, '--'.ReservedOptions::DEBUG_LOG_LEVEL.'=')) { + $level = (int)substr($arg, strlen('--'.ReservedOptions::DEBUG_LOG_LEVEL.'=')); unset($argv[$key]); } } |