From 086ae52d12011746a75f5588e877347bc0457352 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 21 Mar 2008 11:49:34 +0100 Subject: Update auf MediaWiki 1.12.0 --- includes/BagOStuff.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'includes/BagOStuff.php') diff --git a/includes/BagOStuff.php b/includes/BagOStuff.php index a40d020e..226abb35 100644 --- a/includes/BagOStuff.php +++ b/includes/BagOStuff.php @@ -73,6 +73,11 @@ class BagOStuff { return true; } + function keys() { + /* stub */ + return array(); + } + /* *** Emulated functions *** */ /* Better performance can likely be got with custom written versions */ function get_multi($keys) { @@ -202,6 +207,10 @@ class HashBagOStuff extends BagOStuff { unset($this->bag[$key]); return true; } + + function keys() { + return array_keys( $this->bag ); + } } /* @@ -283,6 +292,19 @@ abstract class SqlBagOStuff extends BagOStuff { return true; /* ? */ } + function keys() { + $res = $this->_query( "SELECT keyname FROM $0" ); + if(!$res) { + $this->_debug("keys: ** error: " . $this->_dberror($res) . " **"); + return array(); + } + $result = array(); + while( $row = $this->_fetchobject($res) ) { + $result[] = $row->keyname; + } + return $result; + } + function getTableName() { return $this->table; } @@ -743,6 +765,19 @@ class DBABagOStuff extends BagOStuff { wfProfileOut( __METHOD__ ); return $ret; } + + function keys() { + $reader = $this->getReader(); + $k1 = dba_firstkey( $reader ); + if( !$k1 ) { + return array(); + } + $result[] = $k1; + while( $key = dba_nextkey( $reader ) ) { + $result[] = $key; + } + return $result; + } } -- cgit v1.2.3-54-g00ecf