Commit 7d43527b authored by John Kelly's avatar John Kelly

Add scrutinizer, update readme, add contributing document, and update composer.json

parent 80505130
......@@ -2,12 +2,12 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/.scrutinizer.yml export-ignore
/Makefile export-ignore
/NOTE.DEVELOPMENT.NOV.2011.md export-ignore
/NOTE.THENETCIRCLE.md export-ignore
/README.md export-ignore
/benchmark export-ignore
/bin/ci export-ignore
/demo export-ignore
/doc export-ignore
/phpunit.xml export-ignore
......
filter:
paths: [PhpAmqpLib/*]
excluded_paths: [tests/*, demo/*, benchmark/*, spec/*]
checks:
php:
remove_extra_empty_lines: true
remove_php_closing_tag: true
remove_trailing_whitespace: true
fix_use_statements:
remove_unused: true
preserve_multiple: false
preserve_blanklines: true
order_alphabetically: true
fix_php_opening_tag: true
fix_linefeed: true
fix_line_ending: true
fix_identation_4spaces: true
fix_doc_comments: true
tools:
external_code_coverage:
timeout: 600
runs: 3
......@@ -8,18 +8,28 @@ php:
- 7.0
- hhvm
- hhvm-nightly
matrix:
fast_finish: true
allow_failures:
- php: 7.0
- php: hhvm-nightly
include:
- php: 5.3
env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'
before_script:
- composer install --dev --prefer-source
- ./bin/ci/before_build.sh
- travis_retry composer self-update
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source
- sudo rabbitmqctl add_vhost "phpamqplib_testbed"
- sudo rabbitmqctl add_user phpamqplib phpamqplib_password
- sudo rabbitmqctl set_permissions -p "phpamqplib_testbed" phpamqplib ".*" ".*" ".*"
script:
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
script: make test
after_script:
- if [[ $TRAVIS_PHP_VERSION != 'hhvm' && $TRAVIS_PHP_VERSION != '7.0' ]]; then php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover; fi
services:
rabbitmq
# Contributing
Contributions are **welcome** and will be fully **credited**.
We accept contributions via Pull Requests on [Github](https://github.com/videlalvaro/php-amqplib).
## Pull Requests
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
- **Document any change in behaviour** - Make sure the README and any other relevant documentation are kept up-to-date.
- **Consider our release cycle** - We try to follow semver. Randomly breaking public APIs is not an option.
- **Create topic branches** - Don't ask us to pull from your master branch.
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
## Running Tests
``` bash
$ phpunit
```
**Happy coding**!
# php-amqplib #
[![Build Status](https://secure.travis-ci.org/videlalvaro/php-amqplib.png)](http://travis-ci.org/videlalvaro/php-amqplib)
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE)
[![Build Status][ico-travis]][link-travis]
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
[![Quality Score][ico-code-quality]][link-code-quality]
[![Total Downloads][ico-downloads]][link-downloads]
This library is a _pure PHP_ implementation of the AMQP protocol. It's been tested against [RabbitMQ](http://www.rabbitmq.com/).
......@@ -86,6 +91,10 @@ If you need to listen to the sockets used to connect to RabbitMQ then see the ex
$ php amqp_consumer_non_blocking.php
```
## Change log
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Tutorials ##
To not repeat ourselves, if you want to learn more about this library,
......@@ -144,11 +153,11 @@ $ch->basic_publish($msg, $exchange);
AMQP imposes no limit on the size of messages; if a very large message is received by a consumer, PHP's memory limit may be reached
within the library before the callback passed to `basic_consume` is called.
To avoid this, you can call the method `setBodySizeLimit(int $bytes)` on your Channel object. Body sizes exceeding this will be truncated,
To avoid this, you can call the method `setBodySizeLimit(int $bytes)` on your Channel object. Body sizes exceeding this will be truncated,
and delivered to your callback with a `$msg->is_truncated` flag set. The property `$msg->body_size` will reflect the true body size of
a received message, which will be higher than `strlen($msg->body)` if the message has been truncated.
Note that all data above the limit is read from the AMQP Channel and immediately discarded, so there is no way to retrieve it within your
Note that all data above the limit is read from the AMQP Channel and immediately discarded, so there is no way to retrieve it within your
callback. If you have another consumer which can handle messages with larger payloads, you can use `basic_reject` or `basic_nack` to tell
the server (which still has a complete copy) to forward it to a Dead Letter Exchange.
......@@ -232,6 +241,10 @@ Once your environment is set up you can run your tests like this:
$ make test
```
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Using AMQP 0.8 ##
If you still want to use the old version of the protocol then you can do it by settings the following constant in your configuration code:
......@@ -268,3 +281,18 @@ For bug reports, please use bug tracking system at the project page.
Patches are very welcome!
Author: Vadim Zaliva <lord@crocodile.org>
[ico-version]: https://img.shields.io/packagist/v/videlalvaro/php-amqplib.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-LGPL-brightgreen.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/videlalvaro/php-amqplib/master.svg?style=flat-square
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/videlalvaro/php-amqplib.svg?style=flat-square
[ico-code-quality]: https://img.shields.io/scrutinizer/g/videlalvaro/php-amqplib.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/videlalvaro/php-amqplib.svg?style=flat-square
[link-packagist]: https://packagist.org/packages/videlalvaro/php-amqplib
[link-travis]: https://travis-ci.org/videlalvaro/php-amqplib
[link-scrutinizer]: https://scrutinizer-ci.com/g/videlalvaro/php-amqplib/code-structure
[link-code-quality]: https://scrutinizer-ci.com/g/videlalvaro/php-amqplib
[link-downloads]: https://packagist.org/packages/videlalvaro/php-amqplib
[link-author]: https://github.com/videlalvaro
[link-contributors]: ../../contributors
#!/bin/sh
# phpamqplib:phpamqplib_password has full access to phpamqplib_testbed
sudo rabbitmqctl add_vhost phpamqplib_testbed
sudo rabbitmqctl add_user phpamqplib phpamqplib_password
sudo rabbitmqctl set_permissions -p phpamqplib_testbed phpamqplib ".*" ".*" ".*"
......@@ -15,7 +15,8 @@
"ext-mbstring": "*"
},
"require-dev": {
"phpunit/phpunit": "3.7.*"
"phpunit/phpunit": "^3.7",
"scrutinizer/ocular": "^1.1"
},
"suggest": {
"ext-sockets": "Use AMQPSocketConnection"
......@@ -34,7 +35,7 @@
"license": "LGPL-2.1",
"extra": {
"branch-alias": {
"dev-master": "2.4-dev"
"dev-master": "2.7-dev"
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment