Skip to content

Commit 08e6d6a

Browse files
authored
Merge pull request #60 from chadicus/develop
Version 3
2 parents 81e8d41 + fa400be commit 08e6d6a

26 files changed

+1030
-3195
lines changed

.gitattributes

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Enforce Unix newlines
2+
* text=lf
3+
4+
# Exclude unused files
5+
# see: https://redd.it/2jzp6k
6+
/tests export-ignore
7+
/.*.yml export-ignore
8+
/.gitattributes export-ignore
9+
/.gitignore export-ignore
10+
/.github export-ignore
11+
/*.xml export-ignore
12+
README.md export-ignore
13+
phpunit.xml.dist export-ignore

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @traderinteractive/opensource

.github/CONTRIBUTING.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Contribution Guidelines
2+
3+
We welcome you to report [issues](/../../issues) or submit [pull requests](/../../pulls). While the below guidelines
4+
are necessary to get code merged, you can submit pull requests that do not adhere to them and we will try to take care
5+
of them in our spare time. We are a smallish group of developers, though, so if you can make sure the build is passing
6+
100%, that would be very useful.
7+
8+
We recommend including details of your particular usecase(s) with any issues or pull requests. We love to hear how our
9+
libraries are being used and we can get things merged in quicker when we understand its expected usage.
10+
11+
## Running the build
12+
To run the build do the following:
13+
```sh
14+
composer install
15+
./vendor/bin/phpunit
16+
./vendor/bin/phpcs
17+
```
18+
19+
This build enforces 100% [PHPUnit](http://www.phpunit.de) code coverage and 0 errors for the [coding standard](http://www.php-fig.org/psr/psr-2/).
20+
21+
Failures in either will keep us from merging the pull request.

.github/ISSUE_TEMPLATE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Expected behavior
2+
3+
### Actual behavior
4+
5+
### Steps to reproduce the behavior

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Fixes # .
2+
3+
#### What does this PR do?
4+
5+
#### Checklist
6+
- [ ] Pull request contains a clear definition of changes
7+
- [ ] Tests (either unit, integration, or acceptance) written and passing
8+
- [ ] Relevant documentation produced and/or updated

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
/clover.xml
22
/vendor
33
/coverage/
4+
composer.lock
5+
phpunit.xml

.scrutinizer.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
build:
2-
environment:
3-
php: 7.0.6
4-
mongodb: true
51
filter:
62
excluded_paths:
73
- 'vendor/*'
8-
- 'tests/*'
94
before_commands:
105
- 'composer install'
116
tools:
@@ -18,12 +13,10 @@ tools:
1813
php_loc:
1914
excluded_dirs:
2015
- vendor
21-
- tests
2216
php_pdepend: true
2317
php_sim: true
2418
build_failure_conditions:
25-
- 'elements.rating(<= D).new.exists' # No new classes/methods with a rating of D or worse allowed (useful for legacy code)
26-
- 'issues.label("coding-style").new.exists' # No new coding style issues allowed
27-
- 'issues.label("coding-style").new.count > 5' # More than 5 new coding style issues.
28-
- 'issues.severity(>= MAJOR).new.exists' # New issues of major or higher severity
29-
- 'project.metric("scrutinizer.quality", < 6)' # Code Quality Rating drops below 6
19+
- 'elements.rating(< B).new.exists'
20+
- 'issues.label("coding-style").new.exists'
21+
- 'issues.severity(>= MAJOR).new.exists'
22+
- 'project.metric("scrutinizer.quality", < 9)'

.travis.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
language: php
22
php:
33
- 7.0
4-
- 5.6
5-
services:
6-
- mongodb
4+
- 7.1
5+
- 7.2
6+
- nightly
7+
env:
8+
- PREFER_LOWEST="--prefer-lowest --prefer-stable"
9+
- PREFER_LOWEST=""
10+
services: mongodb
11+
matrix:
12+
fast_finish: true
13+
allow_failures:
14+
- php: nightly
715
before_script:
8-
- composer self-update
9-
- yes '' | pecl install -f mongodb-1.1
10-
script: ./build.php
11-
after_script: ./vendor/bin/coveralls -v
16+
- yes '' | pecl install -f mongodb
17+
- composer update $PREFER_LOWEST
18+
script: ./vendor/bin/phpunit --coverage-clover clover.xml
19+
after_success: ./vendor/bin/coveralls -v

CONTRIBUTING.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2013 Dominion Enterprises
3+
Copyright (c) 2017 Trader Interactive
44

55
Permission is hereby granted, free of charge, to any person
66
obtaining a copy of this software and associated documentation

README.md

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,74 @@
1-
#mongo-queue-php
2-
[![Build Status](http://img.shields.io/travis/dominionenterprises/mongo-queue-php.svg?style=flat)](https://travis-ci.org/dominionenterprises/mongo-queue-php)
3-
[![Scrutinizer Code Quality](http://img.shields.io/scrutinizer/g/dominionenterprises/mongo-queue-php.svg?style=flat)](https://scrutinizer-ci.com/g/dominionenterprises/mongo-queue-php/)
4-
[![Code Coverage](http://img.shields.io/coveralls/dominionenterprises/mongo-queue-php.svg?style=flat)](https://coveralls.io/r/dominionenterprises/mongo-queue-php)
1+
# mongo-queue-php
2+
[![Build Status](https://travis-ci.org/traderinteractive/mongo-queue-php.svg?branch=master)](https://travis-ci.org/traderinteractive/mongo-queue-php)
3+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/traderinteractive/mongo-queue-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/traderinteractive/mongo-queue-php/?branch=master)
4+
[![Coverage Status](https://coveralls.io/repos/github/traderinteractive/mongo-queue-php/badge.svg)](https://coveralls.io/github/traderinteractive/mongo-queue-php)
55

6-
[![Latest Stable Version](http://img.shields.io/packagist/v/dominionenterprises/mongo-queue-php.svg?style=flat)](https://packagist.org/packages/dominionenterprises/mongo-queue-php)
7-
[![Total Downloads](http://img.shields.io/packagist/dt/dominionenterprises/mongo-queue-php.svg?style=flat)](https://packagist.org/packages/dominionenterprises/mongo-queue-php)
8-
[![License](http://img.shields.io/packagist/l/dominionenterprises/mongo-queue-php.svg?style=flat)](https://packagist.org/packages/dominionenterprises/mongo-queue-php)
6+
[![Latest Stable Version](https://poser.pugx.org/traderinteractive/mongo-queue-php/v/stable)](https://packagist.org/packages/traderinteractive/mongo-queue-php)
7+
[![Latest Unstable Version](https://poser.pugx.org/traderinteractive/mongo-queue-php/v/unstable)](https://packagist.org/packages/traderinteractive/mongo-queue-php)
8+
[![License](https://poser.pugx.org/traderinteractive/mongo-queue-php/license)](https://packagist.org/packages/traderinteractive/mongo-queue-php)
9+
10+
[![Total Downloads](https://poser.pugx.org/traderinteractive/mongo-queue-php/downloads)](https://packagist.org/packages/traderinteractive/mongo-queue-php)
11+
[![Daily Downloads](https://poser.pugx.org/traderinteractive/mongo-queue-php/d/daily)](https://packagist.org/packages/traderinteractive/mongo-queue-php)
12+
[![Monthly Downloads](https://poser.pugx.org/traderinteractive/mongo-queue-php/d/monthly)](https://packagist.org/packages/traderinteractive/mongo-queue-php)
913

1014
PHP message queue using MongoDB as a backend.
11-
Adheres to the 1.0.0 [specification](https://github.com/dominionenterprises/mongo-queue-specification).
1215

13-
##Features
16+
## Features
1417

1518
* Message selection and/or count via MongoDB query
1619
* Distributes across machines via MongoDB
17-
* Multi language support through the [specification](https://github.com/dominionenterprises/mongo-queue-specification)
1820
* Message priority
1921
* Delayed messages
2022
* Running message timeout and redeliver
2123
* Atomic acknowledge and send together
2224
* Easy index creation based only on payload
2325

24-
##Simplest use
26+
## Simplest use
2527

2628
```php
27-
use DominionEnterprises\Mongo\Queue;
29+
use TraderInteractive\Mongo\Queue;
2830

2931
$queue = new Queue('mongodb://localhost', 'queues', 'queue');
30-
$queue->send(array());
31-
$message = $queue->get(array(), 60);
32-
$queue->ack($message);
32+
$queue->send(new Message());
33+
$messages = $queue->get([], ['runningResetDuration' => 60]);
34+
foreach ($messages as $message) {
35+
// Do something with message
36+
37+
$queue->ack($message);
38+
}
3339
```
3440

35-
##Composer
41+
## Composer
3642

37-
To add the library as a local, per-project dependency use [Composer](http://getcomposer.org)! Simply add a dependency on
38-
`dominionenterprises/mongo-queue-php` to your project's `composer.json` file such as:
43+
To add the library as a local, per-project dependency use [Composer](http://getcomposer.org)! Simply add a
44+
dependency on `traderinteractive/mongo-queue` to your project's `composer.json` file such as:
3945

40-
```json
41-
{
42-
"require": {
43-
"dominionenterprises/mongo-queue-php": "1.*"
44-
}
45-
}
46+
```sh
47+
composer require traderinteractive/mongo-queue
4648
```
4749

48-
##Documentation
50+
## Documentation
4951

50-
Found in the [source](src/Queue.php) itself, take a look!
52+
Found in the [source](src/) itself, take a look!
5153

52-
##Contact
54+
## Contact
5355

5456
Developers may be contacted at:
5557

56-
* [Pull Requests](https://github.com/dominionenterprises/mongo-queue-php/pulls)
57-
* [Issues](https://github.com/dominionenterprises/mongo-queue-php/issues)
58-
59-
##Contributing
58+
* [Pull Requests](https://github.com/traderinteractive/mongo-queue-php/pulls)
59+
* [Issues](https://github.com/traderinteractive/mongo-queue-php/issues)
6060

61+
## Contributing
6162
If you would like to contribute, please use our build process for any changes
62-
and after the build passes, send us a pull request on github! The build
63-
requires a running mongo. The URI to mongo can be specified via an environment
64-
variable or left to its default (localhost on the default port, 27017):
63+
and after the build passes, send us a pull request on github!
6564
```sh
66-
TESTING_MONGO_URL=mongodb://127.0.0.1:27017 ./build.php
65+
./vendor/bin/phpunit
66+
./vendor/bin/phpcs
6767
```
6868

6969
There is also a [docker](http://www.docker.com/)-based
70-
[fig](http://www.fig.sh/) configuration that will standup a docker container
71-
for the database, execute the build inside a docker container, and then
72-
terminate everything. This is an easy way to build the application:
70+
[fig](http://www.fig.sh/) configuration that will execute the build inside a
71+
docker container. This is an easy way to build the application:
7372
```sh
7473
fig run build
7574
```

build.php

Lines changed: 0 additions & 42 deletions
This file was deleted.

composer.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "dominionenterprises/mongo-queue-php",
2+
"name": "traderinteractive/mongo-queue",
33
"description": "Message queue using MongoDB as a backend",
44
"keywords": ["mongo", "priority", "queue", "message", "messaging"],
55
"authors": [
@@ -20,16 +20,19 @@
2020
}
2121
],
2222
"license": "MIT",
23+
"config": {
24+
"sort-packages": true
25+
},
2326
"require": {
24-
"php": "^5.6 || ^7.0",
25-
"mongodb/mongodb": "^1.0.0"
27+
"php": "^7.0",
28+
"mongodb/mongodb": "^1.1"
2629
},
2730
"require-dev": {
28-
"squizlabs/php_codesniffer": "~2.0",
29-
"phpunit/phpunit": "^5.5",
30-
"satooshi/php-coveralls": "^1.0"
31+
"phpunit/phpunit": "^6.5.2",
32+
"php-coveralls/php-coveralls": "^1.0",
33+
"squizlabs/php_codesniffer": "^3.2"
3134
},
3235
"autoload": {
33-
"psr-4": { "DominionEnterprises\\Mongo\\": "src/" }
36+
"psr-4": { "TraderInteractive\\Mongo\\": "src/" }
3437
}
3538
}

0 commit comments

Comments
 (0)