$prev = $trimmedKey;
}
foreach ( $duplicatePrefixes as $badKey ) {
- wfDebug( "Removing '{$letterMap[$badKey]}' from first letters." );
+ wfDebug( "Removing '{$letterMap[$badKey]}' from first letters.\n" );
unset( $letterMap[$badKey] );
// This code assumes that unsetting does not change sort order.
}
}
if ( isset( $content_actions[$key] ) ) {
- wfDebug( __METHOD__ . ": Found a duplicate key for $key while flattening content_navigation into content_actions." );
+ wfDebug( __METHOD__ . ": Found a duplicate key for $key while flattening " .
+ "content_navigation into content_actions.\n" );
continue;
}
$file = $this->mFile;
if ( ! $file instanceof LocalFile ) {
- wfDebug( __CLASS__ . '::' . __METHOD__ . ' is not supported for this file' );
+ wfDebug( __CLASS__ . '::' . __METHOD__ . " is not supported for this file\n" );
return TitleArray::newFromResult( new FakeResultWrapper( array() ) );
}
return $this->context;
} elseif ( $this->page instanceof Article ) {
// NOTE: $this->page can be a WikiPage, which does not have a context.
- wfDebug( __METHOD__ . ': no context known, falling back to Article\'s context.' );
+ wfDebug( __METHOD__ . ": no context known, falling back to Article's context.\n" );
return $this->page->getContext();
}
} elseif ( $this->mParams['async'] && $this->mParams['filekey'] ) {
// defer verification to background process
} else {
- wfDebug( __METHOD__ . 'about to verify' );
+ wfDebug( __METHOD__ . " about to verify\n" );
$this->verifyUpload();
}
try {
$this->readers[$code] = CdbReader::open( $fileName );
} catch ( CdbException $e ) {
- wfDebug( __METHOD__ . ": unable to open cdb file for reading" );
+ wfDebug( __METHOD__ . ": unable to open cdb file for reading\n" );
}
}
}
$value = $this->readers[$code]->get( $key );
} catch ( CdbException $e ) {
wfDebug( __METHOD__ . ": CdbException caught, error message was "
- . $e->getMessage() );
+ . $e->getMessage() . "\n" );
}
if ( $value === false ) {
return null;
// Initialize the object at the hash as needed...
if ( !isset( self::$instances[$id] ) ) {
self::$instances[$id] = new self( $options );
- wfDebug( "Creating a new " . __CLASS__ . " instance with id $id." );
+ wfDebug( "Creating a new " . __CLASS__ . " instance with id $id.\n" );
}
return self::$instances[$id];
} else {
// Server is dead
wfDebug( "server $server is marked down for another " .
- ( $this->downServers[$server] - $now ) . " seconds, can't get connection" );
+ ( $this->downServers[$server] - $now ) . " seconds, can't get connection\n" );
return false;
}
&& !in_array( $this->db->getType(), array( 'postgres', 'oracle' ) )
) {
$this->db->dropTable( $tbl, __METHOD__ );
- wfDebug( __METHOD__ . " dropping {$newTableName}\n", true );
+ wfDebug( __METHOD__ . " dropping {$newTableName}\n" );
//Dropping the oldTable because the prefix was changed
}
# Create new table
- wfDebug( __METHOD__ . " duplicating $oldTableName to $newTableName\n", true );
+ wfDebug( __METHOD__ . " duplicating $oldTableName to $newTableName\n" );
$this->db->duplicateTableStructure( $oldTableName, $newTableName, $this->useTemporaryTables );
}
}
}
} catch ( Exception $ex ) {
$exception = $ex;
- wfDebug( "Caught exception, will rethrow after rollback: " . $ex->getMessage() );
+ wfDebug( "Caught exception, will rethrow after rollback: " .
+ $ex->getMessage() . "\n" );
}
// rollback remaining transactions
$lb = $this->getLoadBalancer( $cluster );
if ( !in_array( "DB://" . $cluster, (array)$wgDefaultExternalStore ) ) {
- wfDebug( "read only external store" );
+ wfDebug( "read only external store\n" );
$lb->allowLagged( true );
} else {
- wfDebug( "writable external store" );
+ wfDebug( "writable external store\n" );
}
return $lb->getConnection( DB_SLAVE, array(), $wiki );
if ( $this->repo ) {
// Defer rendering if a 404 handler is set up...
if ( $this->repo->canTransformVia404() && !( $flags & self::RENDER_NOW ) ) {
- wfDebug( __METHOD__ . " transformation deferred." );
+ wfDebug( __METHOD__ . " transformation deferred.\n" );
// XXX: Pass in the storage path even though we are not rendering anything
// and the path is supposed to be an FS path. This is due to getScalerType()
// getting called on the path and clobbering $thumb->getUrl() if it's false.
$title = Title::makeTitleSafe( $row->job_namespace, $row->job_title );
if ( !$title ) {
$dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ );
- wfDebug( "Row has invalid title '{$row->job_title}'." );
+ wfDebug( "Row has invalid title '{$row->job_title}'.\n" );
continue; // try again
}
$job = Job::factory( $row->job_cmd, $title,
array( 'job_cmd' => $this->type, 'job_token' => $uuid ), __METHOD__
);
if ( !$row ) { // raced out by duplicate job removal
- wfDebug( "Row deleted as duplicate by another process." );
+ wfDebug( "Row deleted as duplicate by another process.\n" );
}
} else {
break; // nothing to do
}
} elseif ( MWNamespace::isNonincludable( $title->getNamespace() ) ) {
$found = false; # access denied
- wfDebug( __METHOD__ . ": template inclusion denied for " . $title->getPrefixedDBkey() );
+ wfDebug( __METHOD__ . ": template inclusion denied for " .
+ $title->getPrefixedDBkey() . "\n" );
} else {
list( $text, $title ) = $this->getTemplateDom( $title );
if ( $text !== false ) {
$handlerOptions[$paramName] = $match;
} else {
// Guess not. Append it to the caption.
- wfDebug( "$parameterMatch failed parameter validation" );
+ wfDebug( "$parameterMatch failed parameter validation\n" );
$label .= '|' . $parameterMatch;
}
}
wfRunHooks( 'ContributionsLineEnding', array( $this, &$ret, $row, &$classes ) );
if ( $classes === array() && $ret === '' ) {
- wfDebug( 'Dropping Special:Contribution row that could not be formatted' );
+ wfDebug( "Dropping Special:Contribution row that could not be formatted\n" );
$ret = "<!-- Could not format Special:Contribution row. -->\n";
} else {
$ret = Html::rawElement( 'li', array( 'class' => $classes ), $ret ) . "\n";
} else {
# Backwards compatibility hook
if ( !wfRunHooks( 'UploadForm:initial', array( &$this ) ) ) {
- wfDebug( "Hook 'UploadForm:initial' broke output of the upload form" );
+ wfDebug( "Hook 'UploadForm:initial' broke output of the upload form\n" );
return;
}
public static function tryClearStashedUploads( $formData ) {
if ( isset( $formData['Clear'] ) ) {
$stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash();
- wfDebug( "stash has: " . print_r( $stash->listFiles(), true ) );
+ wfDebug( 'stash has: ' . print_r( $stash->listFiles(), true ) . "\n" );
if ( !$stash->clear() ) {
return Status::newFatal( 'uploadstash-errclear' );
// update groups in external authentication database
$wgAuth->updateExternalDBGroups( $user, $add, $remove );
- wfDebug( 'oldGroups: ' . print_r( $oldGroups, true ) );
- wfDebug( 'newGroups: ' . print_r( $newGroups, true ) );
+ wfDebug( 'oldGroups: ' . print_r( $oldGroups, true ) . "\n" );
+ wfDebug( 'newGroups: ' . print_r( $newGroups, true ) . "\n" );
wfRunHooks( 'UserRights', array( &$user, $add, $remove ) );
if ( $newGroups != $oldGroups ) {
// Calculate the values of the operand symbols
$number = strval( $number );
if ( !preg_match( '/^ -? ( ([0-9]+) (?: \. ([0-9]+) )? )$/x', $number, $m ) ) {
- wfDebug( __METHOD__ . ': invalid number input, returning "other"' );
+ wfDebug( __METHOD__ . ": invalid number input, returning 'other'\n" );
return count( $rules );
}
if ( !isset( $m[3] ) ) {