Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 36 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
sudo: required

language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
services:
- docker

cache:
directories:
Expand All @@ -13,20 +12,46 @@ cache:
matrix:
fast_finish: true
include:
- php: 5.5
- php: 7.1
env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER=weak
- php: 5.6
env: SYMFONY_VERSION='2.7.*'
- php: 5.6
env: SYMFONY_VERSION='2.8.*'
- php: 7.1
env: SYMFONY_VERSION='3.4.*'
- php: 7.1
- php: 7.2

before_install:
- composer self-update
- if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/symfony=$SYMFONY_VERSION; fi
- git clone git://github.com/nicolasff/phpredis.git
- cd phpredis && phpize && ./configure && make && sudo make install && cd ..
- echo "extension=redis.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
- docker pull cheprasov/redis-for-tests:latest;
- docker pull cheprasov/redis-cluster-for-tests:latest;
- |
docker run -i -t -d \
-p 127.0.0.1:6379:6381 \
-p 127.0.0.1:6382:6382 \
-p 127.0.0.1:6383:6383 \
-p 127.0.0.1:6384:6384 \
-p 127.0.0.1:6385:6385 \
-p 127.0.0.1:6386:6386 \
-p 127.0.0.1:6387:6387 \
-p 127.0.0.1:6388:6388 \
-p 127.0.0.1:6389:6389 \
-p 127.0.0.1:6390:6390 \
cheprasov/redis-for-tests
- |
docker run -i -t -d \
-p 127.0.0.1:7001:7001 \
-p 127.0.0.1:7002:7002 \
-p 127.0.0.1:7003:7003 \
-p 127.0.0.1:7004:7004 \
-p 127.0.0.1:7005:7005 \
-p 127.0.0.1:7006:7006 \
cheprasov/redis-cluster-for-tests
- docker ps;
- sleep 5;

install: composer update $COMPOSER_FLAGS

script: phpunit
script: vendor/bin/phpunit
45 changes: 16 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ RSQueueBundle for Symfony
### Simple queuing system based on Redis

