Page MenuHomePhabricator

profileinfo.php.patch

Authored By
bzimport
Nov 21 2014, 9:21 PM
Size
1 KB
Referenced Files
None
Subscribers
None

profileinfo.php.patch

Index: profileinfo.php
===================================================================
--- profileinfo.php (revision 49983)
+++ profileinfo.php (working copy)
@@ -219,14 +219,14 @@
if (isset($_REQUEST['sort']) && in_array($_REQUEST['sort'], $sorts))
$sort = $_REQUEST['sort'];
-$dbh = mysql_connect($wgDBserver, $wgDBadminuser, $wgDBadminpassword)
+
+$dbr = wfGetDB( DB_SLAVE)
or die("mysql server failed: " . mysql_error());
-mysql_select_db($wgDBname, $dbh) or die(mysql_error($dbh));
-$res = mysql_query("
+$res = $dbr->query("
SELECT pf_count, pf_time, pf_memory, pf_name
FROM {$wgDBprefix}profiling
ORDER BY pf_name ASC
-", $dbh) or die("query failed: " . mysql_error());
+");
if (isset($_REQUEST['filter']))
$filter = $_REQUEST['filter'];
@@ -276,7 +276,7 @@
$sqltotal = 0.0;
$last = false;
-while (($o = mysql_fetch_object($res)) !== false) {
+while (($o = $dbr->fetchObject($res)) !== false) {
$next = new profile_point($o->pf_name, $o->pf_count, $o->pf_time, $o->pf_memory);
if( $next->name() == '-total' ) {
$totaltime = $next->time();
@@ -318,8 +318,7 @@
<p>Total memory: <tt><?php printf("%5.02f", $totalmemory / 1024 ) ?></tt></p>
<?php
-mysql_free_result($res);
-mysql_close($dbh);
+$dbr->freeResult($res);
?>
</body>

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2666
Default Alt Text
profileinfo.php.patch (1 KB)

Event Timeline