* @param $timestamp string
* @return bool Returns true if the response code was set to 304 Not Modified.
*/
- function checkLastModified ( $timestamp ) {
+ function checkLastModified( $timestamp ) {
global $wgCachePages, $wgCacheEpoch, $wgUser;
$fname = 'AjaxResponse::checkLastModified';
* Set a cookie in the cookie jar. Make sure only one cookie per-name exists.
* @see Cookie::set()
*/
- public function setCookie ( $name, $value, $attr ) {
+ public function setCookie( $name, $value, $attr ) {
/* cookies: case insensitive, so this should work.
* We'll still send the cookies back in the same case we got them, though.
*/
* @param string $domain cookie's domain
* @return null
*/
- public function parseCookieResponseHeader ( $cookie, $domain ) {
+ public function parseCookieResponseHeader( $cookie, $domain ) {
$len = strlen( 'Set-Cookie:' );
if ( substr_compare( 'Set-Cookie:', $cookie, 0, $len, true ) === 0 ) {
* If not set will magically default to either watchdefault or watchcreations
* @return bool
*/
- protected function getWatchlistValue ( $watchlist, $titleObj, $userOption = null ) {
+ protected function getWatchlistValue( $watchlist, $titleObj, $userOption = null ) {
$userWatching = $this->getUser()->isWatched( $titleObj );
*
* @param bool $b Whether or not ampersands should be escaped.
*/
- public function setUnescapeAmps ( $b ) {
+ public function setUnescapeAmps( $b ) {
$this->mUnescapeAmps = $b;
}
* @param string $otherParams of otherParams (iiurlparam).
* @return Array of parameters for transform.
*/
- protected function mergeThumbParams ( $image, $thumbParams, $otherParams ) {
+ protected function mergeThumbParams( $image, $thumbParams, $otherParams ) {
if ( !$otherParams ) {
return $thumbParams;
}
return $version;
}
- function tableExists ( $table, $fname = __METHOD__, $schema = false ) {
+ function tableExists( $table, $fname = __METHOD__, $schema = false ) {
$res = sqlsrv_query( $this->mConn, "SELECT * FROM information_schema.tables
WHERE table_type='BASE TABLE' AND table_name = '$table'" );
if ( $res === false ) {
*/
class MssqlField implements Field {
private $name, $tablename, $default, $max_length, $nullable, $type;
- function __construct ( $info ) {
+ function __construct( $info ) {
$this->name = $info['COLUMN_NAME'];
$this->tablename = $info['TABLE_NAME'];
$this->default = $info['COLUMN_DEFAULT'];
private $name, $tablename, $default, $max_length, $nullable,
$is_pk, $is_unique, $is_multiple, $is_key, $type;
- function __construct ( $info ) {
+ function __construct( $info ) {
$this->name = $info->name;
$this->tablename = $info->table;
$this->default = $info->def;
return $retVal;
}
- private function fieldBindStatement ( $table, $col, &$val, $includeCol = false ) {
+ private function fieldBindStatement( $table, $col, &$val, $includeCol = false ) {
$col_info = $this->fieldInfoMulti( $table, $col );
$col_type = $col_info != false ? $col_info->type() : 'CONSTANT';
}
}
- private function wrapConditionsForWhere ( $table, $conds, $parentCol = null ) {
+ private function wrapConditionsForWhere( $table, $conds, $parentCol = null ) {
$conds2 = array();
foreach ( $conds as $col => $val ) {
if ( is_array( $val ) ) {
protected $id;
protected $didbegin;
- public function __construct ( $dbw, $id ) {
+ public function __construct( $dbw, $id ) {
$this->dbw = $dbw;
$this->id = $id;
$this->didbegin = false;
return $this->mLastResult;
}
- protected function dumpError () {
+ protected function dumpError() {
$diags = array( PGSQL_DIAG_SEVERITY,
PGSQL_DIAG_SQLSTATE,
PGSQL_DIAG_MESSAGE_PRIMARY,
* @since 1.19
* @return Array
*/
- function indexAttributes ( $index, $schema = false ) {
+ function indexAttributes( $index, $schema = false ) {
if ( $schema === false )
$schema = $this->getCoreSchema();
/*
* @param $to_lines
* @return array
*/
- function diff ( $from_lines, $to_lines ) {
+ function diff( $from_lines, $to_lines ) {
wfProfileIn( __METHOD__ );
// Diff and store locally
* @param $from_lines
* @param $to_lines
*/
- function diff_local ( $from_lines, $to_lines ) {
+ function diff_local( $from_lines, $to_lines ) {
global $wgExternalDiffEngine;
wfProfileIn( __METHOD__ );
* @param $yoff
* @param $ylim
*/
- function _compareseq ( $xoff, $xlim, $yoff, $ylim ) {
+ function _compareseq( $xoff, $xlim, $yoff, $ylim ) {
// Slide down the bottom initial diagonal.
while ( $xoff < $xlim && $yoff < $ylim
&& $this->xv[$xoff] == $this->yv[$yoff] ) {
* @param $words
* @param $tag string
*/
- function addWords ( $words, $tag = '' ) {
+ function addWords( $words, $tag = '' ) {
if ( $tag != $this->_tag ) {
$this->_flushGroup( $tag );
}
* @param $orig_lines
* @param $closing_lines
*/
- function __construct ( $orig_lines, $closing_lines ) {
+ function __construct( $orig_lines, $closing_lines ) {
wfProfileIn( __METHOD__ );
list( $orig_words, $orig_stripped ) = $this->_split( $orig_lines );
abstract protected function getFileName();
- public function execute() {
+ public function execute() {
$text = $this->getFileContents();
$text = InstallDocFormatter::format( $text );
$this->parent->output->addWikiText( $text );
*
* @param string $app13 String containing app13 block from jpeg file
*/
- private function doApp13 ( $app13 ) {
+ private function doApp13( $app13 ) {
try {
$this->iptcType = JpegMetadataExtractor::doPSIR( $app13 );
} catch ( MWException $e ) {
* @param $filename string
* @param $byteOrder string
*/
- function getExif ( $filename, $byteOrder ) {
+ function getExif( $filename, $byteOrder ) {
global $wgShowEXIF;
if ( file_exists( $filename ) && $wgShowEXIF ) {
$exif = new Exif( $filename, $byteOrder );
* @param array $metaArray array of metadata values
* @param string $type type. defaults to other. if two things have the same type they're merged
*/
- function addMetadata ( $metaArray, $type = 'other' ) {
+ function addMetadata( $metaArray, $type = 'other' ) {
if ( isset( $this->metadata[$type] ) ) {
/* merge with old data */
$metaArray = $metaArray + $this->metadata[$type];
*
* @return Array metadata array
*/
- function getMetadataArray () {
+ function getMetadataArray() {
// this seems a bit ugly... This is all so its merged in right order
// based on the MWG recomendation.
$temp = Array();
* @return array metadata result array.
* @throws MWException on invalid file.
*/
- static function Jpeg ( $filename ) {
+ static function Jpeg( $filename ) {
$showXMP = function_exists( 'xml_parser_create_ns' );
$meta = new self();
* @param string $filename full path to file
* @return Array Array for storage in img_metadata.
*/
- public static function PNG ( $filename ) {
+ public static function PNG( $filename ) {
$showXMP = function_exists( 'xml_parser_create_ns' );
$meta = new self();
* @param string $filename full path to file
* @return Array metadata array
*/
- public static function GIF ( $filename ) {
+ public static function GIF( $filename ) {
$meta = new self();
$baseArray = GIFMetadataExtractor::getMetadata( $filename );
* @throws MWException
* @return Array The metadata.
*/
- public static function Tiff ( $filename ) {
+ public static function Tiff( $filename ) {
if ( file_exists( $filename ) ) {
$byteOrder = self::getTiffByteOrder( $filename );
if ( !$byteOrder ) {
* This has not been tested on any shift-JIS strings.
* @param string $prop prop name.
*/
- private function charCodeString ( $prop ) {
+ private function charCodeString( $prop ) {
if ( isset( $this->mFilteredExifData[$prop] ) ) {
if ( strlen( $this->mFilteredExifData[$prop] ) <= 8 ) {
* the type of UNDEFINED field
* @param string $prop name of property
*/
- private function exifPropToOrd ( $prop ) {
+ private function exifPropToOrd( $prop ) {
if ( isset( $this->mFilteredExifData[$prop] ) ) {
$this->mFilteredExifData[$prop] = ord( $this->mFilteredExifData[$prop] );
}
* for example 10 degress 20`40`` S -> -10.34444
* @param string $prop a gps coordinate exif tag name (like GPSLongitude)
*/
- private function exifGPStoNumber ( $prop ) {
+ private function exifGPStoNumber( $prop ) {
$loc =& $this->mFilteredExifData[$prop];
$dir =& $this->mFilteredExifData[$prop . 'Ref'];
$res = false;
*
* @return string|array
*/
- private static function convIPTC ( $data, $charset ) {
+ private static function convIPTC( $data, $charset ) {
if ( is_array( $data ) ) {
foreach ( $data as &$val ) {
$val = self::convIPTCHelper( $val, $charset );
*
* @return string
*/
- private static function convIPTCHelper ( $data, $charset ) {
+ private static function convIPTCHelper( $data, $charset ) {
if ( $charset ) {
wfSuppressWarnings();
$data = iconv( $charset, "UTF-8//IGNORE", $data );
*/
class JpegHandler extends ExifBitmapHandler {
- function getMetadata ( $image, $filename ) {
+ function getMetadata( $image, $filename ) {
try {
$meta = BitmapMetadataHandler::Jpeg( $filename );
if ( !is_array( $meta ) ) {
* @return Array of interesting segments.
* @throws MWException if given invalid file.
*/
- static function segmentSplitter ( $filename ) {
+ static function segmentSplitter( $filename ) {
$showXMP = function_exists( 'xml_parser_create_ns' );
$segmentCount = 0;
* @throws MWException (It gets caught next level up though)
* @return String if the iptc hash is good or not.
*/
- public static function doPSIR ( $app13 ) {
+ public static function doPSIR( $app13 ) {
if ( !$app13 ) {
throw new MWException( "No App13 segment given" );
}
*
* @return string version string
*/
- static function getMetadataVersion () {
+ static function getMetadataVersion() {
$version = Array( '2' ); // core metadata version
wfRunHooks( 'GetMetadataVersion', Array( &$version ) );
return implode( ';', $version);
*
* @param string $elm Namespace of element followed by a space and then tag name of element.
*/
- private function endElementModeIgnore ( $elm ) {
+ private function endElementModeIgnore( $elm ) {
if ( $this->curItem[0] === $elm ) {
array_shift( $this->curItem );
array_shift( $this->mode );
*
* @param string $elm namespace, space, and tag name.
*/
- private function endElementModeSimple ( $elm ) {
+ private function endElementModeSimple( $elm ) {
if ( $this->charContent !== false ) {
if ( $this->processingArray ) {
// if we're processing an array, use the original element
/** get the items array
* @return Array XMP item configuration array.
*/
- public static function getItems () {
+ public static function getItems() {
if( !self::$ranHooks ) {
// This is for if someone makes a custom metadata extension.
// For example, a medical wiki might want to decode DICOM xmp properties.
* or DDD,MM.mmk form
* @param $standalone Boolean if its a simple prop (should always be true)
*/
- public static function validateGPS ( $info, &$val, $standalone ) {
+ public static function validateGPS( $info, &$val, $standalone ) {
if ( !$standalone ) {
return;
}
function setNewSection( $value ) {
$this->mNewSection = (bool)$value;
}
- function hideNewSection ( $value ) {
+ function hideNewSection( $value ) {
$this->mHideNewSection = (bool)$value;
}
- function getHideNewSection () {
+ function getHideNewSection() {
return (bool)$this->mHideNewSection;
}
function getNewSection() {
return $this->namespaces;
}
- public function setNamespace ( $ns ) {
+ public function setNamespace( $ns ) {
if( !$ns || $ns < NS_MAIN ) {
$ns = NS_MAIN;
}
* @param $result The query result
* @return string The category link
*/
- function formatResult ( $skin, $result ) {
+ function formatResult( $skin, $result ) {
$title = Title::makeTitle( NS_CATEGORY, $result->title );
$text = $title->getText();
* @param string $key key under which file information is stored
* @return Array
*/
- public function getMetadata ( $key ) {
+ public function getMetadata( $key ) {
$this->getFile( $key );
return $this->fileMetadata[$key];
}
* @param string $key key under which file information is stored
* @return Array
*/
- public function getFileProps ( $key ) {
+ public function getFileProps( $key ) {
$this->getFile( $key );
return $this->fileProps[$key];
}
* @param $string string
* @return mixed|string
*/
- function ucfirst ( $string ) {
+ function ucfirst( $string ) {
if ( $string[0] == 'i' ) {
return 'İ' . substr( $string, 1 );
} else {
*
* @return string
*/
- function ucfirst ( $string ) {
+ function ucfirst( $string ) {
if ( substr( $string, 0, 1 ) === 'i' ) {
return 'İ' . substr( $string, 1 );
} else {
*
* @return mixed|string
*/
- function lcfirst ( $string ) {
+ function lcfirst( $string ) {
if ( substr( $string, 0, 1 ) === 'I' ) {
return 'ı' . substr( $string, 1 );
} else {
*
* @return string
*/
- function ucfirst ( $string ) {
+ function ucfirst( $string ) {
$variant = $this->getPreferredVariant();
if ( ( $variant == 'kk-latn' || $variant == 'kk-tr' ) && $string[0] == 'i' ) {
$string = 'İ' . substr( $string, 1 );
*
* @return string
*/
- function lcfirst ( $string ) {
+ function lcfirst( $string ) {
$variant = $this->getPreferredVariant();
if ( ( $variant == 'kk-latn' || $variant == 'kk-tr' ) && $string[0] == 'I' ) {
$string = 'ı' . substr( $string, 1 );
* @param $string string
* @return string
*/
- function ucfirst ( $string ) {
+ function ucfirst( $string ) {
if ( strlen( $string ) && $string[0] == 'i' ) {
return 'İ' . substr( $string, 1 );
} else {
* @param $string string
* @return mixed|string
*/
- function lcfirst ( $string ) {
+ function lcfirst( $string ) {
if ( strlen( $string ) && $string[0] == 'I' ) {
return 'ı' . substr( $string, 1 );
} else {
'oracle'
);
- function __construct( $name = null, array $data = array(), $dataName = '' ) {
+ function __construct( $name = null, array $data = array(), $dataName = '' ) {
parent::__construct( $name, $data, $dataName );
$this->backupGlobals = false;
*/
class LinksUpdateTest extends MediaWikiTestCase {
- function __construct( $name = null, array $data = array(), $dataName = '' ) {
+ function __construct( $name = null, array $data = array(), $dataName = '' ) {
parent::__construct( $name, $data, $dataName );
$this->tablesUsed = array_merge( $this->tablesUsed,
*/
var $the_page;
- function __construct( $name = null, array $data = array(), $dataName = '' ) {
+ function __construct( $name = null, array $data = array(), $dataName = '' ) {
parent::__construct( $name, $data, $dataName );
$this->tablesUsed = array_merge( $this->tablesUsed,
var $pages_to_delete;
- function __construct( $name = null, array $data = array(), $dataName = '' ) {
+ function __construct( $name = null, array $data = array(), $dataName = '' ) {
parent::__construct( $name, $data, $dataName );
$this->tablesUsed = array_merge(
protected $queueRand, $queueRandTTL, $queueFifo, $queueFifoTTL;
protected $old = array();
- function __construct( $name = null, array $data = array(), $dataName = '' ) {
+ function __construct( $name = null, array $data = array(), $dataName = '' ) {
parent::__construct( $name, $data, $dataName );
$this->tablesUsed[] = 'job';
* actual resolution of the image is (aka in dots per meter).
*/
/*
- function testPngPhysTag () {
+ function testPngPhysTag() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'Png-native-test.png' );