id
int64
0
1.29M
original_id
stringlengths
32
32
swhid
stringlengths
100
170
sha1
stringlengths
40
40
repo_name
stringlengths
2
45
repo_group
stringclasses
12 values
filepath
stringlengths
5
153
name
stringlengths
1
14.9k
type
stringclasses
3 values
code
stringlengths
7
2.12M
16,800
455de5aa8fc7159e9aa33989eb4b7164
swh:1:cnt:6e8e01a41fc346487a84f9b6e507067fe8133bf5;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/Babel.git;lines=24-27/
0feb57b5f75c79c3bf30e9a897e64d30545913b7
Babel
deployed
tests/phpunit/integration/maintenance/MigrateConfigToCommunityTest.php
MigrateConfigToCommunityTest::testWithDefaultConfig()
function
public function testWithDefaultConfig() { $status = $this->maintenance->execute(); $this->assertTrue( $status, 'migrateConfigToCommunity.php failed' ); }
16,801
aed230dc50a555a0037c4e9ddc78621f
swh:1:cnt:612f5946e210e6345329e06966d23363894f8da2;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/Babel.git;lines=9-38/
aad468bc219b70103f5129f0e4d42ae42334f0e2
Babel
deployed
tests/phpunit/unit/ConfigWrapperTest.php
ConfigWrapperTest
type
/** * @covers \MediaWiki\Babel\Config\ConfigWrapper */ class ConfigWrapperTest extends MediaWikiUnitTestCase { public function testReturnsArray() { $configReaderMock = $this->createNoOpMock( MediaWikiConfigRouter::class, [ 'get' ] ); $configReaderMock->expects( $this->once() ) ->method( 'get' ) ->with( 'B...
16,802
37974d2bdd8691683b3b192f1afeb843
swh:1:cnt:612f5946e210e6345329e06966d23363894f8da2;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/Babel.git;lines=14-26/
aad468bc219b70103f5129f0e4d42ae42334f0e2
Babel
deployed
tests/phpunit/unit/ConfigWrapperTest.php
ConfigWrapperTest::testReturnsArray()
function
public function testReturnsArray() { $configReaderMock = $this->createNoOpMock( MediaWikiConfigRouter::class, [ 'get' ] ); $configReaderMock->expects( $this->once() ) ->method( 'get' ) ->with( 'BabelConfig' ) ->willReturn( (object)[ 'Number' => 42 ] ); $wrapper = new ConfigWrapper( $configReaderMock ); ...
16,803
1b4d9225c6391439ecc3d5bbf99c0d76
swh:1:cnt:612f5946e210e6345329e06966d23363894f8da2;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/Babel.git;lines=28-37/
aad468bc219b70103f5129f0e4d42ae42334f0e2
Babel
deployed
tests/phpunit/unit/ConfigWrapperTest.php
ConfigWrapperTest::testRelaysHas()
function
public function testRelaysHas() { $configReaderMock = $this->createNoOpMock( MediaWikiConfigRouter::class, [ 'has' ] ); $configReaderMock->expects( $this->once() ) ->method( 'has' ) ->with( 'BabelConfig' ) ->willReturn( false ); $wrapper = new ConfigWrapper( $configReaderMock ); $this->assertFalse( $w...
16,804
ea39eb8cc1d603086441299e74e07987
swh:1:cnt:486f0e0defb5ad77296501d96f462ebc2041e620;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/Babel.git;lines=16-55/
87b6418635fd1d5dc853225ba93f996c4cb55d40
Babel
deployed
tests/phpunit/unit/HooksTest.php
HooksTest
type
/** * @covers \MediaWiki\Babel\Hooks * * @group Babel * * @license GPL-2.0-or-later * @author Thiemo Kreuz */ class HooksTest extends MediaWikiUnitTestCase { private function newInstance() { return new Hooks( new HashConfig, $this->createMock( UserIdentityLookup::class ), $this->createMock( CentralI...
16,805
d5ac9e785105feaa82419aeb2ee07c74
swh:1:cnt:486f0e0defb5ad77296501d96f462ebc2041e620;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/Babel.git;lines=26-33/
87b6418635fd1d5dc853225ba93f996c4cb55d40
Babel
deployed
tests/phpunit/unit/HooksTest.php
HooksTest::newInstance()
function
private function newInstance() { return new Hooks( new HashConfig, $this->createMock( UserIdentityLookup::class ), $this->createMock( CentralIdLookupFactory::class ), $this->createMock( WANObjectCache::class ) ); }
16,806
e5fedf606bc13aea6aa240bc247229a5
swh:1:cnt:486f0e0defb5ad77296501d96f462ebc2041e620;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/Babel.git;lines=47-53/
87b6418635fd1d5dc853225ba93f996c4cb55d40
Babel
deployed
tests/phpunit/unit/HooksTest.php
HooksTest::testOnUserGetReservedNames()
function
public function testOnUserGetReservedNames(): void { $names = []; $this->assertSame( [], $names, 'Precondition' ); $this->newInstance()->onUserGetReservedNames( $names ); $this->assertSame( [ 'msg:' . BabelAutoCreate::MSG_USERNAME ], $names ); }
16,807
0ebb29bd98ce9011a0c1cd6629aad322
swh:1:cnt:486f0e0defb5ad77296501d96f462ebc2041e620;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/Babel.git;lines=35-45/
87b6418635fd1d5dc853225ba93f996c4cb55d40
Babel
deployed
tests/phpunit/unit/HooksTest.php
HooksTest::testOnParserFirstCallInit()
function
public function testOnParserFirstCallInit(): void { $parser = $this->getMockBuilder( Parser::class ) ->disableOriginalConstructor() ->getMock(); $parser->expects( $this->once() ) ->method( 'setFunctionHook' ) ->with( 'babel', [ Babel::class, 'render' ] ) ->willReturn( null ); $this->newInstance()-...
16,808
f9f23aee274764d9fbefe0257101cc58
swh:1:cnt:82580e4953cd9e20a1cbd1e63ec5fd2472d2a6ea;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=22-123/
4869bec0a5643a1ada9d53b6b016684e3efe82cb
BounceHandler
deployed
includes/ApiBounceHandler.php
ApiBounceHandler
type
class ApiBounceHandler extends ApiBase { public function __construct( ApiMain $mainModule, string $moduleName, private readonly JobQueueGroupFactory $jobQueueGroupFactory, ) { parent::__construct( $mainModule, $moduleName ); } /** @inheritDoc */ public function execute() { $requestIP = $this->getReques...
16,809
04c8096321683896c6dc48d2b66b334a
swh:1:cnt:82580e4953cd9e20a1cbd1e63ec5fd2472d2a6ea;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=24-30/
4869bec0a5643a1ada9d53b6b016684e3efe82cb
BounceHandler
deployed
includes/ApiBounceHandler.php
ApiBounceHandler::__construct( ApiMain $mainModule, string $moduleName, private readonly JobQueueGroupFactory $jobQueueGroupFactory, )
function
public function __construct( ApiMain $mainModule, string $moduleName, private readonly JobQueueGroupFactory $jobQueueGroupFactory, ) { parent::__construct( $mainModule, $moduleName ); }
16,810
dc56bd636308d31c37da8964b7e5ac66
swh:1:cnt:82580e4953cd9e20a1cbd1e63ec5fd2472d2a6ea;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=32-76/
4869bec0a5643a1ada9d53b6b016684e3efe82cb
BounceHandler
deployed
includes/ApiBounceHandler.php
ApiBounceHandler::execute()
function
/** @inheritDoc */ public function execute() { $requestIP = $this->getRequest()->getIP(); $inRangeIP = false; foreach ( $this->getConfig()->get( 'BounceHandlerInternalIPs' ) as $internalIP ) { if ( IPUtils::isInRange( $requestIP, $internalIP ) ) { $inRangeIP = true; break; } } if ( !$inRangeIP ...
16,811
52c21c8b6a4f307113b7cc9bc3b00e55
swh:1:cnt:82580e4953cd9e20a1cbd1e63ec5fd2472d2a6ea;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=92-95/
4869bec0a5643a1ada9d53b6b016684e3efe82cb
BounceHandler
deployed
includes/ApiBounceHandler.php
ApiBounceHandler::isWriteMode()
function
/** @inheritDoc */ public function isWriteMode() { return true; }
16,812
ee0d2626681c03db1cf34f763c96fbc0
swh:1:cnt:82580e4953cd9e20a1cbd1e63ec5fd2472d2a6ea;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=87-90/
4869bec0a5643a1ada9d53b6b016684e3efe82cb
BounceHandler
deployed
includes/ApiBounceHandler.php
ApiBounceHandler::mustBePosted()
function
/** @inheritDoc */ public function mustBePosted() { return true; }
16,813
bf33655cc74eb4492f8b9963edd7984d
swh:1:cnt:82580e4953cd9e20a1cbd1e63ec5fd2472d2a6ea;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=78-85/
4869bec0a5643a1ada9d53b6b016684e3efe82cb
BounceHandler
deployed
includes/ApiBounceHandler.php
ApiBounceHandler::isInternal()
function
/** * Mark the API as internal * * @return bool */ public function isInternal() { return true; }
16,814
0e28e86a91339586201ff43c8c4baf62
swh:1:cnt:82580e4953cd9e20a1cbd1e63ec5fd2472d2a6ea;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=97-105/
4869bec0a5643a1ada9d53b6b016684e3efe82cb
BounceHandler
deployed
includes/ApiBounceHandler.php
ApiBounceHandler::getAllowedParams()
function
/** @inheritDoc */ public function getAllowedParams() { return [ 'email' => [ ParamValidator::PARAM_TYPE => 'string', ParamValidator::PARAM_REQUIRED => true ] ]; }
16,815
82af6648b2eda97aaebacab2330cd7df
swh:1:cnt:82580e4953cd9e20a1cbd1e63ec5fd2472d2a6ea;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=107-116/
4869bec0a5643a1ada9d53b6b016684e3efe82cb
BounceHandler
deployed
includes/ApiBounceHandler.php
ApiBounceHandler::getExamplesMessages()
function
/** * @see ApiBase::getExamplesMessages() * @return array */ public function getExamplesMessages() { return [ 'action=bouncehandler&email=This%20is%20a%20test%20email' => 'apihelp-bouncehandler-example-1' ]; }
16,816
f2b3a7917ae50f3dddc12c0fc96dc0e6
swh:1:cnt:82580e4953cd9e20a1cbd1e63ec5fd2472d2a6ea;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=118-121/
4869bec0a5643a1ada9d53b6b016684e3efe82cb
BounceHandler
deployed
includes/ApiBounceHandler.php
ApiBounceHandler::getHelpUrls()
function
/** @inheritDoc */ public function getHelpUrls() { return "https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:BounceHandler#API"; }
16,817
38221e52b98a342a28da4b2842d68b69
swh:1:cnt:a1f729e59b250eb714042225d9adc8fc89ee277a;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=14-197/
be4082739245b09b511b11e724860f5ad9c26c52
BounceHandler
deployed
includes/BounceHandlerActions.php
BounceHandlerActions
type
/** * Actions to perform after we receive an email bounce * * @ingroup Extensions * @author Tony Thomas, Kunal Mehta, Jeff Green * @license GPL-2.0-or-later */ class BounceHandlerActions { protected string $wikiId; protected int $bounceRecordPeriod; protected int $bounceRecordLimit; protected bool $bounce...
16,818
2d30976b2ecd0960dcc5f7ca1b187be5
swh:1:cnt:a1f729e59b250eb714042225d9adc8fc89ee277a;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=33-54/
be4082739245b09b511b11e724860f5ad9c26c52
BounceHandler
deployed
includes/BounceHandlerActions.php
BounceHandlerActions::__construct( $wikiId, $bounceRecordPeriod, $bounceRecordLimit, $bounceHandlerUnconfirmUsers, $emailRaw )
function
/** * @param string $wikiId The database id of the failing recipient * @param int $bounceRecordPeriod Time period for which bounce activities are considered * before un-subscribing * @param int $bounceRecordLimit The number of bounces allowed in the bounceRecordPeriod. * @param bool $bounceHandlerUnconfirmUs...
16,819
7fa8d9243f20f7fbe0c0974c823f6007
swh:1:cnt:a1f729e59b250eb714042225d9adc8fc89ee277a;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=106-128/
be4082739245b09b511b11e724860f5ad9c26c52
BounceHandler
deployed
includes/BounceHandlerActions.php
BounceHandlerActions::notifyGlobalUser( $bounceUserId, $originalEmail )
function
/** * Function to inject Echo notification to the last source of bounce for an * unsubscribed Global user * * @param int $bounceUserId * @param string $originalEmail */ public function notifyGlobalUser( $bounceUserId, $originalEmail ) { $params = [ 'failed-user-id' => $bounceUserId, 'failed-email' ...
16,820
d06a67737ecce4646f01d56e2e3f40a0
swh:1:cnt:a1f729e59b250eb714042225d9adc8fc89ee277a;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=88-104/
be4082739245b09b511b11e724860f5ad9c26c52
BounceHandler
deployed
includes/BounceHandlerActions.php
BounceHandlerActions::createEchoNotification( $userId, $email )
function
/** * Function to trigger Echo notifications * * @param int $userId ID of user to be notified * @param string $email The unsubscribed email address used in notification */ public function createEchoNotification( $userId, $email ) { if ( ExtensionRegistry::getInstance()->isLoaded( 'Echo' ) ) { Event::cre...
16,821
372545b326f4b0f85acb142a8bba2a9b
swh:1:cnt:a1f729e59b250eb714042225d9adc8fc89ee277a;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=130-176/
be4082739245b09b511b11e724860f5ad9c26c52
BounceHandler
deployed
includes/BounceHandlerActions.php
BounceHandlerActions::unSubscribeUser( array $failedUser, $emailHeaders )
function
/** * Un-subscribe a failing recipient * * @param array $failedUser The details of the failing user * @param array $emailHeaders Email headers */ public function unSubscribeUser( array $failedUser, $emailHeaders ) { $originalEmail = $failedUser['rawEmail']; $bounceUserId = $failedUser['rawUserId']; $u...
16,822
e4bbfdc691070616dcd63396a1f1ea59
swh:1:cnt:a1f729e59b250eb714042225d9adc8fc89ee277a;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=56-86/
be4082739245b09b511b11e724860f5ad9c26c52
BounceHandler
deployed
includes/BounceHandlerActions.php
BounceHandlerActions::handleFailingRecipient( array $failedUser, $emailHeaders )
function
/** * Perform actions on users who failed to receive emails in a given period * * @param array $failedUser The details of the failing user * @param array $emailHeaders Email headers * @return bool */ public function handleFailingRecipient( array $failedUser, $emailHeaders ) { if ( $this->bounceHandlerUnc...
16,823
2c86c3349f57fca44c36f601ca103fb2
swh:1:cnt:a1f729e59b250eb714042225d9adc8fc89ee277a;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=178-195/
be4082739245b09b511b11e724860f5ad9c26c52
BounceHandler
deployed
includes/BounceHandlerActions.php
BounceHandlerActions::formatHeaders( $emailHeaders )
function
/** * Turns a keyed array into "Key: Value" newline split string * * @param array $emailHeaders * @return string */ private function formatHeaders( $emailHeaders ) { return implode( "\n", array_map( static function ( $v, $k ) { return "$k: $v"; }, $emailHeaders, array_keys( $emai...
16,824
6e95f76ee8f845e0210c395cab9ada74
swh:1:cnt:c6b98599db1c1827bcdd30bc9998f1b1cb1c18b1;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=8-34/
31e1633d97d9a8b5797dbfaa33fb26196816b678
BounceHandler
deployed
includes/BounceHandlerJob.php
BounceHandlerJob
type
/** * Class BounceHandlerJob * * Job Queue class to receive a POST request * * @ingroup JobQueue * @author Tony Thomas * @license GPL-2.0-or-later */ class BounceHandlerJob extends Job { /** @inheritDoc */ public function __construct( Title $title, array $params ) { parent::__construct( 'BounceHandlerJob', ...
16,825
b04ef1e07c8e320badc5360865fe831f
swh:1:cnt:c6b98599db1c1827bcdd30bc9998f1b1cb1c18b1;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=18-21/
31e1633d97d9a8b5797dbfaa33fb26196816b678
BounceHandler
deployed
includes/BounceHandlerJob.php
BounceHandlerJob::__construct( Title $title, array $params )
function
/** @inheritDoc */ public function __construct( Title $title, array $params ) { parent::__construct( 'BounceHandlerJob', $title, $params ); }
16,826
812e649e1ef1ef6cfb64b7ee8c1c0df0
swh:1:cnt:c6b98599db1c1827bcdd30bc9998f1b1cb1c18b1;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=23-33/
31e1633d97d9a8b5797dbfaa33fb26196816b678
BounceHandler
deployed
includes/BounceHandlerJob.php
BounceHandlerJob::run()
function
/** @inheritDoc */ public function run() { $email = $this->params['email']; if ( $email ) { $bounceProcessor = ProcessBounceEmails::getProcessor(); $bounceProcessor->handleBounce( $email ); } return true; }
16,827
01bcf8f5d973b360998f29668f9dd61f
swh:1:cnt:cc974049984d76e5fa11d3ca5b1539fe0f81cc26;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=8-46/
37f373f96062c11c867c60ea0ff3e86cad10a679
BounceHandler
deployed
includes/BounceHandlerNotificationJob.php
BounceHandlerNotificationJob
type
/** * Class BounceHandlerNotificationJob * * Class to notify a global user on a particular wiki on his E-mail address becoming un-subscribed * * @ingroup JobQueue * @author Tony Thomas * @license GPL-2.0-or-later */ class BounceHandlerNotificationJob extends Job { /** @inheritDoc */ public function __construc...
16,828
57c30cfa3cdd329ce94946c1fb7fafca
swh:1:cnt:cc974049984d76e5fa11d3ca5b1539fe0f81cc26;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=18-21/
37f373f96062c11c867c60ea0ff3e86cad10a679
BounceHandler
deployed
includes/BounceHandlerNotificationJob.php
BounceHandlerNotificationJob::__construct( Title $title, array $params )
function
/** @inheritDoc */ public function __construct( Title $title, array $params ) { parent::__construct( 'BounceHandlerNotificationJob', $title, $params ); }
16,829
fd3a405db9651850b7925c1cb52c4588
swh:1:cnt:cc974049984d76e5fa11d3ca5b1539fe0f81cc26;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=23-45/
37f373f96062c11c867c60ea0ff3e86cad10a679
BounceHandler
deployed
includes/BounceHandlerNotificationJob.php
BounceHandlerNotificationJob::run()
function
/** @inheritDoc */ public function run() { $failedUserId = $this->params['failed-user-id']; $failedUserEmailAddress = $this->params['failed-email']; $wikiId = $this->params['wikiId']; $bounceRecordPeriod = $this->params['bounceRecordPeriod']; $bounceRecordLimit = $this->params['bounceRecordLimit']; $bounce...
16,830
8170d52269c2f0c136fa295081f74482
swh:1:cnt:989af4c6246c72ebd16c9fb858730adbed35c86b;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=8-40/
5c4c624462af77b1ca2d401709a5871fbb3de3fb
BounceHandler
deployed
includes/EchoBounceHandlerPresentationModel.php
EchoBounceHandlerPresentationModel
type
class EchoBounceHandlerPresentationModel extends EchoEventPresentationModel { /** * @inheritDoc */ public function getIconType() { return 'placeholder'; } /** * @inheritDoc */ public function getPrimaryLink() { return [ 'url' => SpecialPage::getTitleFor( 'Confirmemail' )->getFullURL(), 'label' =...
16,831
82fd2bbbd09ad2eb45d27786a1c25630
swh:1:cnt:989af4c6246c72ebd16c9fb858730adbed35c86b;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=9-14/
5c4c624462af77b1ca2d401709a5871fbb3de3fb
BounceHandler
deployed
includes/EchoBounceHandlerPresentationModel.php
EchoBounceHandlerPresentationModel::getIconType()
function
/** * @inheritDoc */ public function getIconType() { return 'placeholder'; }
16,832
4167e7dce076616ef69bc9434bb5de4f
swh:1:cnt:989af4c6246c72ebd16c9fb858730adbed35c86b;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=26-39/
5c4c624462af77b1ca2d401709a5871fbb3de3fb
BounceHandler
deployed
includes/EchoBounceHandlerPresentationModel.php
EchoBounceHandlerPresentationModel::getHeaderMessage()
function
/** * @inheritDoc */ public function getHeaderMessage() { $msg = parent::getHeaderMessage(); // params 1 & 2 are automatically added by parent, but for this // notification they'll always be null & won't be used in any message; // below messages with be param 3 & 4 $msg->params( $this->event->getExtraPa...
16,833
749f619f1e767f8ce57caad10c5d4340
swh:1:cnt:989af4c6246c72ebd16c9fb858730adbed35c86b;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=16-24/
5c4c624462af77b1ca2d401709a5871fbb3de3fb
BounceHandler
deployed
includes/EchoBounceHandlerPresentationModel.php
EchoBounceHandlerPresentationModel::getPrimaryLink()
function
/** * @inheritDoc */ public function getPrimaryLink() { return [ 'url' => SpecialPage::getTitleFor( 'Confirmemail' )->getFullURL(), 'label' => $this->msg( 'notification-link-text-change-email' )->text(), ]; }
16,834
b4e45c799907c1105b533ca09e0193af
swh:1:cnt:fe22d29b2e47ec6bd5de7652f304d8181c852eb6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=8-56/
597e134f2011963ac54b38daff0d229e37c0f11e
BounceHandler
deployed
includes/EchoHooks.php
EchoHooks
type
/** * Hooks used by BounceHandler * * @ingroup Hooks * @author Tony Thomas, Kunal Mehta, Jeff Green * @license GPL-2.0-or-later */ class EchoHooks implements BeforeCreateEchoEventHook { /** * Add BounceHandler events to Echo * * @param array &$notifications Echo notifications * @param array &$notificati...
16,835
ae8f3aa6a4e106a39c8996a8e823c2dd
swh:1:cnt:fe22d29b2e47ec6bd5de7652f304d8181c852eb6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=17-54/
597e134f2011963ac54b38daff0d229e37c0f11e
BounceHandler
deployed
includes/EchoHooks.php
EchoHooks::onBeforeCreateEchoEvent( array &$notifications, array &$notificationCategories, array &$notificationIcons )
function
/** * Add BounceHandler events to Echo * * @param array &$notifications Echo notifications * @param array &$notificationCategories To expand $wgEchoNotificationCategories * @param array &$notificationIcons To expand $wgEchoNotificationIcons * @return bool */ public function onBeforeCreateEchoEvent( arr...
16,836
103412373aaed62f43b1a86a64c7dda7
swh:1:cnt:c33e520d971630676bdb43bac6d90fac7bb3520b;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=11-71/
3d76b1dfab7cf303e73a98c8184fddab3209cdeb
BounceHandler
deployed
includes/Hooks.php
Hooks
type
/** * Hooks used by BounceHandler * * @ingroup Hooks * @author Tony Thomas, Kunal Mehta, Jeff Green * @license GPL-2.0-or-later */ class Hooks implements UserMailerChangeReturnPathHook { public function __construct( private readonly Config $config, private readonly UserFactory $userFactory, ) { } /** ...
16,837
c75cb5b040061555a9429c4c470e903d
swh:1:cnt:c33e520d971630676bdb43bac6d90fac7bb3520b;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=21-25/
3d76b1dfab7cf303e73a98c8184fddab3209cdeb
BounceHandler
deployed
includes/Hooks.php
Hooks::__construct( private readonly Config $config, private readonly UserFactory $userFactory, )
function
public function __construct( private readonly Config $config, private readonly UserFactory $userFactory, ) { }
16,838
1015214d1b3ccf411e79d3b04d6227f1
swh:1:cnt:c33e520d971630676bdb43bac6d90fac7bb3520b;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=41-70/
3d76b1dfab7cf303e73a98c8184fddab3209cdeb
BounceHandler
deployed
includes/Hooks.php
Hooks::generateVerp( MailAddress $to, &$returnPath )
function
/** * Process a given $to address and return its VERP return path * * @param MailAddress $to * @param string &$returnPath return-path address * @return bool true */ protected function generateVerp( MailAddress $to, &$returnPath ) { $user = $this->userFactory->newFromName( $to->name ); if ( !$user ) { ...
16,839
5cc3517f48b48f6af49a525a393e0b09
swh:1:cnt:c33e520d971630676bdb43bac6d90fac7bb3520b;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=27-39/
3d76b1dfab7cf303e73a98c8184fddab3209cdeb
BounceHandler
deployed
includes/Hooks.php
Hooks::onUserMailerChangeReturnPath( $recip, &$returnPath )
function
/** * This function generates the VERP address on UserMailer::send() * Generating VERP address for a batch of send emails is complex. This feature is hence disabled * * @param MailAddress[] $recip Recipient's email array * @param string &$returnPath return-path address * @throws InvalidArgumentException *...
16,840
e5bedc32db45032dc9b8643a53ea0ebf
swh:1:cnt:b481e218d16ba450a7d9009f49df4071dba2c3b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=9-250/
9a6e60c4f1556a627a55190433cdd66fffc9aa51
BounceHandler
deployed
includes/ProcessBounceEmails.php
ProcessBounceEmails
type
/** * Class ProcessBounceEmails * * Methods to process a bounce email * * @ingroup Extensions * @author Tony Thomas, Kunal Mehta, Jeff Green * @license GPL-2.0-or-later */ abstract class ProcessBounceEmails { /** * Receive an email from the job queue and process it * * @param string $email */ abstract...
16,841
3e81796791cd6e99729e89fc23056e94
swh:1:cnt:b481e218d16ba450a7d9009f49df4071dba2c3b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=19-24/
9a6e60c4f1556a627a55190433cdd66fffc9aa51
BounceHandler
deployed
includes/ProcessBounceEmails.php
ProcessBounceEmails::handleBounce( $email )
function
/** * Receive an email from the job queue and process it * * @param string $email */ abstract public function handleBounce( $email );
16,842
3dd5a5bb1054ad389e6862168562ffe0
swh:1:cnt:b481e218d16ba450a7d9009f49df4071dba2c3b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=35-51/
9a6e60c4f1556a627a55190433cdd66fffc9aa51
BounceHandler
deployed
includes/ProcessBounceEmails.php
ProcessBounceEmails::processEmail( $emailHeaders, $emailRaw )
function
/** * Process bounce email * * @param array $emailHeaders * @param string $emailRaw * * @return bool */ public function processEmail( $emailHeaders, $emailRaw ) { // The bounceHandler needs to respond only to permanent failures. $isPermanentFailure = $this->checkPermanentFailure( $emailHeaders ); i...
16,843
b113c1354dabd110a10ebcb6f8698f28
swh:1:cnt:b481e218d16ba450a7d9009f49df4071dba2c3b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=117-168/
9a6e60c4f1556a627a55190433cdd66fffc9aa51
BounceHandler
deployed
includes/ProcessBounceEmails.php
ProcessBounceEmails::getUserDetails( $hashedEmail )
function
/** * Validate and extract user info from a given VERP address and * * Return the failed user details if the hashes match * @param string $hashedEmail The original hashed Email from bounce email * @return array $failedUser The failed user details */ public function getUserDetails( $hashedEmail ) { global...
16,844
23a9b668f7295236c10d49d71cb024eb
swh:1:cnt:b481e218d16ba450a7d9009f49df4071dba2c3b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=26-33/
9a6e60c4f1556a627a55190433cdd66fffc9aa51
BounceHandler
deployed
includes/ProcessBounceEmails.php
ProcessBounceEmails::getProcessor()
function
/** * Generates bounce email processor * * @return ProcessBounceWithRegex */ public static function getProcessor() { return new ProcessBounceWithRegex(); }
16,845
bf1bc19d904de6b93812eaf1655468de
swh:1:cnt:b481e218d16ba450a7d9009f49df4071dba2c3b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=53-115/
9a6e60c4f1556a627a55190433cdd66fffc9aa51
BounceHandler
deployed
includes/ProcessBounceEmails.php
ProcessBounceEmails::processBounceHeaders( $emailHeaders, $emailRaw )
function
/** * Process received bounce emails from Job Queue * * @param array $emailHeaders * @param string $emailRaw * * @return bool */ public function processBounceHeaders( $emailHeaders, $emailRaw ) { global $wgBounceRecordPeriod, $wgBounceRecordLimit, $wgBounceHandlerUnconfirmUsers, $wgBounceRecordMaxAg...
16,846
492712c0626400e4eb66888e3f744e89
swh:1:cnt:b481e218d16ba450a7d9009f49df4071dba2c3b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=170-198/
9a6e60c4f1556a627a55190433cdd66fffc9aa51
BounceHandler
deployed
includes/ProcessBounceEmails.php
ProcessBounceEmails::getOriginalEmail( $failedUser )
function
/** * Generate Original Email Id from a hashed emailId * * @param array $failedUser The failed user details * @return string|false $rawEmail The emailId of the failing recipient */ public function getOriginalEmail( $failedUser ) { // In multiple wiki deployed case, the $wikiId can help correctly // ident...
16,847
5b57a9677218bdc90a21f00b5d1d0ad6
swh:1:cnt:b481e218d16ba450a7d9009f49df4071dba2c3b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=200-224/
9a6e60c4f1556a627a55190433cdd66fffc9aa51
BounceHandler
deployed
includes/ProcessBounceEmails.php
ProcessBounceEmails::checkPermanentFailure( $emailHeaders )
function
/** * Check for a permanent failure * * @param array $emailHeaders * @return bool */ protected function checkPermanentFailure( $emailHeaders ) { if ( isset( $emailHeaders['status'] ) ) { $status = explode( '.', $emailHeaders['status'] ); // According to RFC1893, status codes starting with 5 mean Perm...
16,848
ba05ab43a8bf02f8cc3f1376d032e47e
swh:1:cnt:b481e218d16ba450a7d9009f49df4071dba2c3b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=226-239/
9a6e60c4f1556a627a55190433cdd66fffc9aa51
BounceHandler
deployed
includes/ProcessBounceEmails.php
ProcessBounceEmails::handleUnrecognizedBounces( $email, $to )
function
/** * Handle unrecognized bounces by notifying wiki admins with the full email * * @param string $email * @param string $to */ public function handleUnrecognizedBounces( $email, $to ) { global $wgUnrecognizedBounceNotify, $wgPasswordSender; wfDebugLog( 'BounceHandler', "Received temporary bounce from $t...
16,849
274516f12d0ae5a41d00baa63e55a6ed
swh:1:cnt:b481e218d16ba450a7d9009f49df4071dba2c3b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=241-244/
9a6e60c4f1556a627a55190433cdd66fffc9aa51
BounceHandler
deployed
includes/ProcessBounceEmails.php
ProcessBounceEmails::getBounceRecordPrimaryDB()
function
public static function getBounceRecordPrimaryDB(): IDatabase { return MediaWikiServices::getInstance()->getDBLoadBalancerFactory() ->getPrimaryDatabase( 'virtual-bouncehandler' ); }
16,850
04aafc6a0cb3b71f29ca28fa9b0e9afb
swh:1:cnt:b481e218d16ba450a7d9009f49df4071dba2c3b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=246-249/
9a6e60c4f1556a627a55190433cdd66fffc9aa51
BounceHandler
deployed
includes/ProcessBounceEmails.php
ProcessBounceEmails::getBounceRecordReplicaDB()
function
public static function getBounceRecordReplicaDB(): IReadableDatabase { return MediaWikiServices::getInstance()->getDBLoadBalancerFactory() ->getReplicaDatabase( 'virtual-bouncehandler' ); }
16,851
1513f83dc4529698d0c5ce3e11e2690b
swh:1:cnt:25d08c1f69d1d8910b130362ab6e332ccfd5580e;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=5-126/
505fa2d508deb36b14ab54dbbec7d30c55867f22
BounceHandler
deployed
includes/ProcessBounceWithRegex.php
ProcessBounceWithRegex
type
/** * Class ProcessBounceWithRegex * * Extract email headers of a bounce email using various regex functions * * @ingroup Extensions * @author Tony Thomas, Kunal Mehta, Jeff Green * @license GPL-2.0-or-later */ class ProcessBounceWithRegex extends ProcessBounceEmails { /** * Process email using common regex ...
16,852
8e280825f1053b20694998c6c34e1ed5
swh:1:cnt:25d08c1f69d1d8910b130362ab6e332ccfd5580e;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=15-28/
505fa2d508deb36b14ab54dbbec7d30c55867f22
BounceHandler
deployed
includes/ProcessBounceWithRegex.php
ProcessBounceWithRegex::handleBounce( $email )
function
/** * Process email using common regex functions * * @param string $email */ public function handleBounce( $email ) { $emailHeaders = $this->extractHeaders( $email ); $to = $emailHeaders['to']; $processEmail = $this->processEmail( $emailHeaders, $email ); if ( !$processEmail ) { $this->handleUnreco...
16,853
adefc4093c99371eb66168d41516c67b
swh:1:cnt:25d08c1f69d1d8910b130362ab6e332ccfd5580e;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=30-49/
505fa2d508deb36b14ab54dbbec7d30c55867f22
BounceHandler
deployed
includes/ProcessBounceWithRegex.php
ProcessBounceWithRegex::parseMessagePart( $partLines )
function
/** * Parse the single part of delivery status message * * @param string[] $partLines array of strings that contain single lines of the email part * @return string|null String that contains the status code or null if it wasn't found */ private function parseMessagePart( $partLines ) { foreach ( $partLines ...
16,854
cf661f945c37e43c7339b50875dfcd7f
swh:1:cnt:25d08c1f69d1d8910b130362ab6e332ccfd5580e;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=51-72/
505fa2d508deb36b14ab54dbbec7d30c55867f22
BounceHandler
deployed
includes/ProcessBounceWithRegex.php
ProcessBounceWithRegex::parseDeliveryStatusMessage( $emailLines )
function
/** * Parse the multi-part delivery status message (DSN) according to RFC3464 * * @param string[] $emailLines array of strings that contain single lines of the email * @return string|null String that contains the status code or null if it wasn't found */ private function parseDeliveryStatusMessage( $emailLin...
16,855
2662a31e0b705c6e56c220e5429d4dbf
swh:1:cnt:25d08c1f69d1d8910b130362ab6e332ccfd5580e;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=74-124/
505fa2d508deb36b14ab54dbbec7d30c55867f22
BounceHandler
deployed
includes/ProcessBounceWithRegex.php
ProcessBounceWithRegex::extractHeaders( $email )
function
/** * Extract headers from the received bounce * * @param string $email * @return array $emailHeaders */ public function extractHeaders( $email ) { $emailHeaders = []; $emailLines = preg_split( "/(\r?\n|\r)/", $email ); foreach ( $emailLines as $emailLine ) { if ( preg_match( "/^To: (.*)/", $emailLi...
16,856
f513aae9f025b93d6d2d7a30a7709446
swh:1:cnt:f376859e018ab448297560bcdd7e3a3b3600f98f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=8-56/
41d7120c3f6f3521a59fac0fe8b0d036a0a4c42b
BounceHandler
deployed
includes/ProcessUnRecognizedBounces.php
ProcessUnRecognizedBounces
type
/** * Class ProcessUnRecognizedBounces * * Process unrecognized bounce by notifying administrators * * @ingroup Extensions * @author Tony Thomas, Kunal Mehta, Jeff Green * @license GPL-2.0-or-later */ class ProcessUnRecognizedBounces { protected string $passwordSender; protected array $unrecognizedBounceNoti...
16,857
dd273cf7b48eed8b1ff091539bd5a516
swh:1:cnt:f376859e018ab448297560bcdd7e3a3b3600f98f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=22-30/
41d7120c3f6f3521a59fac0fe8b0d036a0a4c42b
BounceHandler
deployed
includes/ProcessUnRecognizedBounces.php
ProcessUnRecognizedBounces::__construct( array $unrecognizedBounceNotify, string $passwordSender )
function
/** * @param array $unrecognizedBounceNotify The array of admins to be notified * on a bounce parse failure * @param string $passwordSender The default email Return path address */ public function __construct( array $unrecognizedBounceNotify, string $passwordSender ) { $this->unrecognizedBounceNotify = $un...
16,858
88c69980690d83cbb1ccfbe6ba86c7c2
swh:1:cnt:f376859e018ab448297560bcdd7e3a3b3600f98f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=32-55/
41d7120c3f6f3521a59fac0fe8b0d036a0a4c42b
BounceHandler
deployed
includes/ProcessUnRecognizedBounces.php
ProcessUnRecognizedBounces::processUnRecognizedBounces( $email )
function
/** * Notify the system administrator about a temporary bounce which failed to get parsed * * @param string $email The received email bounce */ public function processUnRecognizedBounces( $email ) { if ( !$this->unrecognizedBounceNotify ) { return; } $subject = 'bouncehandler-notify_subject'; $sende...
16,859
99af29d222c4a928addfb90a063b7b95
swh:1:cnt:3b0cbc0e9f8642c3b7fefa97d6004045df8b9ec7;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=5-64/
3b9af3290ba39ad99840ff105da779b2b777604e
BounceHandler
deployed
includes/PruneOldBounceRecords.php
PruneOldBounceRecords
type
/** * Class PruneOldBounceRecords * * Prune old bounce records from the 'bounce_records' table * * @ingroup Extensions * @author Tony Thomas <01tonythomas@gmail.com> * @license GPL-2.0-or-later */ class PruneOldBounceRecords { private int $bounceRecordMaxAge; public function __construct( int $bounceRecordMa...
16,860
45faacaad191079c393435e01d231dae
swh:1:cnt:3b0cbc0e9f8642c3b7fefa97d6004045df8b9ec7;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=18-20/
3b9af3290ba39ad99840ff105da779b2b777604e
BounceHandler
deployed
includes/PruneOldBounceRecords.php
PruneOldBounceRecords::__construct( int $bounceRecordMaxAge )
function
public function __construct( int $bounceRecordMaxAge ) { $this->bounceRecordMaxAge = $bounceRecordMaxAge; }
16,861
4d81e72dbdaade3effd670d927f37c34
swh:1:cnt:3b0cbc0e9f8642c3b7fefa97d6004045df8b9ec7;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=22-39/
3b9af3290ba39ad99840ff105da779b2b777604e
BounceHandler
deployed
includes/PruneOldBounceRecords.php
PruneOldBounceRecords::pruneOldRecords()
function
/** * Prune old bounce records */ public function pruneOldRecords() { $idArray = $this->getOldRecords(); $idArrayCount = count( $idArray ); if ( $idArrayCount > 0 ) { $dbw = ProcessBounceEmails::getBounceRecordPrimaryDB(); $dbw->newDeleteQueryBuilder() ->deleteFrom( 'bounce_records' ) ->where( ...
16,862
e078fc0894ed6cd69502ca7e6cd5cc09
swh:1:cnt:3b0cbc0e9f8642c3b7fefa97d6004045df8b9ec7;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=41-62/
3b9af3290ba39ad99840ff105da779b2b777604e
BounceHandler
deployed
includes/PruneOldBounceRecords.php
PruneOldBounceRecords::getOldRecords()
function
/** * Get Old bounce records from DB * * @return int[] */ private function getOldRecords() { $idArray = []; $maximumRecordAge = time() - $this->bounceRecordMaxAge; $dbr = ProcessBounceEmails::getBounceRecordReplicaDB(); $res = $dbr->newSelectQueryBuilder() ->select( [ 'br_id' ] ) ->from( 'bounce_...
16,863
1562e99437e3e7f86f1dc364334343f9
swh:1:cnt:deb0a4d3f1613e5082074fca32e9e8a4355350cf;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=7-44/
866434fc3325081f6054c66331f164bab45c714b
BounceHandler
deployed
includes/SchemaHooks.php
SchemaHooks
type
/** * Schema Hooks used by BounceHandler * * @ingroup Hooks * @author Tony Thomas, Kunal Mehta, Jeff Green * @license GPL-2.0-or-later */ class SchemaHooks implements LoadExtensionSchemaUpdatesHook { /** * Add tables to the database * * @param DatabaseUpdater $updater */ public function onLoadExtensionS...
16,864
1e8d221299fc8aafc034474599e4f789
swh:1:cnt:deb0a4d3f1613e5082074fca32e9e8a4355350cf;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=15-43/
866434fc3325081f6054c66331f164bab45c714b
BounceHandler
deployed
includes/SchemaHooks.php
SchemaHooks::onLoadExtensionSchemaUpdates( $updater )
function
/** * Add tables to the database * * @param DatabaseUpdater $updater */ public function onLoadExtensionSchemaUpdates( $updater ) { $type = $updater->getDB()->getType(); $path = dirname( __DIR__ ) . '/sql'; $updater->addExtensionUpdateOnVirtualDomain( [ 'virtual-bouncehandler', 'addTable', 'boun...
16,865
02523abec07225a00118eca50eab7e93
swh:1:cnt:2762f9e63689cdcb56f2f9245f16221c0ae85abc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=7-67/
885d8547a3955f9047b624b5cb47c424a755e3e5
BounceHandler
deployed
includes/VerpAddressGenerator.php
VerpAddressGenerator
type
/** * Class VerpAddressGenerator * * Generates a VERP return path address of the form * wikiId-base36( $UserID )-base36( $Timestamp )-hash( $algorithm, $key, $prefix )@$email_domain * for every recipient address * * @ingroup Extensions * @author Tony Thomas, Kunal Mehta, Jeff Green * @license GPL-2.0-or-later ...
16,866
ec1baacb81ea62bc5c16dd2d5b7685ae
swh:1:cnt:2762f9e63689cdcb56f2f9245f16221c0ae85abc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=28-33/
885d8547a3955f9047b624b5cb47c424a755e3e5
BounceHandler
deployed
includes/VerpAddressGenerator.php
VerpAddressGenerator::__construct( string $prefix, string $algorithm, string $secretKey, string $domain )
function
public function __construct( string $prefix, string $algorithm, string $secretKey, string $domain ) { $this->prefix = $prefix; $this->algorithm = $algorithm; $this->secretKey = $secretKey; $this->domain = $domain; }
16,867
1bba468e8ccf3a1f427206e00dd9cbe2
swh:1:cnt:2762f9e63689cdcb56f2f9245f16221c0ae85abc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=35-66/
885d8547a3955f9047b624b5cb47c424a755e3e5
BounceHandler
deployed
includes/VerpAddressGenerator.php
VerpAddressGenerator::generateVERP( $uid )
function
/** * Generate VERP address * The generated hash is cut down to 12 ( 96 bits ) instead of the full 120 bits. * For attacks attempting to recover the hmac key, this makes the attackers job harder by giving * them less information to work from. * This makes brute force attacks easier. An attacker would be able ...
16,868
9ffa3f1750c90772ac9b35e8a22093c5
swh:1:cnt:d8007959fec228951ac743394fef50c5c47c31b3;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=33-78/
258fc787fc7c38d6af78e464387a57e07ecfccdb
BounceHandler
deployed
maintenance/invalidateEmail.php
InvalidateEmail
type
class InvalidateEmail extends Maintenance { public function __construct() { parent::__construct(); $this->requireExtension( 'BounceHandler' ); $this->addDescription( "Invalidate a user's email address and leave them a message." ); $this->addOption( 'userlist', 'List of usernames to invalidate, one per line'...
16,869
bdeed76149439ce9a957bfc93da89574
swh:1:cnt:d8007959fec228951ac743394fef50c5c47c31b3;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=34-41/
258fc787fc7c38d6af78e464387a57e07ecfccdb
BounceHandler
deployed
maintenance/invalidateEmail.php
InvalidateEmail::__construct()
function
public function __construct() { parent::__construct(); $this->requireExtension( 'BounceHandler' ); $this->addDescription( "Invalidate a user's email address and leave them a message." ); $this->addOption( 'userlist', 'List of usernames to invalidate, one per line', true, true ); $this->addOption( 'dry-run'...
16,870
781774ed8bdf8c413ab645266cd34840
swh:1:cnt:d8007959fec228951ac743394fef50c5c47c31b3;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=43-77/
258fc787fc7c38d6af78e464387a57e07ecfccdb
BounceHandler
deployed
maintenance/invalidateEmail.php
InvalidateEmail::execute()
function
public function execute() { $list = $this->getOption( 'userlist' ); if ( !is_file( $list ) ) { $this->output( "ERROR - File not found: {$list}" ); exit( 1 ); } $file = fopen( $list, 'r' ); if ( $file === false ) { $this->output( "ERROR - Could not open file: {$list}" ); exit( 1 ); } $bounce = ...
16,871
cdb296475378a25c3ee99df195fa008c
swh:1:cnt:9233c00d33f6e1f8d968b7f8ba799749d21e654e;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=7-116/
c59d507295151a201a4423ae61dfa0e6f1e0290c
BounceHandler
deployed
tests/phpunit/ApiBounceHandlerTest.php
ApiBounceHandlerTest
type
/** * Class ApiBounceHandlerTest * * Tests for API module * * @group API * @group medium * @group Database * @covers \MediaWiki\Extension\BounceHandler\ApiBounceHandler * @author Tony Thomas * @license GPL-2.0-or-later */ class ApiBounceHandlerTest extends ApiTestCase { public static function provideBounce...
16,872
5cfea5e998e3253a39ebc868f102867f
swh:1:cnt:9233c00d33f6e1f8d968b7f8ba799749d21e654e;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=21-26/
c59d507295151a201a4423ae61dfa0e6f1e0290c
BounceHandler
deployed
tests/phpunit/ApiBounceHandlerTest.php
ApiBounceHandlerTest::provideBounceEmails()
function
public static function provideBounceEmails() { $email = file_get_contents( __DIR__ . '/bounce_emails/email1' ); return [ [ $email ] ]; }
16,873
21a2dd24de971c62f65758f49dc2ed82
swh:1:cnt:9233c00d33f6e1f8d968b7f8ba799749d21e654e;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=100-114/
c59d507295151a201a4423ae61dfa0e6f1e0290c
BounceHandler
deployed
tests/phpunit/ApiBounceHandlerTest.php
ApiBounceHandlerTest::testBounceHandlerWithWrongParams( $email )
function
/** * Tests API with Wrong params * * @dataProvider provideBounceEmails */ public function testBounceHandlerWithWrongParams( $email ) { $this->expectException( ApiUsageException::class ); $this->expectExceptionMessage( 'The "email" parameter must be set.' ); $this->overrideConfigValue( 'BounceHandlerInt...
16,874
8478899b8c879b8bc08378cf173aaac2
swh:1:cnt:9233c00d33f6e1f8d968b7f8ba799749d21e654e;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=86-98/
c59d507295151a201a4423ae61dfa0e6f1e0290c
BounceHandler
deployed
tests/phpunit/ApiBounceHandlerTest.php
ApiBounceHandlerTest::testBounceHandlerWithNullParams()
function
/** * Tests API request with null 'email' param */ public function testBounceHandlerWithNullParams() { $this->expectException( ApiUsageException::class ); $this->expectExceptionMessage( 'The "email" parameter must be set.' ); $this->overrideConfigValue( 'BounceHandlerInternalIPs', [ '127.0.0.1' ] ); $this...
16,875
85f2112f33fff1e2f36ee61593cc140d
swh:1:cnt:9233c00d33f6e1f8d968b7f8ba799749d21e654e;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=28-68/
c59d507295151a201a4423ae61dfa0e6f1e0290c
BounceHandler
deployed
tests/phpunit/ApiBounceHandlerTest.php
ApiBounceHandlerTest::testBounceHandlerWithGoodIPPasses( $email )
function
/** * @dataProvider provideBounceEmails */ public function testBounceHandlerWithGoodIPPasses( $email ) { $user = $this->getServiceContainer()->getUserFactory()->newFromName( 'TestUser' ); $user->setEmail( 'bob@example.ext' ); $user->addToDatabase(); $uid = $user->getId(); $prefix = 'wiki'; $algorithm...
16,876
9d8b781ff8ed8a210bc7f4809df81f0c
swh:1:cnt:9233c00d33f6e1f8d968b7f8ba799749d21e654e;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=70-84/
c59d507295151a201a4423ae61dfa0e6f1e0290c
BounceHandler
deployed
tests/phpunit/ApiBounceHandlerTest.php
ApiBounceHandlerTest::testBounceHandlerWithBadIPPasses( $email )
function
/** * Tests API request from an unknown IP * * @dataProvider provideBounceEmails */ public function testBounceHandlerWithBadIPPasses( $email ) { $this->expectException( ApiUsageException::class ); $this->expectExceptionMessage( 'This API module is for internal use only.' ); $this->overrideConfigValue( '...
16,877
27deacaf0360d3029243fc5044781a01
swh:1:cnt:1dc8dc7a21df9a45d56cfcdde5fb99bb6b999d23;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=5-57/
e7e48623450b84b1f0b79ccf9cbb9744765fef0f
BounceHandler
deployed
tests/phpunit/ProcessBounceWithRegexTest.php
ProcessBounceWithRegexTest
type
/** * Class ProcessBounceWithRegexTest * * @covers \MediaWiki\Extension\BounceHandler\ProcessBounceWithRegex * @author Tony Thomas * @license GPL-2.0-or-later */ class ProcessBounceWithRegexTest extends MediaWikiIntegrationTestCase { public static function provideBounceStatusEmails() { $email1 = file_get_cont...
16,878
a4d111b37ef072254f84dab167d92bf7
swh:1:cnt:1dc8dc7a21df9a45d56cfcdde5fb99bb6b999d23;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=14-46/
e7e48623450b84b1f0b79ccf9cbb9744765fef0f
BounceHandler
deployed
tests/phpunit/ProcessBounceWithRegexTest.php
ProcessBounceWithRegexTest::provideBounceStatusEmails()
function
public static function provideBounceStatusEmails() { $email1 = file_get_contents( __DIR__ . '/bounce_emails/emailStatus1' ); $email2 = file_get_contents( __DIR__ . '/bounce_emails/emailStatus2' ); $email3 = file_get_contents( __DIR__ . '/bounce_emails/emailStatus3' ); $email4 = file_get_contents( __DIR__ . '/bo...
16,879
36c1ad5c95ae8e09be289811720b1f63
swh:1:cnt:1dc8dc7a21df9a45d56cfcdde5fb99bb6b999d23;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=48-55/
e7e48623450b84b1f0b79ccf9cbb9744765fef0f
BounceHandler
deployed
tests/phpunit/ProcessBounceWithRegexTest.php
ProcessBounceWithRegexTest::testExtractHeadersWithStatus( $emailStatus, $expected )
function
/** * @dataProvider provideBounceStatusEmails */ public function testExtractHeadersWithStatus( $emailStatus, $expected ) { $regexClass = new ProcessBounceWithRegex; $regexResult = $regexClass->extractHeaders( $emailStatus ); $this->assertArrayEquals( $expected, $regexResult ); }
16,880
11c563e858834268b1f79930992463f0
swh:1:cnt:3c7a8d73086425e894ddf73d3a05d4d6187ff7e0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=8-159/
3ee9a27033c92d7b8314b5b07a7a1693f0a8c727
BounceHandler
deployed
tests/phpunit/PruneOldBounceRecordsTest.php
PruneOldBounceRecordsTest
type
/** * Class PruneOldBounceRecordsTest * * @group Database * @group medium * @covers \MediaWiki\Extension\BounceHandler\PruneOldBounceRecords * @author Tony Thomas * @license GPL-2.0-or-later */ class PruneOldBounceRecordsTest extends MediaWikiIntegrationTestCase { /** @var string */ protected $wikiId; /** @...
16,881
0a69ad3d7259662696e260ce13c3b224
swh:1:cnt:3c7a8d73086425e894ddf73d3a05d4d6187ff7e0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=26-58/
3ee9a27033c92d7b8314b5b07a7a1693f0a8c727
BounceHandler
deployed
tests/phpunit/PruneOldBounceRecordsTest.php
PruneOldBounceRecordsTest::setUp()
function
protected function setUp(): void { parent::setUp(); $user = $this->getServiceContainer()->getUserFactory()->newFromName( 'OldUser' ); $user->setEmail( 'oldbob@example.ext' ); $user->addToDatabase(); $user->confirmEmail(); $user->saveSettings(); $bounceRecordPeriod = 604800; $bounceRecordLimit = 4; ...
16,882
871c52bf6fb198a8e0d6daddd1fbfd1b
swh:1:cnt:3c7a8d73086425e894ddf73d3a05d4d6187ff7e0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=60-84/
3ee9a27033c92d7b8314b5b07a7a1693f0a8c727
BounceHandler
deployed
tests/phpunit/PruneOldBounceRecordsTest.php
PruneOldBounceRecordsTest::testPruneDeleteOldSingleRow()
function
public function testPruneDeleteOldSingleRow() { $icp = $this->getServiceContainer()->getConnectionProvider(); $dbw = $icp->getPrimaryDatabase(); $dbr = $icp->getReplicaDatabase(); // Delete all old rows $bounceRecordMaxAge = -1; $pruneOldRecordsTester = new PruneOldBounceRecords( $bounceRecordMaxAge ); $p...
16,883
a7ac8298dd18c8e0c9d5cbc5af8240f4
swh:1:cnt:3c7a8d73086425e894ddf73d3a05d4d6187ff7e0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=124-141/
3ee9a27033c92d7b8314b5b07a7a1693f0a8c727
BounceHandler
deployed
tests/phpunit/PruneOldBounceRecordsTest.php
PruneOldBounceRecordsTest::insertDelayedBounce( $delayTime, $dbw )
function
/** * @param int $delayTime * @param IDatabase $dbw */ protected function insertDelayedBounce( $delayTime, $dbw ) { $bounceTimestamp = wfTimestamp( TS_MW, time() - $delayTime ); $rowData = [ 'br_user_email' => $this->originalEmail, 'br_timestamp' => $dbw->timestamp( $bounceTimestamp ), 'br_reason' =...
16,884
86cc913067ef8641118ddfa01b205df2
swh:1:cnt:3c7a8d73086425e894ddf73d3a05d4d6187ff7e0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=143-157/
3ee9a27033c92d7b8314b5b07a7a1693f0a8c727
BounceHandler
deployed
tests/phpunit/PruneOldBounceRecordsTest.php
PruneOldBounceRecordsTest::getOldRecordsCount( $bounceRecordMaxAge, $dbr )
function
/** * @param int $bounceRecordMaxAge * @param IDatabase|IReadableDatabase $dbr * * @return int */ protected function getOldRecordsCount( $bounceRecordMaxAge, $dbr ) { $maximumRecordAge = time() - $bounceRecordMaxAge; return $dbr->newSelectQueryBuilder() ->select( '*' ) ->from( 'bounce_records' ) ...
16,885
fa3950c87707271ae5293df9fd5bb07b
swh:1:cnt:3c7a8d73086425e894ddf73d3a05d4d6187ff7e0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=86-122/
3ee9a27033c92d7b8314b5b07a7a1693f0a8c727
BounceHandler
deployed
tests/phpunit/PruneOldBounceRecordsTest.php
PruneOldBounceRecordsTest::testMultipleOldRows()
function
public function testMultipleOldRows() { $icp = $this->getServiceContainer()->getConnectionProvider(); $dbw = $icp->getPrimaryDatabase(); $dbr = $icp->getReplicaDatabase(); $bounceRecordMaxAge = -1; $pruneOldRecordsTester = new PruneOldBounceRecords( $bounceRecordMaxAge ); $pruneOldRecordsTester->pruneOldRec...
16,886
1147432a4908062098e5ff56cc6f5ad4
swh:1:cnt:6bf1a2875cf3089981ef688cc66fa51b2954c482;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=7-66/
dbfe4e512e55725e17c5b4f87985fd8d4bb2c959
BounceHandler
deployed
tests/phpunit/UnSubscribeUserTest.php
UnSubscribeUserTest
type
/** * Class UnSubscribeUserTest * * @group Database * @covers \MediaWiki\Extension\BounceHandler\BounceHandlerActions * @author Tony Thomas * @license GPL-2.0-or-later */ class UnSubscribeUserTest extends MediaWikiIntegrationTestCase { public function testUnSubscribeUser() { $user = $this->getServiceContaine...
16,887
6898cb576298ddd117dc568a7a8ea501
swh:1:cnt:6bf1a2875cf3089981ef688cc66fa51b2954c482;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=17-64/
dbfe4e512e55725e17c5b4f87985fd8d4bb2c959
BounceHandler
deployed
tests/phpunit/UnSubscribeUserTest.php
UnSubscribeUserTest::testUnSubscribeUser()
function
public function testUnSubscribeUser() { $user = $this->getServiceContainer()->getUserFactory()->newFromName( 'TestUser' ); $user->setEmail( 'bob@example.ext' ); $user->addToDatabase(); $user->confirmEmail(); $user->saveSettings(); $this->assertTrue( $user->isEmailConfirmed() ); $uid = $user->getId(); ...
16,888
0ffcb4b739670498e64a99b17603481c
swh:1:cnt:6b272bd13dac730ea0170ca9e66a5368ff75e816;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=6-51/
efccefae6b9b8beb47fe93477b4281276660663a
BounceHandler
deployed
tests/phpunit/VERPEncodeDecodeTest.php
VERPEncodeDecodeTest
type
/** * Class VERPEncodeDecodeTest * * @group Database * @covers \MediaWiki\Extension\BounceHandler\VerpAddressGenerator * @author Tony Thomas * @license GPL-2.0-or-later */ class VERPEncodeDecodeTest extends MediaWikiIntegrationTestCase { /** * Tests that the extension encodes and decodes the email address co...
16,889
385b74786f739b73a4af4cd34b222f44
swh:1:cnt:6b272bd13dac730ea0170ca9e66a5368ff75e816;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler.git;lines=16-49/
efccefae6b9b8beb47fe93477b4281276660663a
BounceHandler
deployed
tests/phpunit/VERPEncodeDecodeTest.php
VERPEncodeDecodeTest::testVERPEncodingDecoding()
function
/** * Tests that the extension encodes and decodes the email address correctly */ public function testVERPEncodingDecoding() { $user = $this->getServiceContainer()->getUserFactory()->newFromName( 'TestUser' ); $user->setEmail( 'bob@example.ext' ); $user->addToDatabase(); $uid = $user->getId(); $prefix ...
16,890
f74f320b5570ec59268ebb6b5461d92f
swh:1:cnt:a3a1558ee76b428a4464dbdecfc6cca19d23aed6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/AdvancedSearch.git;lines=28-211/
cad1eb109937a19efea44ba34bb3e3200e02ba10
AdvancedSearch
deployed
includes/Hooks.php
Hooks
type
/** * @license GPL-2.0-or-later */ class Hooks implements SpecialPageBeforeExecuteHook, GetPreferencesHook, SpecialSearchResultsPrependHook { public function __construct( private readonly UserOptionsLookup $userOptionsLookup, private readonly LanguageNameUtils $languageNameUtils, private readonly SearchEng...
16,891
51674f4a5bcf24294a36faee35408bd1
swh:1:cnt:a3a1558ee76b428a4464dbdecfc6cca19d23aed6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/AdvancedSearch.git;lines=37-44/
cad1eb109937a19efea44ba34bb3e3200e02ba10
AdvancedSearch
deployed
includes/Hooks.php
Hooks::__construct( private readonly UserOptionsLookup $userOptionsLookup, private readonly LanguageNameUtils $languageNameUtils, private readonly SearchEngineConfig $searchEngineConfig, private readonly SearchEngineFactory $searchEngineFactory, private readonly MimeAnalyzer $mimeAnalyzer, )
function
public function __construct( private readonly UserOptionsLookup $userOptionsLookup, private readonly LanguageNameUtils $languageNameUtils, private readonly SearchEngineConfig $searchEngineConfig, private readonly SearchEngineFactory $searchEngineFactory, private readonly MimeAnalyzer $mimeAnalyzer, ) { }
16,892
8f0cf7336885bdbac1c3c9e48c9f07f8
swh:1:cnt:a3a1558ee76b428a4464dbdecfc6cca19d23aed6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/AdvancedSearch.git;lines=46-87/
cad1eb109937a19efea44ba34bb3e3200e02ba10
AdvancedSearch
deployed
includes/Hooks.php
Hooks::onSpecialPageBeforeExecute( $special, $subpage )
function
/** * @see https://www.mediawiki.org/wiki/Manual:Hooks/SpecialPageBeforeExecute * * @param SpecialPage $special * @param string|null $subpage * @return false|void false to abort the execution of the special page, "void" otherwise */ public function onSpecialPageBeforeExecute( $special, $subpage ) { if ( ...
16,893
363021571b2df249c8f9416f09970e81
swh:1:cnt:a3a1558ee76b428a4464dbdecfc6cca19d23aed6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/AdvancedSearch.git;lines=163-180/
cad1eb109937a19efea44ba34bb3e3200e02ba10
AdvancedSearch
deployed
includes/Hooks.php
Hooks::isNamespacedSearch( WebRequest $request )
function
/** * Checks if there is a search request, and it already specifies namespaces. * * @param WebRequest $request * @return bool */ private static function isNamespacedSearch( WebRequest $request ): bool { if ( ( $request->getRawVal( 'search' ) ?? '' ) === '' ) { return true; } foreach ( $request->get...
16,894
7e0e80a779c19c15eb19187992b6394a
swh:1:cnt:a3a1558ee76b428a4464dbdecfc6cca19d23aed6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/AdvancedSearch.git;lines=153-161/
cad1eb109937a19efea44ba34bb3e3200e02ba10
AdvancedSearch
deployed
includes/Hooks.php
Hooks::getDefaultNamespaces( UserIdentity $user )
function
/** * Retrieves the default namespaces for the current user * * @param UserIdentity $user The user to lookup default namespaces for * @return int[] List of namespaces to be searched by default */ private function getDefaultNamespaces( UserIdentity $user ): array { return $this->searchEngineConfig->userName...
16,895
ed492434fae3d7b92b95f8ea574306e6
swh:1:cnt:a3a1558ee76b428a4464dbdecfc6cca19d23aed6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/AdvancedSearch.git;lines=89-151/
cad1eb109937a19efea44ba34bb3e3200e02ba10
AdvancedSearch
deployed
includes/Hooks.php
Hooks::getJsConfigVars( WebRequest $request, User $user, MessageLocalizer $context, Language $userLang, Config $config, array $defaultNamespaces, ExtensionRegistry $extensionRegistry )
function
/** * @param WebRequest $request * @param User $user * @param MessageLocalizer $context * @param Language $userLang * @param Config $config * @param int[] $defaultNamespaces * @param ExtensionRegistry $extensionRegistry * @return array<string,mixed> */ private function getJsConfigVars( WebRequest $...
16,896
edbba63e45744f809e48ea6234b788c9
swh:1:cnt:a3a1558ee76b428a4464dbdecfc6cca19d23aed6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/AdvancedSearch.git;lines=182-197/
cad1eb109937a19efea44ba34bb3e3200e02ba10
AdvancedSearch
deployed
includes/Hooks.php
Hooks::onSpecialSearchResultsPrepend( $specialSearch, $output, $term )
function
/** * @see https://www.mediawiki.org/wiki/Manual:Hooks/SpecialSearchResultsPrepend * * @param SpecialSearch $specialSearch * @param OutputPage $output * @param string $term */ public function onSpecialSearchResultsPrepend( $specialSearch, $output, $term ) { $output->addHTML( Html::rawElement( 'div...
16,897
5e7696990f051fcd05954b3030405e46
swh:1:cnt:a3a1558ee76b428a4464dbdecfc6cca19d23aed6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/AdvancedSearch.git;lines=199-210/
cad1eb109937a19efea44ba34bb3e3200e02ba10
AdvancedSearch
deployed
includes/Hooks.php
Hooks::onGetPreferences( $user, &$preferences )
function
/** * @param User $user * @param array[] &$preferences */ public function onGetPreferences( $user, &$preferences ) { $preferences['advancedsearch-disable'] = [ 'type' => 'toggle', 'label-message' => 'advancedsearch-preference-disable', 'section' => 'searchoptions/advancedsearch', 'help-message' => ...
16,898
b9a9ea35d0c808a0e2943238a8c2b88c
swh:1:cnt:6b07cdee9687da21489747a5777108f5d2c84e4e;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/AdvancedSearch.git;lines=7-33/
9d3d0f578d18c0c4dcea9562813a6947888a4589
AdvancedSearch
deployed
includes/MimeTypeConfigurator.php
MimeTypeConfigurator
type
/** * @license GPL-2.0-or-later */ class MimeTypeConfigurator { public function __construct( private readonly MimeAnalyzer $mimeAnalyzer ) { } /** * @param string[] $fileExtensions * * @return string[] List of file extension => MIME type. */ public function getMimeTypes( array $fileExtensions ): array {...
16,899
4bc87a2d8dcbc4eb57b1e48435bfa4b0
swh:1:cnt:6b07cdee9687da21489747a5777108f5d2c84e4e;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/AdvancedSearch.git;lines=12-13/
9d3d0f578d18c0c4dcea9562813a6947888a4589
AdvancedSearch
deployed
includes/MimeTypeConfigurator.php
MimeTypeConfigurator::__construct( private readonly MimeAnalyzer $mimeAnalyzer )
function
public function __construct( private readonly MimeAnalyzer $mimeAnalyzer ) { }