* Add pre- or post-text to the form
* @return String HTML which will be sent to $form->addPreText()
*/
- protected function preText() { return ''; }
+ protected function preText() {
+ return '';
+ }
/**
* @return string
*/
- protected function postText() { return ''; }
+ protected function postText() {
+ return '';
+ }
/**
* Play with the HTMLForm if you need to more substantially
* @param $form HTMLForm
*/
- protected function alterForm( HTMLForm $form ) {}
+ protected function alterForm( HTMLForm $form ) {
+ }
/**
* Get the HTMLForm to control behavior
case self::TYPE_RANGE:
list( $start, /*...*/ ) = IP::parseRange( $this->target );
return $start;
- default: throw new MWException( "Block with invalid type" );
+ default:
+ throw new MWException( "Block with invalid type" );
}
}
case self::TYPE_RANGE:
list( /*...*/, $end ) = IP::parseRange( $this->target );
return $end;
- default: throw new MWException( "Block with invalid type" );
+ default:
+ throw new MWException( "Block with invalid type" );
}
}
/** Counts of membership (cat_pages, cat_subcats, cat_files) */
private $mPages = null, $mSubcats = null, $mFiles = null;
- private function __construct() { }
+ private function __construct() {
+ }
/**
* Set up all member variables using a database query.
// Final cleanup
if ( $wgFullyInitialised ) {
try {
- wfLogProfilingData(); // uses $wgRequest, hence the $wgFullyInitialised condition
- } catch ( Exception $e ) {}
+ // uses $wgRequest, hence the $wgFullyInitialised condition
+ wfLogProfilingData();
+ } catch ( Exception $e ) {
+ }
}
// Exit value should be nonzero for the benefit of shell jobs
* @return String
*/
protected function fillPreparedArg( $matches ) {
- switch( $matches[1] ) {
- case '\\?': return '?';
- case '\\!': return '!';
- case '\\&': return '&';
+ switch ( $matches[1] ) {
+ case '\\?':
+ return '?';
+ case '\\!':
+ return '!';
+ case '\\&':
+ return '&';
}
list( /* $n */, $arg ) = each( $this->preparedArgs );
- switch( $matches[1] ) {
- case '?': return $this->addQuotes( $arg );
- case '!': return $arg;
+ switch ( $matches[1] ) {
+ case '?':
+ return $this->addQuotes( $arg );
+ case '!':
+ return $arg;
case '&':
# return $this->addQuotes( file_get_contents( $arg ) );
throw new DBUnexpectedError( $this, '& mode is not implemented. If it\'s really needed, uncomment the line above.' );
*
* @param $res Mixed: A SQL result
*/
- public function freeResult( $res ) {}
+ public function freeResult( $res ) {
+ }
/**
* A SELECT wrapper which returns a single field from a single result row.
* @return bool|mixed The value from the field, or false on failure.
*/
public function selectField( $table, $var, $cond = '', $fname = 'DatabaseBase::selectField',
- $options = array() )
- {
+ $options = array()
+ ) {
if ( !is_array( $options ) ) {
$options = array( $options );
}
$this->clearFlag( DBO_TRX ); // make each query its own transaction
$callback();
$this->setFlag( $autoTrx ? DBO_TRX : 0 ); // restore automatic begin()
- } catch ( Exception $e ) {}
+ } catch ( Exception $e ) {
+ }
}
} while ( count( $this->mTrxIdleCallbacks ) );
// log it if $wgDebugDBTransactions is enabled.
if ( $this->mTrxDoneWrites && $wgDebugDBTransactions ) {
wfDebug( "$fname: Automatic transaction with writes in progress" .
- " (from {$this->mTrxFname}), performing implicit commit!\n" );
+ " (from {$this->mTrxFname}), performing implicit commit!\n"
+ );
}
}
* @return Boolean: true if operation was successful
*/
public function duplicateTableStructure( $oldName, $newName, $temporary = false,
- $fname = 'DatabaseBase::duplicateTableStructure' )
- {
+ $fname = 'DatabaseBase::duplicateTableStructure'
+ ) {
throw new MWException(
'DatabaseBase::duplicateTableStructure is not implemented in descendant class' );
}
* @param $options Array
* @return void
*/
- public function setSessionOptions( array $options ) {}
+ public function setSessionOptions( array $options ) {
+ }
/**
* Read and execute SQL commands from a file.
function cascadingDeletes() {
return true;
}
+
function cleanupTriggers() {
return true;
}
+
function strictIPs() {
return true;
}
+
function realTimestamps() {
return true;
}
+
function implicitGroupby() {
return false;
}
+
function implicitOrderby() {
return false;
}
+
function functionalIndexes() {
return true;
}
+
function unionSupportsOrderAndLimit() {
return false;
}
$i++;
}
// http://msdn.microsoft.com/en-us/library/cc296183.aspx contains type table
- switch( $intType ) {
- case SQLSRV_SQLTYPE_BIGINT: $strType = 'bigint'; break;
- case SQLSRV_SQLTYPE_BINARY: $strType = 'binary'; break;
- case SQLSRV_SQLTYPE_BIT: $strType = 'bit'; break;
- case SQLSRV_SQLTYPE_CHAR: $strType = 'char'; break;
- case SQLSRV_SQLTYPE_DATETIME: $strType = 'datetime'; break;
- case SQLSRV_SQLTYPE_DECIMAL/*($precision, $scale)*/: $strType = 'decimal'; break;
- case SQLSRV_SQLTYPE_FLOAT: $strType = 'float'; break;
- case SQLSRV_SQLTYPE_IMAGE: $strType = 'image'; break;
- case SQLSRV_SQLTYPE_INT: $strType = 'int'; break;
- case SQLSRV_SQLTYPE_MONEY: $strType = 'money'; break;
- case SQLSRV_SQLTYPE_NCHAR/*($charCount)*/: $strType = 'nchar'; break;
- case SQLSRV_SQLTYPE_NUMERIC/*($precision, $scale)*/: $strType = 'numeric'; break;
- case SQLSRV_SQLTYPE_NVARCHAR/*($charCount)*/: $strType = 'nvarchar'; break;
- // case SQLSRV_SQLTYPE_NVARCHAR('max'): $strType = 'nvarchar(MAX)'; break;
- case SQLSRV_SQLTYPE_NTEXT: $strType = 'ntext'; break;
- case SQLSRV_SQLTYPE_REAL: $strType = 'real'; break;
- case SQLSRV_SQLTYPE_SMALLDATETIME: $strType = 'smalldatetime'; break;
- case SQLSRV_SQLTYPE_SMALLINT: $strType = 'smallint'; break;
- case SQLSRV_SQLTYPE_SMALLMONEY: $strType = 'smallmoney'; break;
- case SQLSRV_SQLTYPE_TEXT: $strType = 'text'; break;
- case SQLSRV_SQLTYPE_TIMESTAMP: $strType = 'timestamp'; break;
- case SQLSRV_SQLTYPE_TINYINT: $strType = 'tinyint'; break;
- case SQLSRV_SQLTYPE_UNIQUEIDENTIFIER: $strType = 'uniqueidentifier'; break;
- case SQLSRV_SQLTYPE_UDT: $strType = 'UDT'; break;
- case SQLSRV_SQLTYPE_VARBINARY/*($byteCount)*/: $strType = 'varbinary'; break;
- // case SQLSRV_SQLTYPE_VARBINARY('max'): $strType = 'varbinary(MAX)'; break;
- case SQLSRV_SQLTYPE_VARCHAR/*($charCount)*/: $strType = 'varchar'; break;
- // case SQLSRV_SQLTYPE_VARCHAR('max'): $strType = 'varchar(MAX)'; break;
- case SQLSRV_SQLTYPE_XML: $strType = 'xml'; break;
- default: $strType = $intType;
+ switch ( $intType ) {
+ case SQLSRV_SQLTYPE_BIGINT:
+ $strType = 'bigint';
+ break;
+ case SQLSRV_SQLTYPE_BINARY:
+ $strType = 'binary';
+ break;
+ case SQLSRV_SQLTYPE_BIT:
+ $strType = 'bit';
+ break;
+ case SQLSRV_SQLTYPE_CHAR:
+ $strType = 'char';
+ break;
+ case SQLSRV_SQLTYPE_DATETIME:
+ $strType = 'datetime';
+ break;
+ case SQLSRV_SQLTYPE_DECIMAL: // ($precision, $scale)
+ $strType = 'decimal';
+ break;
+ case SQLSRV_SQLTYPE_FLOAT:
+ $strType = 'float';
+ break;
+ case SQLSRV_SQLTYPE_IMAGE:
+ $strType = 'image';
+ break;
+ case SQLSRV_SQLTYPE_INT:
+ $strType = 'int';
+ break;
+ case SQLSRV_SQLTYPE_MONEY:
+ $strType = 'money';
+ break;
+ case SQLSRV_SQLTYPE_NCHAR: // ($charCount):
+ $strType = 'nchar';
+ break;
+ case SQLSRV_SQLTYPE_NUMERIC: // ($precision, $scale):
+ $strType = 'numeric';
+ break;
+ case SQLSRV_SQLTYPE_NVARCHAR: // ($charCount)
+ $strType = 'nvarchar';
+ break;
+ // case SQLSRV_SQLTYPE_NVARCHAR('max'):
+ // $strType = 'nvarchar(MAX)';
+ // break;
+ case SQLSRV_SQLTYPE_NTEXT:
+ $strType = 'ntext';
+ break;
+ case SQLSRV_SQLTYPE_REAL:
+ $strType = 'real';
+ break;
+ case SQLSRV_SQLTYPE_SMALLDATETIME:
+ $strType = 'smalldatetime';
+ break;
+ case SQLSRV_SQLTYPE_SMALLINT:
+ $strType = 'smallint';
+ break;
+ case SQLSRV_SQLTYPE_SMALLMONEY:
+ $strType = 'smallmoney';
+ break;
+ case SQLSRV_SQLTYPE_TEXT:
+ $strType = 'text';
+ break;
+ case SQLSRV_SQLTYPE_TIMESTAMP:
+ $strType = 'timestamp';
+ break;
+ case SQLSRV_SQLTYPE_TINYINT:
+ $strType = 'tinyint';
+ break;
+ case SQLSRV_SQLTYPE_UNIQUEIDENTIFIER:
+ $strType = 'uniqueidentifier';
+ break;
+ case SQLSRV_SQLTYPE_UDT:
+ $strType = 'UDT';
+ break;
+ case SQLSRV_SQLTYPE_VARBINARY: // ($byteCount)
+ $strType = 'varbinary';
+ break;
+ // case SQLSRV_SQLTYPE_VARBINARY('max'):
+ // $strType = 'varbinary(MAX)';
+ // break;
+ case SQLSRV_SQLTYPE_VARCHAR: // ($charCount)
+ $strType = 'varchar';
+ break;
+ // case SQLSRV_SQLTYPE_VARCHAR('max'):
+ // $strType = 'varchar(MAX)';
+ // break;
+ case SQLSRV_SQLTYPE_XML:
+ $strType = 'xml';
+ break;
+ default:
+ $strType = $intType;
}
return $strType;
}
return array( $startOpts, $useIndex, $preLimitTail, $postLimitTail );
}
- function setFakeMaster( $enabled = true ) {}
+ function setFakeMaster( $enabled = true ) {
+ }
function getDBname() {
return $this->mDBname;
$this->pos = $row;
}
- function free() {}
+ function free() {
+ }
// Callers want to be able to access fields with $this->fieldName
function fetchObject() {
* Prepare all tracked load balancers for shutdown
* STUB
*/
- function shutdown() {}
+ function shutdown() {
+ }
/**
* Call a method of each tracked load balancer
* LBFactory::enableBackend() to return to normal behavior
*/
class LBFactory_Fake extends LBFactory {
- function __construct( $conf ) {}
+ function __construct( $conf ) {
+ }
function newMainLB( $wiki = false) {
throw new DBAccessError;
}
+
function getMainLB( $wiki = false ) {
throw new DBAccessError;
}
+
function newExternalLB( $cluster, $wiki = false ) {
throw new DBAccessError;
}
+
function &getExternalLB( $cluster, $wiki = false ) {
throw new DBAccessError;
}
- function forEachLB( $callback, $params = array() ) {}
+
+ function forEachLB( $callback, $params = array() ) {
+ }
}
/**
}
class WebInstaller_Readme extends WebInstaller_Document {
- protected function getFileName() { return 'README'; }
+ protected function getFileName() {
+ return 'README';
+ }
}
class WebInstaller_ReleaseNotes extends WebInstaller_Document {
}
class WebInstaller_UpgradeDoc extends WebInstaller_Document {
- protected function getFileName() { return 'UPGRADE'; }
+ protected function getFileName() {
+ return 'UPGRADE';
+ }
}
class WebInstaller_Copying extends WebInstaller_Document {
- protected function getFileName() { return 'COPYING'; }
+ protected function getFileName() {
+ return 'COPYING';
+ }
}
* @defgroup Templates Templates
*/
-if( !defined( 'MEDIAWIKI' ) ) die( -1 );
+if ( !defined( 'MEDIAWIKI' ) ) {
+ die( -1 );
+}
/**
* @ingroup Templates
}
function execute() {
- if( $this->data['message'] ) {
+ if ( $this->data['message'] ) {
?>
<div class="<?php $this->text('messagetype') ?>box">
- <?php if ( $this->data['messagetype'] == 'error' ) { ?>
- <strong><?php $this->msg( 'loginerror' )?></strong><br />
- <?php } ?>
- <?php $this->html('message') ?>
+<?php
+ if ( $this->data['messagetype'] == 'error' ) {
+ ?><strong><?php $this->msg( 'loginerror' ) ?></strong><br /><?php
+ }
+ $this->html('message');
+?>
</div>
<div class="visualClear"></div>
-<?php } ?>
+<?php
+ }
+?>
<div id="signupstart"><?php $this->msgWiki( 'signupstart' ); ?></div>
<div id="userlogin">
<h2><?php $this->msg('createaccount') ?></h2>
<p id="userloginlink"><?php $this->html('link') ?></p>
<?php $this->html('header'); /* pre-table point for form plugins... */ ?>
- <?php if( $this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
+<?php
+ if ( $this->haveData( 'languages' ) ) {
+ ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php
+ }
+?>
<table>
<tr>
<td class="mw-label"><label for='wpName2'><?php $this->msg('yourname') ?></label></td>
<tr>
<td></td>
<td class="mw-input">
- <?php if( $this->data['createemail'] ) {
+<?php
+ if ( $this->data['createemail'] ) {
echo Xml::checkLabel(
wfMessage( 'createaccountmail' )->text(),
'wpCreateaccountMail',
$this->data['createemailset'],
array( 'tabindex' => '2' )
);
- } ?>
+ }
+?>
</td>
</tr>
<tr class="mw-row-password">
) + User::passwordChangeInputAttribs() ); ?>
</td>
</tr>
- <?php if( $this->data['usedomain'] ) {
+<?php
+ if ( $this->data['usedomain'] ) {
$doms = "";
- foreach( $this->data['domainnames'] as $dom ) {
+ foreach ( $this->data['domainnames'] as $dom ) {
$doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
}
- ?>
+?>
<tr id="mw-user-domain-section">
<td class="mw-label"><?php $this->msg( 'yourdomainname' ) ?></td>
<td class="mw-input">
</select>
</td>
</tr>
- <?php } ?>
+<?php
+ }
+?>
<tr class="mw-row-password">
<td class="mw-label"><label for='wpRetype'><?php $this->msg('yourpasswordagain') ?></label></td>
<td class="mw-input">
</td>
</tr>
<tr>
- <?php if( $this->data['useemail'] ) { ?>
+<?php
+ if ( $this->data['useemail'] ) {
+?>
<td class="mw-label"><label for='wpEmail'><?php $this->msg('youremail') ?></label></td>
<td class="mw-input">
<?php
} ?>
</div>
</td>
- <?php } ?>
- <?php if( $this->data['userealname'] ) { ?>
+<?php
+ }
+
+ if ( $this->data['userealname'] ) {
+?>
</tr>
<tr>
<td class="mw-label"><label for='wpRealName'><?php $this->msg('yourrealname') ?></label></td>
<?php $this->msgWiki('prefs-help-realname'); ?>
</div>
</td>
- <?php } ?>
- <?php if( $this->data['usereason'] ) { ?>
+<?php
+ }
+
+ if ( $this->data['usereason'] ) {
+?>
</tr>
<tr>
<td class="mw-label"><label for='wpReason'><?php $this->msg('createaccountreason') ?></label></td>
tabindex="8"
value="<?php $this->text('reason') ?>" size='20' />
</td>
- <?php } ?>
+<?php
+ }
+?>
</tr>
- <?php if( $this->data['canremember'] ) { ?>
+<?php
+ if ( $this->data['canremember'] ) {
+?>
<tr>
<td></td>
<td class="mw-input">
?>
</td>
</tr>
-<?php }
+<?php
+ }
$tabIndex = 10;
if ( isset( $this->data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) {
<label for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
$this->msgHtml( $inputItem['msg'] ) ?></label><?php
}
- if( $inputItem['helptext'] !== false ) {
+ if ( $inputItem['helptext'] !== false ) {
?>
<div class="prefsectiontip">
<?php $this->msgWiki( $inputItem['helptext'] ); ?>
- </div>
- <?php } ?>
+ </div><?php
+ }
+ ?>
</td>
</tr>
<?php
</td>
</tr>
</table>
-<?php if( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
-<?php if( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpCreateaccountToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
+<?php
+ if ( $this->haveData( 'uselang' ) ) {
+ ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php
+ }
+ if ( $this->haveData( 'token' ) ) {
+ ?><input type="hidden" name="wpCreateaccountToken" value="<?php $this->text( 'token' ); ?>" /><?php
+ }
+?>
</form>
</div>
<div id="signupend"><?php $this->html( 'signupend' ); ?></div>
*/
class UserloginTemplate extends QuickTemplate {
function execute() {
- if( $this->data['message'] ) {
+ if ( $this->data['message'] ) {
?>
<div class="<?php $this->text('messagetype') ?>box">
- <?php if ( $this->data['messagetype'] == 'error' ) { ?>
- <strong><?php $this->msg( 'loginerror' )?></strong><br />
- <?php } ?>
+ <?php
+ if ( $this->data['messagetype'] == 'error' ) {
+ ?><strong><?php $this->msg( 'loginerror' ) ?></strong><br /><?php
+ }
+ ?>
<?php $this->html('message') ?>
</div>
- <div class="visualClear"></div>
-<?php } ?>
+ <div class="visualClear"></div><?php
+ }
+?>
<div id="loginstart"><?php $this->msgWiki( 'loginstart' ); ?></div>
<div id="userloginForm">
<form name="userlogin" method="post" action="<?php $this->text('action') ?>">
<p id="userloginlink"><?php $this->html('link') ?></p>
<?php $this->html('header'); /* pre-table point for form plugins... */ ?>
<div id="userloginprompt"><?php $this->msgWiki('loginprompt') ?></div>
- <?php if( $this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
+<?php
+ if ( $this->haveData( 'languages' ) ) {
+ ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php
+ }
+?>
<table>
<tr>
<td class="mw-label"><label for='wpName1'><?php $this->msg('yourname') ?></label></td>
</td>
</tr>
- <?php if( isset( $this->data['usedomain'] ) && $this->data['usedomain'] ) {
+<?php
+ if ( isset( $this->data['usedomain'] ) && $this->data['usedomain'] ) {
$doms = "";
- foreach( $this->data['domainnames'] as $dom ) {
+ foreach ( $this->data['domainnames'] as $dom ) {
$doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
}
- ?>
+?>
<tr id="mw-user-domain-section">
<td class="mw-label"><?php $this->msg( 'yourdomainname' ) ?></td>
<td class="mw-input">
</select>
</td>
</tr>
- <?php }
+<?php
+ }
- if( $this->haveData( 'extrafields' ) ) {
- echo $this->data['extrafields'];
- }
+ if ( $this->haveData( 'extrafields' ) ) {
+ echo $this->data['extrafields'];
+ }
- if( $this->data['canremember'] ) { ?>
+ if ( $this->data['canremember'] ) {
+?>
<tr>
<td></td>
<td class="mw-input">
?>
</td>
</tr>
-<?php } ?>
-<?php if( $this->data['cansecurelogin'] ) { ?>
+<?php
+ }
+
+ if ( $this->data['cansecurelogin'] ) {
+?>
<tr>
<td></td>
<td class="mw-input">
$this->data['stickHTTPS'],
array( 'tabindex' => '9' )
);
- ?>
+?>
</td>
</tr>
-<?php } ?>
+<?php
+ }
+?>
<tr>
<td></td>
<td class="mw-submit">
- <?php
- echo Html::input( 'wpLoginAttempt', wfMessage( 'login' )->text(), 'submit', array(
- 'id' => 'wpLoginAttempt',
- 'tabindex' => '9'
- ) );
+ <?php
+ echo Html::input( 'wpLoginAttempt', wfMessage( 'login' )->text(), 'submit', array(
+ 'id' => 'wpLoginAttempt',
+ 'tabindex' => '9'
+ ) );
if ( $this->data['useemail'] && $this->data['canreset'] ) {
- if( $this->data['resetlink'] === true ) {
+ if ( $this->data['resetlink'] === true ) {
echo ' ';
echo Linker::link(
SpecialPage::getTitleFor( 'PasswordReset' ),
wfMessage( 'userlogin-resetlink' )
);
- } elseif( $this->data['resetlink'] === null ) {
+ } elseif ( $this->data['resetlink'] === null ) {
echo ' ';
echo Html::input(
'wpMailmypassword',
)
);
}
- } ?>
-
+ }
+?>
</td>
</tr>
</table>
-<?php if( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
-<?php if( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
+<?php
+ if ( $this->haveData( 'uselang' ) ) {
+ ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php
+ }
+
+ if ( $this->haveData( 'token' ) ) {
+ ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php
+ }
+?>
</form>
</div>
<div id="loginend"><?php $this->html( 'loginend' ); ?></div>
* @since 1.18
* @return string
*/
- public function getSourceType() { return null; }
+ public function getSourceType() {
+ return null;
+ }
/**
* Initialize the path information
protected $mOffset, $mChunkIndex, $mFileKey, $mVirtualTempPath;
/**
- * Setup local pointers to stash, repo and user ( similar to UploadFromStash )
+ * Setup local pointers to stash, repo and user (similar to UploadFromStash)
*
* @param $user User
* @param $stash UploadStash
$this->mOffset = 0;
// Create a local stash target
$this->mLocalFile = parent::stashFile();
- // Update the initial file offset ( based on file size )
+ // Update the initial file offset (based on file size)
$this->mOffset = $this->mLocalFile->getSize();
$this->mFileKey = $this->mLocalFile->getFileKey();
}
wfDebugLog( 'fileconcatenate', "Combined $i chunks in $tAmount seconds.\n" );
// Update the mTempPath and mLocalFile
- // ( for FileUpload or normal Stash to take over )
+ // (for FileUpload or normal Stash to take over)
$this->mTempPath = $tmpPath; // file system path
$tStart = microtime( true );
$this->mLocalFile = parent::stashFile( $this->user );
/**
* @return string
*/
- public function getSourceType() { return 'url'; }
+ public function getSourceType() {
+ return 'url';
+ }
/**
* @return Status