From 42af65d5cf569cc2364bc1dff15d21930849d483 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 2 Sep 2004 03:13:09 +0000 Subject: [PATCH] Use the result wrapper object. --- includes/SpecialLog.php | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/includes/SpecialLog.php b/includes/SpecialLog.php index 51b512eca4..10b770bac8 100644 --- a/includes/SpecialLog.php +++ b/includes/SpecialLog.php @@ -25,7 +25,6 @@ function wfSpecialLog( $par = '' ) { } $logViewer =& new LogViewer( $logReader ); $logViewer->show(); - $logReader->cleanUp(); } class LogReader { @@ -110,16 +109,8 @@ class LogReader { return $sql; } - function initQuery() { - $this->result = $this->db->query( $this->getQuery() ); - } - - function fetchObject() { - return $this->db->fetchObject( $this->result ); - } - - function cleanUp() { - $this->db->freeResult( $this->result ); + function getRows() { + return $this->db->resultObject( $this->db->query( $this->getQuery() ) ); } function queryType() { @@ -159,10 +150,11 @@ class LogViewer { function showList( &$out ) { $html = ""; - $this->reader->initQuery(); - while( $s = $this->reader->fetchObject() ) { + $result = $this->reader->getRows(); + while( $s = $result->fetchObject() ) { $html .= $this->logLine( $s ); } + $result->free(); $out->addHTML( $html ); } -- 2.20.1