This repository has been archived by the owner on Feb 14, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 58b1d0d
Showing
12 changed files
with
838 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/vendor | ||
/.env | ||
composer.phar | ||
composer.lock | ||
.DS_Store | ||
Thumbs.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: php | ||
|
||
php: | ||
- 5.5 | ||
- 5.6 | ||
- hhvm | ||
|
||
sudo: false | ||
|
||
install: travis_retry composer install --no-interaction --prefer-source | ||
|
||
script: vendor/bin/phpunit --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) <Taylor Otwell> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"name": "laravelcollective/iron-queue", | ||
"description": "IronMQ support for the Laravel queue.", | ||
"license": "MIT", | ||
"homepage": "http://laravelcollective.com", | ||
"support": { | ||
"issues": "https://github.com/laravelcollective/iron-queue/issues", | ||
"source": "https://github.com/laravelcollective/iron-queue" | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Taylor Otwell", | ||
"email": "taylorotwell@gmail.com" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.5.9", | ||
"illuminate/container": "5.2.*", | ||
"illuminate/contracts": "5.2.*", | ||
"illuminate/encryption": "5.2.*", | ||
"illuminate/http": "5.2.*", | ||
"illuminate/queue": "5.2.*", | ||
"illuminate/support": "5.2.*", | ||
"iron-io/iron_mq": "~2.0", | ||
"jeremeamia/superclosure": "~2.0" | ||
}, | ||
"require-dev": { | ||
"mockery/mockery": "~0.9", | ||
"phpunit/phpunit": "~4.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Collective\\IronQueue\\": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "5.3-dev" | ||
} | ||
}, | ||
"minimum-stability": "dev" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
syntaxCheck="false" | ||
> | ||
<testsuites> | ||
<testsuite name="Package Test Suite"> | ||
<directory suffix=".php">./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# IronMQ Laravel Queue Driver | ||
|
||
This package provides a IronMQ (~2.0 SDK) driver for the Laravel queue system and matches the driver that was found in Laravel 5.1. | ||
|
||
## Installation | ||
|
||
- Add `Collective\IronQueue\IronQueueServiceProvider` to your `app.php` configuration file. | ||
- Configure your `iron` queue driver in your `config/queue.php` the same as it would have been configured for Laravel 5.1. | ||
|
||
Sample Configuration: | ||
|
||
```php | ||
'iron' => [ | ||
'driver' => 'iron', | ||
'host' => 'mq-aws-us-east-1.iron.io', | ||
'token' => 'your-token', | ||
'project' => 'your-project-id', | ||
'queue' => 'your-queue-name', | ||
'encrypt' => true, | ||
], | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
namespace Collective\IronQueue\Connectors; | ||
|
||
use IronMQ\IronMQ; | ||
use Illuminate\Http\Request; | ||
use Collective\IronQueue\IronQueue; | ||
use Illuminate\Contracts\Encryption\Encrypter as EncrypterContract; | ||
|
||
class IronConnector implements ConnectorInterface | ||
{ | ||
/** | ||
* The encrypter instance. | ||
* | ||
* @var \Illuminate\Encryption\Encrypter | ||
*/ | ||
protected $crypt; | ||
|
||
/** | ||
* The current request instance. | ||
* | ||
* @var \Illuminate\Http\Request | ||
*/ | ||
protected $request; | ||
|
||
/** | ||
* Create a new Iron connector instance. | ||
* | ||
* @param \Illuminate\Contracts\Encryption\Encrypter $crypt | ||
* @param \Illuminate\Http\Request $request | ||
* @return void | ||
*/ | ||
public function __construct(EncrypterContract $crypt, Request $request) | ||
{ | ||
$this->crypt = $crypt; | ||
$this->request = $request; | ||
} | ||
|
||
/** | ||
* Establish a queue connection. | ||
* | ||
* @param array $config | ||
* @return \Illuminate\Contracts\Queue\Queue | ||
*/ | ||
public function connect(array $config) | ||
{ | ||
$ironConfig = ['token' => $config['token'], 'project_id' => $config['project']]; | ||
|
||
if (isset($config['host'])) { | ||
$ironConfig['host'] = $config['host']; | ||
} | ||
|
||
$iron = new IronMQ($ironConfig); | ||
|
||
if (isset($config['ssl_verifypeer'])) { | ||
$iron->ssl_verifypeer = $config['ssl_verifypeer']; | ||
} | ||
|
||
return new IronQueue($iron, $this->request, $config['queue'], $config['encrypt']); | ||
} | ||
} |
Oops, something went wrong.