summaryrefslogtreecommitdiff
path: root/includes/BagOStuff.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/BagOStuff.php')
-rw-r--r--includes/BagOStuff.php35
1 files changed, 35 insertions, 0 deletions
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;
+ }
}