r92957 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92956‎ | r92957 | r92958 >
Date:19:05, 23 July 2011
Author:aaron
Status:ok
Tags:
Comment:
Improved getVersion() error messages
Modified paths:
  • /trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php (modified) (history)

Diff [purge]

Index: trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php
@@ -199,8 +199,10 @@
200200 $db = dba_open( '/usr/local/apache/common/wikiversions.cdb', 'r', 'cdb' );
201201 if ( $db ) {
202202 $version = dba_fetch( $this->getDatabase(), $db );
203 - if ( strpos( $version, 'php-' ) !== 0 ) {
204 - die( "wikiversions.cdb entry should be of the format: php-...\n" );
 203+ if ( $version === false ) {
 204+ die( "wikiversions.cdb has no entry for `$db`.\n" );
 205+ } elseif ( strpos( $version, 'php-' ) !== 0 ) {
 206+ die( "wikiversions.cdb entry does not start with `php-` (got `$version`).\n" );
205207 }
206208 } else {
207209 //trigger_error( "Unable to open /usr/local/apache/common/wikiversions.cdb. Assuming php-1.17", E_USER_ERROR );

Status & tagging log