Merge "registration: Only allow one extension to set a specific config setting"
[lhc/web/wiklou.git] / includes / debug / logger / monolog / WikiProcessor.php
index ad939a0..e39a2c3 100644 (file)
@@ -25,8 +25,7 @@ namespace MediaWiki\Logger\Monolog;
  * wiki / request ID, and MediaWiki version.
  *
  * @since 1.25
- * @author Bryan Davis <bd808@wikimedia.org>
- * @copyright © 2013 Bryan Davis and Wikimedia Foundation.
+ * @copyright © 2013 Wikimedia Foundation and contributors
  */
 class WikiProcessor {
 
@@ -36,15 +35,13 @@ class WikiProcessor {
         */
        public function __invoke( array $record ) {
                global $wgVersion;
-               $record['extra'] = array_merge(
-                       $record['extra'],
-                       [
-                               'host' => wfHostname(),
-                               'wiki' => wfWikiID(),
-                               'mwversion' => $wgVersion,
-                               'reqId' => \WebRequest::getRequestId(),
-                       ]
-               );
+               $record['extra']['host'] = wfHostname();
+               $record['extra']['wiki'] = wfWikiID();
+               $record['extra']['mwversion'] = $wgVersion;
+               $record['extra']['reqId'] = \WebRequest::getRequestId();
+               if ( PHP_SAPI === 'cli' && isset( $_SERVER['argv'] ) ) {
+                       $record['extra']['cli_argv'] = implode( ' ', $_SERVER['argv'] );
+               }
                return $record;
        }