yiisoft / yii-queue-amqp
yii-queue amqp adapter based on amqp-lib package
Fund package maintenance!
Open Collective
yiisoft
Requires
- php: ^8.0
- ext-json: *
- ext-sockets: *
- php-amqplib/php-amqplib: ^3.1.0
- yiisoft/factory: ^1.0
- yiisoft/friendly-exception: ^1.0
- yiisoft/yii-queue: dev-master
Requires (Dev)
- maglnet/composer-require-checker: ^4.4
- phpunit/phpunit: ^9.5
- rector/rector: ^0.17.0
- roave/infection-static-analysis-plugin: ^1.16
- spatie/phpunit-watcher: ^1.23
- symfony/console: ^6.0
- symfony/process: ^6.0
- vimeo/psalm: ^4.30|^5.8
- yiisoft/test-support: ^3.0
This package is auto-updated.
Last update: 2023-06-03 06:45:43 UTC
README
Yii Queue AMQP Adapter
AMQP adapter based on php-amqplib package for Yii Queue.
Installation
The preferred way to install this extension is through composer.
Either run
composer require yiisoft/yii-queue-amqp
or add
"yiisoft/yii-queue-amqp": "dev-master"
to the require
section of your composer.json
file.
Extra
Docker
Don't forget you have to have the latest version of docker
installed and running on your computer in order to use it.
Developer environment
This project has ready to use docker environment inside the tests
directory.
It uses docker-compose.yml
by default, which is meant to work fine inside CI steps.
To comfortably use docker environment to run tests on your own machine you should extend the default
docker-compose.yml
with the additional config file docker-compose.development.yml
. The simplest way is
to copy .env.example
file with name .env
. It has essential environment variables to use both these yml
configurations.
Review these variables and change if needed.
Then you can use docker compose as always. To execute unit tests, run the command
docker compose run --rm php82 vendor/bin/phpunit
inside the tests
folder.
You can also choose the needed version of php instead of 8.2.
xDebug and PhpStorm
For xDebug to work properly with PhpStorm, you have to additionally configure your PhpStorm. Open Settings and add a new Server in the PHP settings block:
- Set server name to
yii-queue-amqp
. - Enable path mappings.
- Set your project root equal to the path
/app
on the server.
These settings are properly set on the screenshot below:
Unit testing
The package is tested with PHPUnit. To run tests:
cd tests && docker compose build && docker compose run --rm php82 vendor/bin/phpunit
You can use any of the supported PHP versions with service names php80
, php81
and php82
.
To debug code with xDebug and to use volumes inside the built containers, you can use
test/docker-compose.development.yml
. To do so you should either run
docker compose -f docker-compose.yml -f docker-compose.development.yml run --rm php<version> vendor/bin/phpunit
or copy tests/.env.example into tests/.env
and run tests as usual.
Also, if you are using Docker, then you have access to a set of prepared commands in the Makefile
Static analysis
# {{ v }} = 80, 81, 82
make static-analyze v=80
Unit tests
# {{ v }} = 80, 81, 82 make test v=80
Mutation tests
# {{ v }} = 80, 81, 82
make mutation-test v=80
Code coverage
# {{ v }} = 80, 81, 82
make coverage v=80
Static analysis
The code is statically analyzed with Psalm. To run static analysis:
./vendor/bin/psalm
Support the project
Follow updates
License
The Yii Queue AMQP Adapter is free software. It is released under the terms of the BSD License.
Please see LICENSE
for more information.
Maintained by Yii Software.