jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/340924 )
Change subject: Remove deprecated key-value interfaces ...................................................................... Remove deprecated key-value interfaces Updates SmashPig and PHP-Queue libraries Bug: T159175 Change-Id: I34e782f5dd833de407642c39df2d1ca90a933abf --- M composer.json M composer.lock M gateway_common/DonationQueue.php M tests/phpunit/DonationQueueTest.php M tests/phpunit/includes/TestingQueue.php 5 files changed, 22 insertions(+), 90 deletions(-) Approvals: XenoRyet: Looks good to me, approved jenkins-bot: Verified diff --git a/composer.json b/composer.json index d62654a..21e4495 100644 --- a/composer.json +++ b/composer.json @@ -39,10 +39,6 @@ }, "repositories": [ { - "type": "vcs", - "url": "https://gerrit.wikimedia.org/r/p/wikimedia/fundraising/php-queue.git" - }, - { "type": "git", "url": "https://github.com/ejegg/login-and-pay-with-amazon-sdk-php" } diff --git a/composer.lock b/composer.lock index 705f7fa..563fb2e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "4ed6aa117f3e06e6da4a259e398fd6f8", - "content-hash": "0b276b857fa6d06ce5b977f9dfa9431d", + "hash": "286013b033c04aeb560c6d29c9d2462d", + "content-hash": "c77aa55a881981c2f2170a5894371bc0", "packages": [ { "name": "addshore/psr-6-mediawiki-bagostuff-adapter", @@ -137,8 +137,14 @@ "version": "dev-master", "source": { "type": "git", - "url": "https://gerrit.wikimedia.org/r/p/wikimedia/fundraising/php-queue.git", - "reference": "d56c5bd69dad595f2e00a3e10c851736b1feb57b" + "url": "https://github.com/CoderKungfu/php-queue.git", + "reference": "dd8412f105632d31cdd77933ec40a08640752c99" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CoderKungfu/php-queue/zipball/dd8412f105632d31cdd77933ec40a08640752c99", + "reference": "dd8412f105632d31cdd77933ec40a08640752c99", + "shasum": "" }, "require": { "clio/clio": "0.1.*", @@ -146,15 +152,19 @@ "php": ">=5.3.0" }, "require-dev": { - "jakub-onderka/php-parallel-lint": "0.9", - "phpunit/phpunit": "4.4.*" + "amazonwebservices/aws-sdk-for-php": "dev-master", + "aws/aws-sdk-php": "dev-master", + "ext-memcache": "*", + "iron-io/iron_mq": "dev-master", + "microsoft/windowsazure": "dev-master", + "mrpoundsign/pheanstalk-5.3": "dev-master", + "predis/predis": "1.*" }, "suggest": { "Respect/Rest": "For a REST server to post job data", "amazonwebservices/aws-sdk-for-php": "For AWS SQS backend support (legacy version)", "aws/aws-sdk-php": "For AWS SQS backend support", "clio/clio": "Support for daemonizing PHP CLI runner", - "ext-memcache": "*", "fusesource/stomp-php": "For the STOMP backend", "iron-io/iron_mq": "For IronMQ backend support", "microsoft/windowsazure": "For Windows Azure Service Bus backend support", @@ -173,12 +183,7 @@ "PHPQueue": "src/" } }, - "scripts": { - "test": [ - "parallel-lint . --exclude vendor", - "phpunit" - ] - }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -194,7 +199,7 @@ "queue", "transaction" ], - "time": "2017-01-04 21:01:15" + "time": "2017-04-17 14:11:55" }, { "name": "ircmaxell/password-compat", @@ -936,7 +941,7 @@ "source": { "type": "git", "url": "https://gerrit.wikimedia.org/r/wikimedia/fundraising/SmashPig.git", - "reference": "ec6ea516530400dfb7bb02a72ef52318a40b7bb6" + "reference": "78a7f28dee35cb4f5df285f53c7b643eecec7d33" }, "require": { "amzn/login-and-pay-with-amazon-sdk-php": "dev-master", @@ -987,7 +992,7 @@ "donations", "payments" ], - "time": "2017-04-10 22:28:50" + "time": "2017-04-19 21:15:22" }, { "name": "zordius/lightncandy", diff --git a/gateway_common/DonationQueue.php b/gateway_common/DonationQueue.php index 8e31e70..7abb5cb 100644 --- a/gateway_common/DonationQueue.php +++ b/gateway_common/DonationQueue.php @@ -76,32 +76,6 @@ return $backend->peek(); } - public function set( $correlationId, $transaction, $queue ) { - if ( !GatewayAdapter::getGlobal( 'EnableQueue' ) ) { - return; - } - $properties = $this->buildHeaders( $transaction ); - $message = $this->buildBody( $transaction ); - $this->newBackend( $queue )->set( $correlationId, $message, $properties ); - - // FIXME: hack for new queue, remove - $this->mirror( $message, $queue ); - } - - public function get( $correlationId, $queue ) { - if ( !GatewayAdapter::getGlobal( 'EnableQueue' ) ) { - return null; - } - return $this->newBackend( $queue )->get( $correlationId ); - } - - public function delete( $correlationId, $queue ) { - if ( !GatewayAdapter::getGlobal( 'EnableQueue' ) ) { - return; - } - $this->newBackend( $queue )->clear( $correlationId ); - } - /** * Temporary measure to transition from key/value ActiveMQ to pure FIFO * queues. Reads $wgDonationInterfaceQueueMirrors, where keys are original diff --git a/tests/phpunit/DonationQueueTest.php b/tests/phpunit/DonationQueueTest.php index 0699544..e27fa1c 100644 --- a/tests/phpunit/DonationQueueTest.php +++ b/tests/phpunit/DonationQueueTest.php @@ -118,28 +118,4 @@ $this->assertEquals( $this->expected_message, DonationQueue::instance()->pop( $this->queue_name ) ); } - - public function testSetMessage() { - DonationQueue::instance()->set( $this->transaction['correlation-id'], - $this->transaction, $this->queue_name ); - - $this->assertEquals( $this->expected_message, - DonationQueue::instance()->get( - $this->transaction['correlation-id'], $this->queue_name ) ); - } - - public function testDeleteMessage() { - DonationQueue::instance()->set( $this->transaction['correlation-id'], - $this->transaction, $this->queue_name ); - $this->assertEquals( $this->expected_message, - DonationQueue::instance()->get( - $this->transaction['correlation-id'], $this->queue_name ) ); - - DonationQueue::instance()->delete( - $this->transaction['correlation-id'], $this->queue_name ); - - $this->assertNull( - DonationQueue::instance()->get( - $this->transaction['correlation-id'], $this->queue_name ) ); - } } diff --git a/tests/phpunit/includes/TestingQueue.php b/tests/phpunit/includes/TestingQueue.php index 16f64ee..0c65781 100644 --- a/tests/phpunit/includes/TestingQueue.php +++ b/tests/phpunit/includes/TestingQueue.php @@ -20,8 +20,6 @@ FIXME: We can't reference the actual classes until vendor/ is provisioned for tests. use PHPQueue\Backend\Base; -use PHPQueue\Interfaces\KeyValueStore; -use PHPQueue\Interfaces\IndexedFifoQueueStore; */ /** @@ -29,7 +27,7 @@ * and multiple queues, but (obviously) data is destroyed on application * shutdown. */ -class TestingQueue /* extends Base implements IndexedFifoQueueStore, KeyValueStore */ { +class TestingQueue /* extends Base implements FifoQueueStore */ { protected $queue_name; protected $queue; @@ -63,22 +61,5 @@ return null; } return json_decode( array_shift( $this->queue ), true ); - } - - public function set( $id, $data ) { - $this->queue[$id] = json_encode( $data ); - } - - public function get( $id ) { - if ( !array_key_exists( $id, $this->queue ) ) { - return null; - } - return json_decode( $this->queue[$id], true ); - } - - public function clear( $id ) { - if ( array_key_exists( $id, $this->queue ) ) { - unset( $this->queue[$id] ); - } } } -- To view, visit https://gerrit.wikimedia.org/r/340924 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I34e782f5dd833de407642c39df2d1ca90a933abf Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: Awight <awi...@wikimedia.org> Gerrit-Reviewer: AndyRussG <andrew.green...@gmail.com> Gerrit-Reviewer: Cdentinger <cdentin...@wikimedia.org> Gerrit-Reviewer: Ejegg <eeggles...@wikimedia.org> Gerrit-Reviewer: Ssmith <ssm...@wikimedia.org> Gerrit-Reviewer: XenoRyet <dkozlow...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits