X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/vendor/wikimedia/cdb/src/Reader/DBA.php diff --git a/vendor/wikimedia/cdb/src/Reader/DBA.php b/vendor/wikimedia/cdb/src/Reader/DBA.php new file mode 100644 index 00000000..62f1ad99 --- /dev/null +++ b/vendor/wikimedia/cdb/src/Reader/DBA.php @@ -0,0 +1,62 @@ +handle = dba_open( $fileName, 'r-', 'cdb' ); + if ( !$this->handle ) { + throw new Exception( 'Unable to open CDB file "' . $fileName . '"' ); + } + } + + public function close() { + if ( isset( $this->handle ) ) { + dba_close( $this->handle ); + } + unset( $this->handle ); + } + + public function get( $key ) { + return dba_fetch( $key, $this->handle ); + } + + public function exists( $key ) { + return dba_exists( $key, $this->handle ); + } + + public function firstkey() { + return dba_firstkey( $this->handle ); + } + + public function nextkey() { + return dba_nextkey( $this->handle ); + } +}