File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,13 @@ $countClasses = function (array $list): int {
2525 }));
2626};
2727
28+ $ ipFormatter = static function (?string $ ip ): ?string {
29+ if ($ ip === '127.0.0.1 ' || $ ip === '::1 ' ) {
30+ $ ip .= ' (localhost) ' ;
31+ }
32+ return $ ip ;
33+ };
34+
2835$ opcache = function_exists ('opcache_get_status ' ) ? @opcache_get_status () : null ; // @ can be restricted
2936$ cachedFiles = isset ($ opcache ['scripts ' ]) ? array_intersect (array_keys ($ opcache ['scripts ' ]), get_included_files ()) : [];
3037
@@ -36,8 +43,8 @@ $info = [
3643 'OPcache ' => $ opcache ? round (count ($ cachedFiles ) * 100 / count (get_included_files ())) . '% cached ' : null ,
3744 'Classes + interfaces + traits ' => $ countClasses (get_declared_classes ()) . ' + '
3845 . $ countClasses (get_declared_interfaces ()) . ' + ' . $ countClasses (get_declared_traits ()),
39- 'Your IP ' => $ _SERVER ['REMOTE_ADDR ' ] ?? null ,
40- 'Server IP ' => $ _SERVER ['SERVER_ADDR ' ] ?? null ,
46+ 'Your IP ' => $ ipFormatter ( $ _SERVER ['REMOTE_ADDR ' ] ?? null ) ,
47+ 'Server IP ' => $ ipFormatter ( $ _SERVER ['SERVER_ADDR ' ] ?? null ) ,
4148 'HTTP method / response code ' => isset ($ _SERVER ['REQUEST_METHOD ' ]) ? $ _SERVER ['REQUEST_METHOD ' ] . ' / ' . http_response_code () : null ,
4249 'PHP ' => PHP_VERSION ,
4350 'Xdebug ' => extension_loaded ('xdebug ' ) ? phpversion ('xdebug ' ) : null ,
You can’t perform that action at this time.
0 commit comments