From: Brion Vibber Date: Thu, 2 Sep 2004 03:13:09 +0000 (+0000) Subject: Use the result wrapper object. X-Git-Tag: 1.5.0alpha1~2167 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=42af65d5cf569cc2364bc1dff15d21930849d483;p=lhc%2Fweb%2Fwiklou.git Use the result wrapper object. --- 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 ); }