*
* ;:@$!*(),/~
*
- * However, IIS7 redirects fail when the url contains a colon (Bug 22709),
+ * However, IIS7 redirects fail when the url contains a colon (see T24709),
* so no fancy : for IIS7.
*
* %2F in the page titles seems to fatally break for some reason.
* This is the basic structure used (brackets contain keys for $urlParts):
* [scheme][delimiter][user]:[pass]@[host]:[port][path]?[query]#[fragment]
*
- * @todo Need to integrate this into wfExpandUrl (bug 32168)
+ * @todo Need to integrate this into wfExpandUrl (see T34168)
*
* @since 1.19
* @param array $urlParts URL parts, as output from wfParseUrl
* '/a/./b/../c/' becomes '/a/c/'. For details on the algorithm, please see
* RFC3986 section 5.2.4.
*
- * @todo Need to integrate this into wfExpandUrl (bug 32168)
+ * @todo Need to integrate this into wfExpandUrl (see T34168)
*
* @param string $urlPath URL path, potentially containing dot-segments
* @return string URL path with all dot-segments removed
return false;
}
- /* Provide an empty host for eg. file:/// urls (see bug 28627) */
+ /* Provide an empty host for eg. file:/// urls (see T30627) */
if ( !isset( $bits['host'] ) ) {
$bits['host'] = '';
- // bug 45069
+ // See T47069
if ( isset( $bits['path'] ) ) {
/* parse_url loses the third / for file:///c:/ urls (but not on variants) */
if ( substr( $bits['path'], 0, 1 ) !== '/' ) {
// Refs:
// * http://web.archive.org/web/20020708081031/http://mailman.lyra.org/pipermail/scite-interest/2002-March/000436.html
// * http://technet.microsoft.com/en-us/library/cc723564.aspx
- // * Bug #13518
+ // * T15518
// * CR r63214
// Double the backslashes before any double quotes. Escape the double quotes.
// @codingStandardsIgnoreEnd
* Convenience method, calls doUpdate() on every DataUpdate in the array.
*
* @param DataUpdate[] $updates A list of DataUpdate instances
- * @param string $mode Use "enqueue" to use the job queue when possible [Default: run]
* @throws Exception
* @deprecated Since 1.28 Use DeferredUpdates::execute()
*/
- public static function runUpdates( array $updates, $mode = 'run' ) {
- DeferredUpdates::execute( $updates, $mode, DeferredUpdates::ALL );
+ public static function runUpdates( array $updates ) {
+ foreach ( $updates as $update ) {
+ $update->doUpdate();
+ }
}
}
}
/**
+ * Immediately run/queue a list of updates
+ *
* @param DeferrableUpdate[] &$queue List of DeferrableUpdate objects
* @param string $mode Use "enqueue" to use the job queue when possible
* @param integer $stage Class constant (PRESEND, POSTSEND) (since 1.28)
* @throws ErrorPageError Happens on top-level calls
* @throws Exception Happens on second-level calls
*/
- public static function execute( array &$queue, $mode, $stage ) {
+ protected static function execute( array &$queue, $mode, $stage ) {
$services = MediaWikiServices::getInstance();
$stats = $services->getStatsdDataFactory();
$lbFactory = $services->getDBLoadBalancerFactory();
* @since 1.27
*/
class CategoryMembershipChangeJob extends Job {
+ /** @var integer|null */
+ private $ticket;
+
const ENQUEUE_FUDGE_SEC = 60;
public function __construct( Title $title, array $params ) {
}
public function run() {
+ $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+ $lb = $lbFactory->getMainLB();
+ $dbw = $lb->getConnection( DB_MASTER );
+
+ $this->ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ );
+
$page = WikiPage::newFromID( $this->params['pageId'], WikiPage::READ_LATEST );
if ( !$page ) {
$this->setLastError( "Could not find page #{$this->params['pageId']}" );
return false; // deleted?
}
- $lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
- $dbw = $lb->getConnection( DB_MASTER );
// Use a named lock so that jobs for this page see each others' changes
$lockKey = "CategoryMembershipUpdates:{$page->getId()}";
$scopedLock = $dbw->getScopedLockAndFlush( $lockKey, __METHOD__, 10 );
return false;
}
- $dbr = wfGetDB( DB_REPLICA, [ 'recentchanges' ] );
+ $dbr = $lb->getConnection( DB_REPLICA, [ 'recentchanges' ] );
// Wait till the replica DB is caught up so that jobs for this page see each others' changes
if ( !$lb->safeWaitForMasterPos( $dbr ) ) {
$this->setLastError( "Timed out while waiting for replica DB to catch up" );
);
// Apply all category updates in revision timestamp order
- $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
foreach ( $res as $row ) {
$this->notifyUpdatesForRevision( $lbFactory, $page, Revision::newFromRow( $row ) );
}
return; // nothing to do
}
- $ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ );
-
$catMembChange = new CategoryMembershipChange( $title, $newRev );
$catMembChange->checkTemplateLinks();
$categoryTitle = Title::makeTitle( NS_CATEGORY, $categoryName );
$catMembChange->triggerCategoryAddedNotification( $categoryTitle );
if ( $insertCount++ && ( $insertCount % $batchSize ) == 0 ) {
- $lbFactory->commitAndWaitForReplication( __METHOD__, $ticket );
+ $lbFactory->commitAndWaitForReplication( __METHOD__, $this->ticket );
}
}
$categoryTitle = Title::makeTitle( NS_CATEGORY, $categoryName );
$catMembChange->triggerCategoryRemovedNotification( $categoryTitle );
if ( $insertCount++ && ( $insertCount++ % $batchSize ) == 0 ) {
- $lbFactory->commitAndWaitForReplication( __METHOD__, $ticket );
+ $lbFactory->commitAndWaitForReplication( __METHOD__, $this->ticket );
}
}
}