Ejegg has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/377490 )
Change subject: Update PHP-Queue to 1.0 ...................................................................... Update PHP-Queue to 1.0 Change-Id: I7a8ac462c40ed8ca54d6b18264e1d9f97f237bc1 --- M coderkungfu/php-queue/.travis.yml M coderkungfu/php-queue/README.md M coderkungfu/php-queue/composer.json M coderkungfu/php-queue/demo/runners/README.md M composer/installed.json 5 files changed, 113 insertions(+), 108 deletions(-) Approvals: Ejegg: Verified; Looks good to me, approved diff --git a/coderkungfu/php-queue/.travis.yml b/coderkungfu/php-queue/.travis.yml index 7941bc4..8f270d2 100644 --- a/coderkungfu/php-queue/.travis.yml +++ b/coderkungfu/php-queue/.travis.yml @@ -4,16 +4,21 @@ # language: php -php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm + +dist: trusty matrix: + include: + - php: 5.3 + dist: precise + - php: 5.4 + - php: 5.5 + - php: 5.6 + - php: 7.0 + - php: hhvm allow_failures: + - php: 5.3 + dist: precise - php: 7.0 - php: hhvm @@ -22,6 +27,8 @@ username: root encoding: utf8 +before_install: echo "extension=memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini + before_script: - mysql -e 'create database phpqueuetest;' - composer self-update @@ -29,5 +36,3 @@ script: phpunit --coverage-text -c phpunit.travis.xml -after_script: - - "wget --quiet http://mauris.sg/bin/pdc.phar && php pdc.phar src" diff --git a/coderkungfu/php-queue/README.md b/coderkungfu/php-queue/README.md index 74ff0e7..3f3d2f6 100644 --- a/coderkungfu/php-queue/README.md +++ b/coderkungfu/php-queue/README.md @@ -1,5 +1,5 @@ # PHP-Queue # -[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/CoderKungfu/php-queue?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/CoderKungfu/php-queue?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) A unified front-end for different queuing backends. Includes a REST server, CLI interface and daemon runners. @@ -57,12 +57,12 @@ 2. Download and install Composer. - ``` +``` curl -s "http://getcomposer.org/installer" | php ``` 3. Install your dependencies. - ``` +``` php composer.phar install ``` @@ -70,7 +70,7 @@ 5. Require Composer's autoloader. - ```php +```php <?php require_once '/path/to/vendor/autoload.php'; ?> @@ -130,19 +130,19 @@ 1. Add new job. - ``` +``` # Form post curl -XPOST http://localhost/<QueueName>/ -d "var1=foo&var2=bar" ``` - ``` +``` # JSON post curl -XPOST http://localhost/<QueueName>/ -H "Content-Type: application/json" -d '{"var1":"foo","var2":"bar"}' ``` 2. Trigger next job. - ``` +``` curl -XPUT http://localhost/<QueueName>/ ``` @@ -154,13 +154,13 @@ 1. Add new job. - ``` +``` $ php cli.php <QueueName> add --data '{"boo":"bar","foo":"car"}' ``` 2. Trigger next job. - ``` +``` $ php cli.php <QueueName> work ``` diff --git a/coderkungfu/php-queue/composer.json b/coderkungfu/php-queue/composer.json index 085c069..6e30fad 100644 --- a/coderkungfu/php-queue/composer.json +++ b/coderkungfu/php-queue/composer.json @@ -5,6 +5,7 @@ "homepage": "http://github.com/CoderKungfu/php-queue", "type": "library", "license": "MIT", + "version": "1.0.0", "authors": [ { "name": "Michael Cheng", @@ -24,12 +25,12 @@ }, "require-dev": { "mrpoundsign/pheanstalk-5.3": "dev-master", - "aws/aws-sdk-php": "dev-master", + "aws/aws-sdk-php": ">=2.8", "amazonwebservices/aws-sdk-for-php": "dev-master", "predis/predis": "1.*", "iron-io/iron_mq": "dev-master", "ext-memcache": "*", - "microsoft/windowsazure": "dev-master" + "microsoft/windowsazure": ">=0.4.0" }, "suggest": { "predis/predis": "For Redis backend support", diff --git a/coderkungfu/php-queue/demo/runners/README.md b/coderkungfu/php-queue/demo/runners/README.md index 5ddab8d..3f89d0f 100644 --- a/coderkungfu/php-queue/demo/runners/README.md +++ b/coderkungfu/php-queue/demo/runners/README.md @@ -26,13 +26,13 @@ 1. Create a new PHP file named "SimpleRunner.php" (no naming convention here). 2. Include the config file: - ```php +```php require_once '/path/to/your/config.php'; ``` 3. Create a new Runner class (extending `PHPQueue\Runner`). The queue name can be defined in the `$queue_name` attribute. - ```php +```php class SampleRunner extends PHPQueue\Runner { public $queue_name = 'Sample'; @@ -41,14 +41,14 @@ 4. Instantiate the class and call the `run()` method. - ```php +```php $runner = new SampleRunner(); $runner->run(); ``` 5. Run the Runner. - ``` +``` $ php SimpleRunner.php ``` @@ -92,8 +92,7 @@ $ php BeanstalkSampleStop.php ``` -***Note:***<br/> -On CentOS, you will need to install `php-process` package: `sudo yum install php-process` +*__Note:__ On CentOS, you will need to install `php-process` package: `sudo yum install php-process`* ### The Proper Way ### @@ -109,7 +108,7 @@ 1. Combine the start and stop scripts into 1 file. And use PHP's `$argv` ([reference](http://www.php.net/manual/en/reserved.variables.argv.php)) to switch between executing `start` or `stop`: - ```php +```php require_once '/path/to/your/config.php'; $pid_file = '/path/to/process.pid'; if (empty($argv[1])) @@ -145,28 +144,28 @@ ?> ``` - *__Note:__ Some `echo` statements were added to provide some on-screen feedback.* +*__Note:__ Some `echo` statements were added to provide some on-screen feedback.* 2. Make your runner executable by adding this to the first line of the PHP script: - ``` +``` #!/usr/bin/php ``` and make the file executable under linux: - ``` +``` $ chmod a+x BeanstalkSampleDaemon.php ``` That way, you can call the script directly without involving PHP: - ``` +``` $ ./BeanstalkSampleDaemon.php ``` 3. Move the file to `/etc/init.d/` folder. - ``` +``` $ mv BeanstalkSampleDaemon.php /etc/init.d/BeanstalkSampleDaemon ``` @@ -174,7 +173,7 @@ 4. You can now run this script like a normal daemon: - ``` +``` $ /etc/init.d/BeanstalkSampleDaemon start ``` @@ -184,7 +183,7 @@ 1. Add this to the top of your script: - ``` +``` # !/usr/bin/php <?php # @@ -196,17 +195,17 @@ ... ``` - *__Note:__ Customize to your specific script.* +*__Note:__ Customize to your specific script.* 2. Run this to add this to the boot up process: - ``` +``` $ chkconfig --levels 235 BeanstalkSampleDaemon on ``` 3. To delete it: - ``` +``` $ chkconfig --del BeanstalkSampleDaemon ``` diff --git a/composer/installed.json b/composer/installed.json index 9ab97ae..0521000 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -180,77 +180,6 @@ ] }, { - "name": "coderkungfu/php-queue", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "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.*", - "monolog/monolog": "~1.3", - "php": ">=5.3.0" - }, - "require-dev": { - "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", - "fusesource/stomp-php": "For the STOMP backend", - "iron-io/iron_mq": "For IronMQ backend support", - "microsoft/windowsazure": "For Windows Azure Service Bus backend support", - "mrpoundsign/pheanstalk-5.3": "For Beanstalkd backend support", - "pecl-mongodb": "For MongoDB backend support", - "predis/predis": "For Redis backend support" - }, - "time": "2017-04-17T14:11:55+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.0-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "PHPQueue": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Cheng", - "email": "mcheng.w...@gmail.com" - } - ], - "description": "A unified front-end for different queuing backends. Includes a REST server, CLI interface and daemon runners.", - "homepage": "http://github.com/CoderKungfu/php-queue", - "keywords": [ - "queue", - "transaction" - ] - }, - { "name": "psr/log", "version": "1.0.2", "version_normalized": "1.0.2.0", @@ -884,5 +813,76 @@ ], "description": "Powerful command-line option toolkit", "homepage": "http://github.com/c9s/GetOptionKit" + }, + { + "name": "coderkungfu/php-queue", + "version": "1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/CoderKungfu/php-queue.git", + "reference": "a9baeb0ae3b05bbd0d2f9f56c8365ff63f64524a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CoderKungfu/php-queue/zipball/a9baeb0ae3b05bbd0d2f9f56c8365ff63f64524a", + "reference": "a9baeb0ae3b05bbd0d2f9f56c8365ff63f64524a", + "shasum": "" + }, + "require": { + "clio/clio": "0.1.*", + "monolog/monolog": "~1.3", + "php": ">=5.3.0" + }, + "require-dev": { + "amazonwebservices/aws-sdk-for-php": "dev-master", + "aws/aws-sdk-php": ">=2.8", + "ext-memcache": "*", + "iron-io/iron_mq": "dev-master", + "microsoft/windowsazure": ">=0.4.0", + "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", + "fusesource/stomp-php": "For the STOMP backend", + "iron-io/iron_mq": "For IronMQ backend support", + "microsoft/windowsazure": "For Windows Azure Service Bus backend support", + "mrpoundsign/pheanstalk-5.3": "For Beanstalkd backend support", + "pecl-mongodb": "For MongoDB backend support", + "predis/predis": "For Redis backend support" + }, + "time": "2017-09-08T03:14:59+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.0-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "PHPQueue": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Cheng", + "email": "mcheng.w...@gmail.com" + } + ], + "description": "A unified front-end for different queuing backends. Includes a REST server, CLI interface and daemon runners.", + "homepage": "http://github.com/CoderKungfu/php-queue", + "keywords": [ + "queue", + "transaction" + ] } ] -- To view, visit https://gerrit.wikimedia.org/r/377490 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a8ac462c40ed8ca54d6b18264e1d9f97f237bc1 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig/vendor Gerrit-Branch: master Gerrit-Owner: Ejegg <ej...@ejegg.com> Gerrit-Reviewer: Ejegg <ej...@ejegg.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits