/**
* @param $text string
+ * @return void
*/
public function setText( $text ) {
$this->uncompress();
*
* @param $name Mixed: name of hook
* @param $callback Mixed: callback function to attach
+ * @return void
*/
public static function register( $name, $callback ) {
if( !isset( self::$handlers[$name] ) ) {
}
/**
- * @param $file File
+ * @param $file File:
+ * @return void
*/
public function setFile( $file ) {
$this->mPage->setFile( $file );
* Called from getBody(), before getStartBody() is called and
* after doQuery() was called. This will be called only if there
* are rows in the result set.
+ *
+ * @return void
*/
protected function doBatchLookups() {}
* @param $user User
* @param $context IContextSource
* @param $defaultPreferences
+ * @return void
*/
static function profilePreferences( $user, IContextSource $context, &$defaultPreferences ) {
global $wgAuth, $wgContLang, $wgParser, $wgCookieExpiration, $wgLanguageCode,
* @param $user User
* @param $context IContextSource
* @param $defaultPreferences
+ * @return void
*/
static function skinPreferences( $user, IContextSource $context, &$defaultPreferences ) {
## Skin #####################################
* @param $user User
* @param $context IContextSource
* @param $defaultPreferences
+ * @return void
*/
static function datetimePreferences( $user, IContextSource $context, &$defaultPreferences ) {
## Date and time #####################################
/**
* @param $client SquidPurgeClient
+ * @return void
*/
public function addClient( $client ) {
$this->clients[] = $client;
* If false is given, the title will be treated as non-existing.
*
* @param $row Object|false database row
+ * @return void
*/
public function loadFromRow( $row ) {
if ( $row ) { // page found
/**
* @param $row ResultWrapper
+ * @return void
*/
protected function setCurrent( $row ) {
if ( $row === false ) {
/**
* @param $row
+ * @return void
*/
protected function setCurrent( $row ) {
if ( $row === false ) {
* - redirect loop
* - special pages
* - normal pages
+ *
+ * @return void
*/
private function performRequest() {
global $wgServer, $wgUsePathInfo, $wgTitle;
* A DB query result object or...
* "fromdb" to get from a slave DB or...
* "fromdbmaster" to get from the master DB
+ * @return void
*/
public function loadPageData( $data = 'fromdb' ) {
if ( $data === 'fromdbmaster' ) {
/**
* Set the page timestamp (use only to avoid DB queries)
* @param $ts string MW timestamp of last article revision
+ * @return void
*/
public function setTimestamp( $ts ) {
$this->mTimestamp = wfTimestamp( TS_MW, $ts );
* Set the cached timestamp for the last time the page changed.
* This is only used to help handle slave lag by comparing to page_touched.
* @param $timestamp string
+ * @return void
*/
public function setCachedLastEditTime( $timestamp ) {
global $wgMemc;
* @param $revisionCount int
* @param $successCount int
* @param $pageInfo
+ * @return void
*/
function reportPage( $title, $origTitle, $revisionCount, $successCount, $pageInfo ) {
// Add a result entry
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
private function run( $resultPageSet = null ) {
$db = $this->getDB();
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
public function executeGenerator( $resultPageSet ) {
if ( $resultPageSet->isResolvingRedirects() ) {
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
private function run( $resultPageSet = null ) {
$repo = $this->mRepo;
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
public function executeGenerator( $resultPageSet ) {
if ( $resultPageSet->isResolvingRedirects() ) {
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
private function run( $resultPageSet = null ) {
$db = $this->getDB();
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
private function prepareFirstQuery( $resultPageSet = null ) {
/* SELECT page_id, page_title, page_namespace, page_is_redirect
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
private function prepareSecondQuery( $resultPageSet = null ) {
/* SELECT page_id, page_title, page_namespace, page_is_redirect, pl_title, pl_namespace
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
private function run( $resultPageSet = null ) {
$this->params = $this->extractRequestParams( false );
* Also adds relevant block information
*
* @param bool $showBlockInfo
+ * @return void
*/
public function showHiddenUsersAddBlockInfo( $showBlockInfo ) {
$userCanViewHiddenUsers = $this->getUser()->isAllowed( 'hideuser' );
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
private function run( $resultPageSet = null ) {
$params = $this->extractRequestParams();
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
private function run( $resultPageSet = null ) {
$params = $this->extractRequestParams();
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
public function run( $resultPageSet = null ) {
$params = $this->extractRequestParams();
/**
* @param $pageSet ApiPageSet
+ * @return void
*/
public function requestExtraData( $pageSet ) {
global $wgDisableCounters;
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
public function run( $resultPageSet = null ) {
$params = $this->extractRequestParams();
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
private function run( $resultPageSet = null ) {
$params = $this->extractRequestParams();
}
/**
- * @param $randstr
- * @param $limit
- * @param $namespace
+ * @param $randstr
+ * @param $limit
+ * @param $namespace
* @param $resultPageSet ApiPageSet
- * @param $redirect
+ * @param $redirect
+ * @return void
*/
protected function prepareQuery( $randstr, $limit, $namespace, &$resultPageSet, $redirect ) {
$this->resetQueryParams();
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
public function run( $resultPageSet = null ) {
$params = $this->extractRequestParams();
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
private function run( $resultPageSet = null ) {
global $wgContLang;
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
private function run( $resultPageSet = null ) {
$this->selectNamedDB( 'watchlist', DB_SLAVE, 'watchlist' );
/**
* @param $resultPageSet ApiPageSet
+ * @return void
*/
private function run( $resultPageSet = null ) {
$this->selectNamedDB( 'watchlist', DB_SLAVE, 'watchlist' );
/**
* Clear the cache for this page
+ * @return void
*/
public function clearCache() {
wfSuppressWarnings();
/**
* Create parent directors of $this->cachePath()
+ * @return void
*/
protected function checkCacheDirs() {
wfMkdirParents( dirname( $this->cachePath() ), null, __METHOD__ );
/**
* Roughly increments the cache misses in the last hour by unique visitors
* @param $request WebRequest
+ * @return void
*/
public function incrMissesRecent( WebRequest $request ) {
global $wgMemc;
/**
* Read from cache to context output
* @param $context IContextSource
+ * @return void
*/
public function loadFromFileCache( IContextSource $context ) {
global $wgMimeType, $wgLanguageCode;
* XXX report broken Squids per mail or log
*
* @param $urlArr array
+ * @return void
*/
static function purge( $urlArr ) {
global $wgSquidServers, $wgHTCPMulticastAddress, $wgHTCPPort;
* Clone the table structure
*/
public function cloneTableStructure() {
-
+
foreach( $this->tablesToClone as $tbl ) {
# Clean up from previous aborted run. So that table escaping
# works correctly across DB engines, we need to change the pre-
# fix back and forth so tableName() works right.
-
+
self::changePrefix( $this->oldTablePrefix );
$oldTableName = $this->db->tableName( $tbl, 'raw' );
-
+
self::changePrefix( $this->newTablePrefix );
$newTableName = $this->db->tableName( $tbl, 'raw' );
-
+
if( $this->dropCurrentTables && !in_array( $this->db->getType(), array( 'postgres', 'oracle' ) ) ) {
$this->db->dropTable( $tbl, __METHOD__ );
wfDebug( __METHOD__." dropping {$newTableName}\n", true);
# Create new table
wfDebug( __METHOD__." duplicating $oldTableName to $newTableName\n", true );
$this->db->duplicateTableStructure( $oldTableName, $newTableName, $this->useTemporaryTables );
-
+
}
-
+
}
/**
/**
* Change the table prefix on all open DB connections/
*
- * @param $prefix
+ * @param $prefix
+ * @return void
*/
public static function changePrefix( $prefix ) {
global $wgDBprefix;
}
/**
- * @param $lb LoadBalancer
- * @param $prefix
+ * @param $lb LoadBalancer
+ * @param $prefix
+ * @return void
*/
public static function changeLBPrefix( $lb, $prefix ) {
$lb->forEachOpenConnection( array( 'CloneDatabase', 'changeDBPrefix' ), array( $prefix ) );
}
/**
- * @param $db DatabaseBase
- * @param $prefix
+ * @param $db DatabaseBase
+ * @param $prefix
+ * @return void
*/
public static function changeDBPrefix( $db, $prefix ) {
$db->tablePrefix( $prefix );
* Override database's default connection timeout
*
* @param $timeout Integer in seconds
+ * @return void
* @deprecated since 1.19; use setSessionOptions()
*/
public function setTimeout( $timeout ) {
* hours or days.
*
* @param $options Array
+ * @return void
*/
public function setSessionOptions( array $options ) {}
* directories, in case the user has not configured offline storage
*
* @param $dir string
+ * @return void
*/
protected function initDeletedDir( $dir ) {
$this->backend->secure( // prevent web access & dir listings
* Each file can be a (zone, rel) pair, virtual url, storage path, or FS path.
* It will try to delete each file, but ignores any errors that may occur.
*
- * @param $files array List of files to delete
+ * @param $pairs array List of files to delete
+ * @return void
*/
public function cleanupBatch( $files ) {
$operations = array();
* May use either the database or the filesystem.
*
* @param $callback Array|string
+ * @return void
*/
public function enumFiles( $callback ) {
$this->enumFilesInStorage( $callback );
* May use either the database or the filesystem.
*
* @param $callback Array|string
+ * @return void
*/
protected function enumFilesInStorage( $callback ) {
$publicRoot = $this->getZonePath( 'public' );
* Invalidates image redirect cache related to that image
*
* @param $title Title of page
+ * @return void
*/
function invalidateImageRedirect( Title $title ) {
global $wgMemc;
* If $paths is given, then only the cache for those files will be cleared.
*
* @param $paths Array Storage paths
+ * @return void
*/
abstract public function clearCache( array $paths = null );
/**
* Prune the cache if it is too big to add an item
+ *
+ * @return void
*/
protected function trimCache() {
if ( count( $this->cache ) >= $this->maxCacheSize ) {
/**
* Destroy the singleton instance
+ *
+ * @return void
*/
public static function destroySingleton() {
self::$instance = null;
/**
* Register file backends from the global variables
+ *
+ * @return void
*/
protected function initFromGlobals() {
global $wgLocalFileRepo, $wgForeignFileRepos, $wgFileBackends;
* Register an array of file backend configurations
*
* @param $configs Array
+ * @return void
* @throws MWException
*/
protected function register( array $configs ) {
/**
* Disable file backups for this operation
+ *
+ * @return void
*/
final protected function disableBackups() {
$this->useBackups = false;
* Allow stale data for file reads and existence checks.
* If this is called, then disableBackups() should also be called
* unless the affected files are known to have not changed recently.
+ *
+ * @return void
*/
final protected function allowStaleReads() {
$this->useLatest = false;
* Log a file operation failure and preserve any temp files
*
* @param $fileOp FileOp
+ * @return void
*/
final protected function logFailure( $action ) {
$params = $this->params;
*
* @param $lockDb string
* @param $db DatabaseBase
+ * @return void
* @throws DBError
*/
protected function initConnection( $lockDb, DatabaseBase $db ) {}
/**
* Register lock managers from the global variables
+ *
+ * @return void
*/
protected function initFromGlobals() {
global $wgLockManagers;
* Register an array of file lock manager configurations
*
* @param $configs Array
+ * @return void
* @throws MWException
*/
protected function register( array $configs ) {
}
/**
- * @param $from
+ * @param $from
+ * @return void
*/
function redirectedFrom( $from ) {
$this->redirected = $from;
* Clean up the temporary file only after an object goes out of scope
*
* @param $object Object
+ * @return void
*/
public function bind( $object ) {
if ( is_object( $object ) ) {
/**
* Set flag to not clean up after the temporary file
+ *
+ * @return void
*/
public function preserve() {
$this->canDelete = false;
/**
* @param $fh
* @param $bpp
+ * @return void
*/
static function readGCT( $fh, $bpp ) {
if ( $bpp > 0 ) {
/**
* @param $storagePath string The permanent storage path
+ * @return void
*/
public function setStoragePath( $storagePath ) {
$this->storagePath = $storagePath;
class CoreParserFunctions {
/**
* @param $parser Parser
+ * @return void
*/
static function register( $parser ) {
global $wgAllowDisplayTitle, $wgAllowSlowParserFunctions;
class CoreTagHooks {
/**
* @param $parser Parser
+ * @return void
*/
static function register( $parser ) {
global $wgRawHtml;
* @param $name string Title dbKey
* @param $timestamp string MW timestamp of file creation (or false if non-existing)
* @param $sha string base 36 SHA-1 of file (or false if non-existing)
+ * @return void
*/
function addImage( $name, $timestamp = null, $sha1 = null ) {
$this->mImages[$name] = 1;
* @param $title Title
* @param $page_id
* @param $rev_id
+ * @return void
*/
function addTemplate( $title, $page_id, $rev_id ) {
$ns = $title->getNamespace();
* @param $context ResourceLoaderContext
* @param $mtime string TS_MW timestamp to use for last-modified
* @param $private bool True iff response contains any private modules
+ * @return void
*/
protected function sendResponseHeaders( ResourceLoaderContext $context, $mtime, $private ) {
global $wgResourceLoaderMaxage;
* @param int $revisionCount
* @param $successCount
* @param $pageInfo
+ * @return void
*/
function reportPage( $title, $origTitle, $revisionCount, $successCount, $pageInfo ) {
global $wgContLang;
parent::__construct( 'MergeHistory', 'mergehistory' );
}
+ /**
+ * @return void
+ */
private function loadRequestParams() {
$request = $this->getRequest();
$this->mAction = $request->getVal( 'action' );
/**
* @param $db DatabaseBase
* @param $res
+ * @return void
*/
function preprocessResults( $db, $res ) {
# There's no point doing a batch check if we aren't caching results;
/**
* Clear the login attempt throttle hit count for the (username,current IP) tuple.
* @param $username string The user name
+ * @return void
*/
public static function clearLoginThrottle( $username ) {
global $wgMemc, $wgRequest;
}
/**
- * @param $dbw DatabaseBase
+ * @param $dbw DatabaseBase
+ * @return void
*/
private function insertData( $dbw ) {
$range = range( 0, 1024 );
}
/**
- * @param $dbw DatabaseBase
+ * @param $dbw DatabaseBase
+ * @return void
*/
private function delete( $dbw ) {
$dbw->delete( 'text', '*', __METHOD__ );
}
/**
- * @param $dbw DatabaseBase
+ * @param $dbw DatabaseBase
+ * @return void
*/
private function truncate( $dbw ) {
$test = $dbw->tableName( 'test' );
: 10;
}
+ /**
+ * @return void
+ */
protected function setupSocket() {
if ( !function_exists( 'socket_create' ) ) {
throw new Exception( "PHP sockets extension missing from PHP CLI mode." );
$this->startTime = time();
}
+ /**
+ * @return void
+ */
public function main() {
// Setup socket and start listing
$this->setupSocket();
/**
* Clear locks for sessions that have been dead for a while
+ *
+ * @return void
*/
protected function purgeExpiredLocks() {
$now = time();
/**
* @param $key string
* @param $session string
+ * @return void
*/
protected function set_sh_lock( $key, $session ) {
if ( !isset( $this->shLocks[$key][$session] ) ) {
/**
* @param $key string
* @param $session string
+ * @return void
*/
protected function set_ex_lock( $key, $session ) {
if ( !isset( $this->exLocks[$key][$session] ) ) {
/**
* @param $key string
* @param $session string
+ * @return void
*/
protected function unset_sh_lock( $key, $session ) {
if ( isset( $this->shLocks[$key][$session] ) ) {
/**
* @param $key string
* @param $session string
+ * @return void
*/
protected function unset_ex_lock( $key, $session ) {
if ( isset( $this->exLocks[$key] ) && $this->exLocks[$key] === $session ) {
/**
* Handle a thumbnail request via query parameters
+ *
+ * @return void
*/
function wfThumbHandleRequest() {
$params = get_magic_quotes_gpc()
/**
* Handle a thumbnail request via thumbnail file URL
+ *
+ * @return void
*/
function wfThumbHandle404() {
# lighttpd puts the original request in REQUEST_URI, while
* Stream a thumbnail specified by parameters
*
* @param $params Array
+ * @return void
*/
function wfStreamThumb( array $params ) {
wfProfileIn( __METHOD__ );
*
* @param $status integer
* @param $msg string
+ * @return void
*/
function wfThumbError( $status, $msg ) {
global $wgShowHostnames;