MediaWiki REL1_33
Xhprof.php
Go to the documentation of this file.
1<?php
32class Xhprof {
36 protected static $enabled;
37
42 public static function isEnabled() {
43 return self::$enabled;
44 }
45
52 public static function enable( $flags = 0, $options = [] ) {
53 if ( self::isEnabled() ) {
54 throw new Exception( 'Profiling is already enabled.' );
55 }
56 self::$enabled = true;
58 [
59 'xhprof_enable',
60 'tideways_enable',
61 'tideways_xhprof_enable'
62 ],
63 [ $flags, $options ]
64 );
65 }
66
72 public static function disable() {
73 if ( self::isEnabled() ) {
74 self::$enabled = false;
75 return self::callAny( [
76 'xhprof_disable',
77 'tideways_disable',
78 'tideways_xhprof_disable'
79 ] );
80 }
81 }
82
89 protected static function callAny( array $functions, array $args = [] ) {
90 foreach ( $functions as $func ) {
91 if ( function_exists( $func ) ) {
92 return $func( ...$args );
93 }
94 }
95
96 throw new Exception( "Neither xhprof nor tideways are installed" );
97 }
98}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
if( $line===false) $args
Definition cdb.php:64
Convenience class for working with XHProf https://github.com/phacility/xhprof.
Definition Xhprof.php:32
static $enabled
Definition Xhprof.php:36
static enable( $flags=0, $options=[])
Start xhprof profiler.
Definition Xhprof.php:52
static disable()
Stop xhprof profiler.
Definition Xhprof.php:72
static callAny(array $functions, array $args=[])
Call the first available function from $functions.
Definition Xhprof.php:89
static isEnabled()
Start xhprof profiler.
Definition Xhprof.php:42
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
Definition hooks.txt:1999
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))