/** * Returns the HTML to add to the page for the toolbar * * @param $context IContextSource * @return array */ public static function getDebugInfo(IContextSource $context) { if (!self::$enabled) { return array(); } global $wgVersion, $wgRequestTime; $request = $context->getRequest(); return array('mwVersion' => $wgVersion, 'phpVersion' => PHP_VERSION, 'gitRevision' => GitInfo::headSHA1(), 'gitBranch' => GitInfo::currentBranch(), 'gitViewUrl' => GitInfo::headViewUrl(), 'time' => microtime(true) - $wgRequestTime, 'log' => self::$log, 'debugLog' => self::$debug, 'queries' => self::$query, 'request' => array('method' => $request->getMethod(), 'url' => $request->getRequestURL(), 'headers' => $request->getAllHeaders(), 'params' => $request->getValues()), 'memory' => $context->getLanguage()->formatSize(memory_get_usage()), 'memoryPeak' => $context->getLanguage()->formatSize(memory_get_peak_usage()), 'includes' => self::getFilesIncluded($context)); }
/** * Returns the HTML to add to the page for the toolbar * * @param IContextSource $context * @return array */ public static function getDebugInfo(IContextSource $context) { if (!self::$enabled) { return array(); } global $wgVersion, $wgRequestTime; $request = $context->getRequest(); // HHVM's reported memory usage from memory_get_peak_usage() // is not useful when passing false, but we continue passing // false for consistency of historical data in zend. // see: https://github.com/facebook/hhvm/issues/2257#issuecomment-39362246 $realMemoryUsage = wfIsHHVM(); return array('mwVersion' => $wgVersion, 'phpEngine' => wfIsHHVM() ? 'HHVM' : 'PHP', 'phpVersion' => wfIsHHVM() ? HHVM_VERSION : PHP_VERSION, 'gitRevision' => GitInfo::headSHA1(), 'gitBranch' => GitInfo::currentBranch(), 'gitViewUrl' => GitInfo::headViewUrl(), 'time' => microtime(true) - $wgRequestTime, 'log' => self::$log, 'debugLog' => self::$debug, 'queries' => self::$query, 'request' => array('method' => $request->getMethod(), 'url' => $request->getRequestURL(), 'headers' => $request->getAllHeaders(), 'params' => $request->getValues()), 'memory' => $context->getLanguage()->formatSize(memory_get_usage($realMemoryUsage)), 'memoryPeak' => $context->getLanguage()->formatSize(memory_get_peak_usage($realMemoryUsage)), 'includes' => self::getFilesIncluded($context)); }