X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=profileinfo.php;h=4e2a3d76ac8908c146e51bd220578e90eb8fd66d;hb=8ebe030ac1eb73a81de76e8b18bf66d6a4d68d1d;hp=91e6589463f32c296835cc5c21c8f5708ed05b2f;hpb=152a60a024b0184b3f6a01ed6f95e3459c157b9e;p=lhc%2Fweb%2Fwiklou.git diff --git a/profileinfo.php b/profileinfo.php index 91e6589463..4e2a3d76ac 100644 --- a/profileinfo.php +++ b/profileinfo.php @@ -21,7 +21,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - $Id$ --> @@ -47,18 +46,21 @@ $wgDBadminuser = $wgDBadminpassword = $wgDBserver = $wgDBname = $wgEnableProfileInfo = false; -define("MEDIAWIKI", 1); - -require_once("./includes/Defines.php"); -require_once("./LocalSettings.php"); +define( 'MW_NO_SETUP', 1 ); +require_once( './includes/WebStart.php' ); require_once("./AdminSettings.php"); -if (!$wgEnableProfileInfo) - die("disabled"); +if (!$wgEnableProfileInfo) { + echo "disabled\n"; + exit( 1 ); +} foreach (array("wgDBadminuser", "wgDBadminpassword", "wgDBserver", "wgDBname") as $var) - if ($$var === false) - die("AdminSettings.php not correct"); + if ($$var === false) { + echo "AdminSettings.php not correct\n"; + exit( 1 ); + } + $expand = array(); if (isset($_REQUEST['expand'])) @@ -196,6 +198,8 @@ function makeurl($_filter = false, $_sort = false, $_expand = false) { } $points = array(); +$queries = array(); +$sqltotal = 0.0; $last = false; while (($o = mysql_fetch_object($res)) !== false) { @@ -208,9 +212,19 @@ while (($o = mysql_fetch_object($res)) !== false) { } } $last = $next; - $points[] = $next; + if (preg_match("/^query: /", $next->name())) { + $sqltotal += $next->time(); + $queries[] = $next; + } else { + $points[] = $next; + } } +$s = new profile_point("SQL Queries", 0, $sqltotal); +foreach ($queries as $q) + $s->add_child($q); +$points[] = $s; + usort($points, "compare_point"); foreach ($points as $point) { @@ -230,4 +244,4 @@ mysql_close($dbh); ?> -