[![SensioLabsInsight](https://insight.sensiolabs.com/projects/78931ad8-b016-4b5b-9b45-c5a5767fbd9e/mini.png)](https://insight.sensiolabs.com/projects/78931ad8-b016-4b5b-9b45-c5a5767fbd9e)
[![Build Status](https://secure.travis-ci.org/mmoreram/RSQueueBundle.png?branch=master)](http://travis-ci.org/mmoreram/rsqueue-bundle)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/mmoreram/RSQueueBundle/badges/quality-score.png?s=290f904ff14fb72d9d40288682949b3de88f99f9)](https://scrutinizer-ci.com/g/mmoreram/RSQueueBundle/)
[![Build Status](https://secure.travis-ci.org/RSQueue/RSQueueBundle.png?branch=master)](http://travis-ci.org/RSQueue/RSQueueBundle)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/RSQueue/RSQueueBundle/badges/quality-score.png?s=290f904ff14fb72d9d40288682949b3de88f99f9)](https://scrutinizer-ci.com/g/RSQueue/RSQueueBundle/)

Table of contents
-----
Expand Down Expand Up @@ -38,7 +38,7 @@ make

## Installing [PHPRedis](https://github.com/nicolasff/phpredis)

phpredis extension is necessary to be installed in your server.
phpredis extension is necessary to be installed in your server.
Otherwise composer will alert you.

``` bash
Expand All @@ -54,24 +54,11 @@ echo "extension=redis.so" >> `php --ini | grep "Loaded Configuration" | sed -e "

## Installing [RSQueue](http://rsqueue.com)

You have to add require line into you composer.json file

``` yml
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
...
"mmoreram/rsqueue-bundle": "dev-master"
},
```

Then you have to use composer to update your project dependencies

``` bash
php composer.phar update
composer require mmoreram/rsqueue-bundle:^1.0@dev
```

And register the bundle in your appkernel.php file
Register the bundle in your `AppKernel.php` file

``` php
return array(
Expand All @@ -83,8 +70,8 @@ return array(

## Configuration

In this first version, all conections are localhost:6379, but as soon as posible connections will be configurable.
You need to configure all queues and serializer.
In this first version, all conections are localhost:6379, but as soon as posible connections will be configurable.
You need to configure all queues and serializer.
By default serializer has the value 'Json', but also 'PHP' value can be used. Also custom serializer can be implemented by extending default serializer interface. Then you need to add namespace of class into the rs_queue.serializer parameter.

``` yml
Expand All @@ -108,7 +95,7 @@ rs_queue:

Producers/Consumers
-----
Producer/consumer model allows you to produce elements into one/many queues by using default rsqueue producer service.
Producer/consumer model allows you to produce elements into one/many queues by using default rsqueue producer service.
One element is pushed into one queue so one and only one consumer will pop and treat this element.

``` php
Expand Down Expand Up @@ -178,7 +165,7 @@ class TestConsumerCommand extends ConsumerCommand
Publishers/Subscribers
-----
This model allows data broadcasting. This means that one or more Subscribers will treat all elements of the queue, but only if they are listening just in the moment publisher publish them.

``` php
$this->container->get("rs_queue.publisher")->publish("audios", "this is my audio");
```
Expand Down Expand Up @@ -350,10 +337,10 @@ const RSQUEUE_PUBLISHER = 'rs_queue.publisher';
Contributing
-----

All code is Symfony2 Code formatted, so every pull request must validate phpcs
standards. You should read
[Symfony2 coding standards](http://symfony.com/doc/current/contributing/code/standards.html)
and install [this](https://github.com/opensky/Symfony2-coding-standard)
All code is Symfony Code formatted, so every pull request must validate phpcs
standards. You should read
[Symfony coding standards](https://symfony.com/doc/current/contributing/code/standards.html)
and install [this](https://github.com/opensky/Symfony2-coding-standard)
CodeSniffer to check all code is validated.

There is also a policy for contributing to this project. All pull request must
Expand All @@ -364,6 +351,6 @@ If you'd like to contribute, please read the [Contributing Code][1] part of the
documentation. If you're submitting a pull request, please follow the guidelines
in the [Submitting a Patch][2] section and use the [Pull Request Template][3].

[1]: http://symfony.com/doc/current/contributing/code/index.html
[2]: http://symfony.com/doc/current/contributing/code/patches.html#check-list
[3]: http://symfony.com/doc/current/contributing/code/patches.html#make-a-pull-request
[1]: https://symfony.com/doc/current/contributing/code/index.html
[2]: https://symfony.com/doc/current/contributing/code/patches.html#check-list
[3]: https://symfony.com/doc/current/contributing/code/patches.html#make-a-pull-request
2 changes: 1 addition & 1 deletion Tests/ClusterRedisTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static function getRedisConfiguration(): array
{
return [
'cluster' => true,
'port' => 30001,
'port' => 7001,
];
}
}
19 changes: 12 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
}
],
"require": {
"php": ">=7.1",
"php": "^7.1",
"symfony/config": "^3.0|^4.0",
"symfony/http-kernel": "^3.0|^4.0",
"symfony/http-foundation": "^3.0|^4.0",
"symfony/dependency-injection": "~3.0|^4.0",
"symfony/framework-bundle": "~3.0|^4.0",
"symfony/dependency-injection": "^3.0|^4.0",
"symfony/framework-bundle": "^3.0|^4.0",
"mmoreram/base-bundle": "^1.0.7",
"mmoreram/symfony-bundle-dependencies": "^2.0.0",
"rsqueue/rsqueue": "^0.1.0"
"mmoreram/symfony-bundle-dependencies": "^2.0",
"rsqueue/rsqueue": "^0.1"
},
"require-dev": {
"phpunit/phpunit": "^5.6.4",
"mmoreram/php-formatter": "1.3.1",
"friendsofphp/php-cs-fixer": "^2.5.0"
"mmoreram/php-formatter": "^1.3.1",
"friendsofphp/php-cs-fixer": "^2.5"
},
"autoload": {
"psr-4": {
Expand All @@ -41,5 +41,10 @@
"test": [
"vendor/phpunit/phpunit/phpunit"
]
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
}
}