Remove a bunch of trailing spaces and unneeded newlines

Change-Id: I166a171c196f4c2c75886be12f913ffa9a4a35ad
This commit is contained in:
umherirrender 2012-10-19 22:10:42 +02:00
parent 2759e2a5ef
commit c66d868e6d
25 changed files with 91 additions and 93 deletions

View file

@ -240,7 +240,7 @@ class BitmapMetadataHandler {
unset( $baseArray['comment'] );
unset( $baseArray['xmp'] );
$baseArray['metadata'] = $meta->getMetadataArray();
$baseArray['metadata']['_MW_GIF_VERSION'] = GIFMetadataExtractor::VERSION;
return $baseArray;

View file

@ -228,7 +228,7 @@ class DjVuImage {
function retrieveMetaData() {
global $wgDjvuToXML, $wgDjvuDump, $wgDjvuTxt;
wfProfileIn( __METHOD__ );
if ( isset( $wgDjvuDump ) ) {
# djvudump is faster as of version 3.5
# http://sourceforge.net/tracker/index.php?func=detail&aid=1704049&group_id=32953&atid=406583
@ -247,7 +247,7 @@ class DjVuImage {
$xml = null;
}
# Text layer
if ( isset( $wgDjvuTxt ) ) {
if ( isset( $wgDjvuTxt ) ) {
wfProfileIn( 'djvutxt' );
$cmd = wfEscapeShellArg( $wgDjvuTxt ) . ' --detail=page ' . wfEscapeShellArg( $this->mFilename ) ;
wfDebug( __METHOD__.": $cmd\n" );
@ -260,7 +260,7 @@ class DjVuImage {
$reg = <<<EOR
/\(page\s[\d-]*\s[\d-]*\s[\d-]*\s[\d-]*\s*"
((?> # Text to match is composed of atoms of either:
\\\\. # - any escaped character
\\\\. # - any escaped character
| # - any character different from " and \
[^"\\\\]+
)*?)

View file

@ -389,7 +389,7 @@ class Exif {
$this->charCodeString( 'UserComment' );
$this->charCodeString( 'GPSProcessingMethod');
$this->charCodeString( 'GPSAreaInformation' );
//ComponentsConfiguration should really be an array instead of a string...
//This turns a string of binary numbers into an array of numbers.
@ -402,7 +402,7 @@ class Exif {
$ccVals['_type'] = 'ol'; //this is for formatting later.
$this->mFilteredExifData['ComponentsConfiguration'] = $ccVals;
}
//GPSVersion(ID) is treated as the wrong type by php exif support.
//Go through each byte turning it into a version string.
//For example: "\x02\x02\x00\x00" -> "2.2.0.0"
@ -451,8 +451,7 @@ class Exif {
}
$charCode = substr( $this->mFilteredExifData[$prop], 0, 8);
$val = substr( $this->mFilteredExifData[$prop], 8);
switch ($charCode) {
case "\x4A\x49\x53\x00\x00\x00\x00\x00":
//JIS
@ -481,7 +480,7 @@ class Exif {
wfRestoreWarnings();
}
}
//trim and check to make sure not only whitespace.
$val = trim($val);
if ( strlen( $val ) === 0 ) {
@ -749,10 +748,10 @@ class Exif {
return false;
}
if( $count > 1 ) {
foreach( $val as $v ) {
foreach( $val as $v ) {
if( !$this->validate( $section, $tag, $v, true ) ) {
return false;
}
return false;
}
}
return true;
}

View file

@ -29,7 +29,7 @@
class GIFHandler extends BitmapHandler {
const BROKEN_FILE = '0'; // value to store in img_metadata if error extracting metadata.
function getMetadata( $image, $filename ) {
try {
$parsedGIFMetadata = BitmapMetadataHandler::GIF( $filename );
@ -143,7 +143,7 @@ class GIFHandler extends BitmapHandler {
wfSuppressWarnings();
$metadata = unserialize($image->getMetadata());
wfRestoreWarnings();
if (!$metadata || $metadata['frameCount'] <= 1) {
return $original;
}
@ -151,19 +151,19 @@ class GIFHandler extends BitmapHandler {
/* Preserve original image info string, but strip the last char ')' so we can add even more */
$info = array();
$info[] = $original;
if ( $metadata['looped'] ) {
$info[] = wfMessage( 'file-info-gif-looped' )->parse();
}
if ( $metadata['frameCount'] > 1 ) {
$info[] = wfMessage( 'file-info-gif-frames' )->numParams( $metadata['frameCount'] )->parse();
}
if ( $metadata['duration'] ) {
$info[] = $wgLang->formatTimePeriod( $metadata['duration'] );
}
return $wgLang->commaList( $info );
}
}

View file

@ -58,7 +58,7 @@ class GIFMetadataExtractor {
$isLooped = false;
$xmp = "";
$comment = array();
if ( !$filename ) {
throw new Exception( "No file name specified" );
} elseif ( !file_exists( $filename ) || is_dir( $filename ) ) {
@ -107,7 +107,7 @@ class GIFMetadataExtractor {
## Read GCT
self::readGCT( $fh, $bpp );
fread( $fh, 1 );
self::skipBlock( $fh );
self::skipBlock( $fh );
} elseif ( $buf == self::$gif_extension_sep ) {
$buf = fread( $fh, 1 );
if ( strlen( $buf ) < 1 ) throw new Exception( "Ran out of input" );
@ -182,23 +182,22 @@ class GIFMetadataExtractor {
// NETSCAPE2.0 (application name for animated gif)
if ( $data == 'NETSCAPE2.0' ) {
$data = fread( $fh, 2 ); // Block length and introduction, should be 03 01
if ($data != "\x03\x01") {
throw new Exception( "Expected \x03\x01, got $data" );
}
// Unsigned little-endian integer, loop count or zero for "forever"
$loopData = fread( $fh, 2 );
if ( strlen( $loopData ) < 2 ) throw new Exception( "Ran out of input" );
$loopData = unpack( 'v', $loopData );
$loopCount = $loopData[1];
if ($loopCount != 1) {
$isLooped = true;
}
// Read out terminator byte
fread( $fh, 1 );
} elseif ( $data == 'XMP DataXMP' ) {

View file

@ -129,7 +129,7 @@ class JpegMetadataExtractor {
// whatever...
$segments["XMP"] = substr( $temp, 29 );
wfDebug( __METHOD__ . ' Found XMP section with wrong app identifier '
. "Using anyways.\n" );
. "Using anyways.\n" );
} elseif ( substr( $temp, 0, 6 ) === "Exif\0\0" ) {
// Just need to find out what the byte order is.
// because php's exif plugin sucks...

View file

@ -88,11 +88,11 @@ class PNGHandler extends BitmapHandler {
function canAnimateThumbnail( $image ) {
return false;
}
function getMetadataType( $image ) {
return 'parsed-png';
}
function isMetadataValid( $image, $metadata ) {
if ( $metadata === self::BROKEN_FILE ) {
@ -134,21 +134,21 @@ class PNGHandler extends BitmapHandler {
$info = array();
$info[] = $original;
if ( $metadata['loopCount'] == 0 ) {
$info[] = wfMessage( 'file-info-png-looped' )->parse();
} elseif ( $metadata['loopCount'] > 1 ) {
$info[] = wfMessage( 'file-info-png-repeat' )->numParams( $metadata['loopCount'] )->parse();
}
if ( $metadata['frameCount'] > 0 ) {
$info[] = wfMessage( 'file-info-png-frames' )->numParams( $metadata['frameCount'] )->parse();
}
if ( $metadata['duration'] ) {
$info[] = $wgLang->formatTimePeriod( $metadata['duration'] );
}
return $wgLang->commaList( $info );
}

View file

@ -124,7 +124,7 @@ class PNGMetadataExtractor {
case 0:
$colorType = 'greyscale';
break;
case 2:
case 2:
$colorType = 'truecolour';
break;
case 3:

View file

@ -75,9 +75,9 @@ class SVGReader {
$this->reader->open( $source, null, LIBXML_NOERROR | LIBXML_NOWARNING );
}
// Expand entities, since Adobe Illustrator uses them for xmlns
// attributes (bug 31719). Note that libxml2 has some protection
// against large recursive entity expansions so this is not as
// Expand entities, since Adobe Illustrator uses them for xmlns
// attributes (bug 31719). Note that libxml2 has some protection
// against large recursive entity expansions so this is not as
// insecure as it might appear to be.
$this->reader->setParserProperty( XMLReader::SUBST_ENTITIES, true );

View file

@ -669,7 +669,7 @@ class XMPInfo {
* 'validate' => 'validateClosed',
* 'choices' => array( '1' => true, '2' => true ),
* ),
*/
*/
),
'http://ns.adobe.com/exif/1.0/aux/' => array(
'Lens' => array(

View file

@ -153,7 +153,7 @@ class XMPValidate {
//check if its in a numeric range
$inRange = false;
if ( isset( $info['rangeLow'] )
if ( isset( $info['rangeLow'] )
&& isset( $info['rangeHigh'] )
&& is_numeric( $val )
&& ( intval( $val ) <= $info['rangeHigh'] )
@ -342,7 +342,7 @@ class XMPValidate {
}
$m = array();
if ( preg_match(
if ( preg_match(
'/(\d{1,3}),(\d{1,2}),(\d{1,2})([NWSE])/D',
$val, $m )
) {
@ -354,7 +354,7 @@ class XMPValidate {
}
$val = $coord;
return;
} elseif ( preg_match(
} elseif ( preg_match(
'/(\d{1,3}),(\d{1,2}(?:.\d*)?)([NWSE])/D',
$val, $m )
) {
@ -367,7 +367,7 @@ class XMPValidate {
return;
} else {
wfDebugLog( 'XMP', __METHOD__
wfDebugLog( 'XMP', __METHOD__
. " Expected GPSCoordinate, but got $val." );
$val = null;
return;

View file

@ -49,7 +49,7 @@ while( false !== ($line = fgets( $in ) ) ) {
$name = $columns[1];
$simpleUpper = $columns[12];
$simpleLower = $columns[13];
$source = codepointToUtf8( hexdec( $codepoint ) );
if( $simpleUpper ) {
$wikiUpperChars[$source] = codepointToUtf8( hexdec( $simpleUpper ) );

View file

@ -765,7 +765,7 @@ class UtfNormal {
* @param $string String The string
* @return String String with the character codes replaced.
*/
private static function replaceForNativeNormalize( $string ) {
private static function replaceForNativeNormalize( $string ) {
$string = preg_replace(
'/[\x00-\x08\x0b\x0c\x0e-\x1f]/',
UTF8_REPLACEMENT,

View file

@ -19,7 +19,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*
* @file
* @ingroup UtfNormal
*/

View file

@ -2,7 +2,7 @@
/**
* Some constant definitions for the unicode normalization module.
*
* Note: these constants must all be resolvable at compile time by HipHop,
* Note: these constants must all be resolvable at compile time by HipHop,
* since this file will not be executed during request startup for a compiled
* MediaWiki.
*

View file

@ -177,7 +177,7 @@ if( $out ) {
*
* @file
*/
UtfNormal::\$utfCombiningClass = unserialize( '$serCombining' );
UtfNormal::\$utfCanonicalComp = unserialize( '$serComp' );
UtfNormal::\$utfCanonicalDecomp = unserialize( '$serCanon' );

View file

@ -28,9 +28,9 @@
* @ingroup Cache
*/
class EhcacheBagOStuff extends BagOStuff {
var $servers, $cacheName, $connectTimeout, $timeout, $curlOptions,
var $servers, $cacheName, $connectTimeout, $timeout, $curlOptions,
$requestData, $requestDataPos;
var $curls = array();
/**
@ -49,7 +49,7 @@ class EhcacheBagOStuff extends BagOStuff {
}
$this->servers = $params['servers'];
$this->cacheName = isset( $params['cache'] ) ? $params['cache'] : 'mw';
$this->connectTimeout = isset( $params['connectTimeout'] )
$this->connectTimeout = isset( $params['connectTimeout'] )
? $params['connectTimeout'] : 1;
$this->timeout = isset( $params['timeout'] ) ? $params['timeout'] : 1;
$this->curlOptions = array(
@ -77,7 +77,7 @@ class EhcacheBagOStuff extends BagOStuff {
if ( $response['http_code'] >= 300 ) {
wfDebug( __METHOD__.": GET failure, got HTTP {$response['http_code']}\n" );
wfProfileOut( __METHOD__ );
return false;
return false;
}
$body = $response['body'];
$type = $response['content_type'];
@ -203,9 +203,9 @@ class EhcacheBagOStuff extends BagOStuff {
* @return int
*/
protected function attemptPut( $key, $data, $type, $ttl ) {
// In initial benchmarking, it was 30 times faster to use CURLOPT_POST
// In initial benchmarking, it was 30 times faster to use CURLOPT_POST
// than CURLOPT_UPLOAD with CURLOPT_READFUNCTION. This was because
// CURLOPT_UPLOAD was pushing the request headers first, then waiting
// CURLOPT_UPLOAD was pushing the request headers first, then waiting
// for an ACK packet, then sending the data, whereas CURLOPT_POST just
// sends the headers and the data in a single send().
$response = $this->doItemRequest( $key,
@ -232,7 +232,7 @@ class EhcacheBagOStuff extends BagOStuff {
*/
protected function createCache( $key ) {
wfDebug( __METHOD__.": creating cache for $key\n" );
$response = $this->doCacheRequest( $key,
$response = $this->doCacheRequest( $key,
array(
CURLOPT_POST => 1,
CURLOPT_CUSTOMREQUEST => 'PUT',
@ -280,7 +280,7 @@ class EhcacheBagOStuff extends BagOStuff {
if ( array_diff_key( $curlOptions, $this->curlOptions ) ) {
// var_dump( array_diff_key( $curlOptions, $this->curlOptions ) );
throw new MWException( __METHOD__.": to prevent options set in one doRequest() " .
"call from affecting subsequent doRequest() calls, only options listed " .
"call from affecting subsequent doRequest() calls, only options listed " .
"in \$this->curlOptions may be specified in the \$curlOptions parameter." );
}
$curlOptions += $this->curlOptions;

View file

@ -101,7 +101,7 @@ class MemcachedBagOStuff extends BagOStuff {
* @return Mixed
*/
public function replace( $key, $value, $exptime = 0 ) {
return $this->client->replace( $this->encodeKey( $key ), $value,
return $this->client->replace( $this->encodeKey( $key ), $value,
$this->fixExpiry( $exptime ) );
}

View file

@ -897,7 +897,7 @@ class MWMemcached {
return false;
}
if ( substr( $data, -2 ) !== "\r\n" ) {
$this->_handle_error( $sock,
$this->_handle_error( $sock,
'line ending missing from data block from $1' );
return false;
}
@ -1096,7 +1096,7 @@ class MWMemcached {
}
/**
* Read the specified number of bytes from a stream. If there is an error,
* Read the specified number of bytes from a stream. If there is an error,
* mark the socket dead.
*
* @param $sock The socket
@ -1137,7 +1137,7 @@ class MWMemcached {
function _fgets( $sock ) {
$result = fgets( $sock );
// fgets() may return a partial line if there is a select timeout after
// a successful recv(), so we have to check for a timeout even if we
// a successful recv(), so we have to check for a timeout even if we
// got a string response.
$data = stream_get_meta_data( $sock );
if ( $data['timed_out'] ) {

View file

@ -81,7 +81,7 @@ class MemcachedPhpBagOStuff extends MemcachedBagOStuff {
public function unlock( $key ) {
return $this->client->unlock( $this->encodeKey( $key ) );
}
/**
* @param $key string
* @param $value int

View file

@ -22,8 +22,8 @@
*/
/**
* A cache class that replicates all writes to multiple child caches. Reads
* are implemented by reading from the caches in the order they are given in
* A cache class that replicates all writes to multiple child caches. Reads
* are implemented by reading from the caches in the order they are given in
* the configuration until a cache gives a positive result.
*
* @ingroup Cache

View file

@ -139,8 +139,8 @@ class ObjectCache {
/**
* Factory function that creates a memcached client object.
*
* This always uses the PHP client, since the PECL client has a different
* hashing scheme and a different interpretation of the flags bitfield, so
* This always uses the PHP client, since the PECL client has a different
* hashing scheme and a different interpretation of the flags bitfield, so
* switching between the two clients randomly would be disasterous.
*
* @param $params array

View file

@ -186,10 +186,10 @@ class SearchIBM_DB2 extends SearchEngine {
$searchon = $this->db->strencode(join(',', $q));
$field = $this->getIndexField($fulltext);
// requires Net Search Extender or equivalent
//return " CONTAINS($field, '$searchon') > 0 ";
return " lcase($field) LIKE lcase('%$searchon%')";
}

View file

@ -78,7 +78,7 @@ class SearchMssql extends SearchEngine {
* Return a partial WHERE clause to limit the search to the given namespaces
*
* @return String
* @private
* @private
*/
function queryNamespaces() {
$namespaces = implode( ',', $this->namespaces );
@ -146,7 +146,7 @@ class SearchMssql extends SearchEngine {
$match = $this->parseQuery( $filteredTerm, $fulltext );
$page = $this->db->tableName( 'page' );
$searchindex = $this->db->tableName( 'searchindex' );
return 'SELECT page_id, page_namespace, page_title, ftindex.[RANK]' .
"FROM $page,FREETEXTTABLE($searchindex , $match, LANGUAGE 'English') as ftindex " .
'WHERE page_id=ftindex.[KEY] ';
@ -196,7 +196,7 @@ class SearchMssql extends SearchEngine {
*/
function update( $id, $title, $text ) {
// We store the column data as UTF-8 byte order marked binary stream
// because we are invoking the plain text IFilter on it so that, and we want it
// because we are invoking the plain text IFilter on it so that, and we want it
// to properly decode the stream as UTF-8. SQL doesn't support UTF8 as a data type
// but the indexer will correctly handle it by this method. Since all we are doing
// is passing this data to the indexer and never retrieving it via PHP, this will save space

View file

@ -29,32 +29,32 @@
* @ingroup Search
*/
class SearchOracle extends SearchEngine {
private $reservedWords = array ('ABOUT' => 1,
'ACCUM' => 1,
'AND' => 1,
'BT' => 1,
'BTG' => 1,
'BTI' => 1,
private $reservedWords = array ('ABOUT' => 1,
'ACCUM' => 1,
'AND' => 1,
'BT' => 1,
'BTG' => 1,
'BTI' => 1,
'BTP' => 1,
'FUZZY' => 1,
'HASPATH' => 1,
'INPATH' => 1,
'MINUS' => 1,
'NEAR' => 1,
'FUZZY' => 1,
'HASPATH' => 1,
'INPATH' => 1,
'MINUS' => 1,
'NEAR' => 1,
'NOT' => 1,
'NT' => 1,
'NTG' => 1,
'NTI' => 1,
'NTP' => 1,
'OR' => 1,
'PT' => 1,
'RT' => 1,
'NT' => 1,
'NTG' => 1,
'NTI' => 1,
'NTP' => 1,
'OR' => 1,
'PT' => 1,
'RT' => 1,
'SQE' => 1,
'SYN' => 1,
'TR' => 1,
'TRSYN' => 1,
'TT' => 1,
'SYN' => 1,
'TR' => 1,
'TRSYN' => 1,
'TT' => 1,
'WITHIN' => 1);
/**
@ -254,13 +254,13 @@ class SearchOracle extends SearchEngine {
), 'SearchOracle::update' );
// Sync the index
// We need to specify the DB name (i.e. user/schema) here so that
// We need to specify the DB name (i.e. user/schema) here so that
// it can work from the installer, where
// ALTER SESSION SET CURRENT_SCHEMA = ...
// was used.
$dbw->query( "CALL ctx_ddl.sync_index(" .
$dbw->query( "CALL ctx_ddl.sync_index(" .
$dbw->addQuotes( $dbw->getDBname() . '.' . $dbw->tableName( 'si_text_idx', 'raw' ) ) . ")" );
$dbw->query( "CALL ctx_ddl.sync_index(" .
$dbw->query( "CALL ctx_ddl.sync_index(" .
$dbw->addQuotes( $dbw->getDBname() . '.' . $dbw->tableName( 'si_title_idx', 'raw' ) ) . ")" );
}