r75938 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75937‎ | r75938 | r75939 >
Date:17:04, 3 November 2010
Author:maxsem
Status:ok
Tags:
Comment:
CDB support: never refer to it as just "DB" in messages, it confuses people
Modified paths:
  • /trunk/phase3/includes/Cdb.php (modified) (history)
  • /trunk/phase3/includes/Cdb_PHP.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Cdb_PHP.php
@@ -97,7 +97,7 @@
9898 function __construct( $fileName ) {
9999 $this->handle = fopen( $fileName, 'rb' );
100100 if ( !$this->handle ) {
101 - throw new MWException( 'Unable to open DB file "' . $fileName . '"' );
 101+ throw new MWException( 'Unable to open CDB file "' . $fileName . '"' );
102102 }
103103 $this->findStart();
104104 }
@@ -138,7 +138,7 @@
139139
140140 $buf = fread( $this->handle, $length );
141141 if ( $buf === false || strlen( $buf ) !== $length ) {
142 - throw new MWException( __METHOD__.': read from cdb file failed, file may be corrupted' );
 142+ throw new MWException( __METHOD__.': read from CDB file failed, file may be corrupted' );
143143 }
144144 return $buf;
145145 }
@@ -224,7 +224,7 @@
225225 $this->tmpFileName = $fileName . '.tmp.' . mt_rand( 0, 0x7fffffff );
226226 $this->handle = fopen( $this->tmpFileName, 'wb' );
227227 if ( !$this->handle ) {
228 - throw new MWException( 'Unable to open DB file for write "' . $fileName . '"' );
 228+ throw new MWException( 'Unable to open CDB file for write "' . $fileName . '"' );
229229 }
230230 $this->hplist = array();
231231 $this->numentries = 0;
Index: trunk/phase3/includes/Cdb.php
@@ -98,7 +98,7 @@
9999 function __construct( $fileName ) {
100100 $this->handle = dba_open( $fileName, 'r-', 'cdb' );
101101 if ( !$this->handle ) {
102 - throw new MWException( 'Unable to open DB file "' . $fileName . '"' );
 102+ throw new MWException( 'Unable to open CDB file "' . $fileName . '"' );
103103 }
104104 }
105105
@@ -125,7 +125,7 @@
126126 $this->tmpFileName = $fileName . '.tmp.' . mt_rand( 0, 0x7fffffff );
127127 $this->handle = dba_open( $this->tmpFileName, 'n', 'cdb_make' );
128128 if ( !$this->handle ) {
129 - throw new MWException( 'Unable to open DB file for write "' . $fileName . '"' );
 129+ throw new MWException( 'Unable to open CDB file for write "' . $fileName . '"' );
130130 }
131131 }
132132

Status & tagging log