Skip to content

Commit

Permalink
Merge pull request #27 from trandangtri/2.x
Browse files Browse the repository at this point in the history
Compatible for Symfony 4
  • Loading branch information
trandangtri committed Feb 7, 2018
2 parents 5ed9339 + 5548296 commit ed02e58
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 52 deletions.
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ language: php
php:
- 7.0
- 7.1
env:
- SYMFONY="2.7.*"
- SYMFONY="~3.0"
services:
- elasticsearch
install:
- composer require --no-update symfony/symfony:${SYMFONY}
- 7.2
before_script:
- composer install --no-interaction --prefer-dist
script:
Expand Down
4 changes: 3 additions & 1 deletion DependencyInjection/Compiler/SQSQueuePass.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ public function process(ContainerBuilder $container)
new Reference('tritran.sqs_queue.queue_factory'),
'create'
]
)->setArguments([
)
->setPublic(true)
->setArguments([
$queueName,
$queueOption['queue_url'],
$callable,
Expand Down
44 changes: 38 additions & 6 deletions Resources/config/services.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,54 @@
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<services>
<service id="tritran.sqs_queue.queue_factory" class="TriTran\SqsQueueBundle\Service\QueueFactory">
<argument type="service" id="aws.sqs" />
<argument type="service" id="aws.sqs"/>
</service>

<service id="tritran.sqs_queue.queue_worker" class="TriTran\SqsQueueBundle\Service\BaseWorker">
<service id="tritran.sqs_queue.queue_worker" class="TriTran\SqsQueueBundle\Service\BaseWorker" public="true">
<call method="setLogger">
<argument type="service" id="logger" on-invalid="ignore"/>
</call>
</service>

<service id="tritran.sqs_queue.queue_manager" class="TriTran\SqsQueueBundle\Service\QueueManager">
<argument type="service" id="aws.sqs" />
<service id="tritran.sqs_queue.queue_manager" class="TriTran\SqsQueueBundle\Service\QueueManager" public="true">
<argument type="service" id="aws.sqs"/>
</service>

<service id="tritran.sqs_queue.command.queue_attr" class="TriTran\SqsQueueBundle\Command\QueueAttrCommand">
<tag name="console.command" command="tritran:sqs_queue:attr"/>
</service>

<service id="tritran.sqs_queue.command.queue_create" class="TriTran\SqsQueueBundle\Command\QueueCreateCommand">
<tag name="console.command" command="tritran:sqs_queue:create"/>
</service>

<service id="tritran.sqs_queue.command.queue_delete" class="TriTran\SqsQueueBundle\Command\QueueDeleteCommand">
<tag name="console.command" command="tritran:sqs_queue:delete"/>
</service>

<service id="tritran.sqs_queue.command.queue_list" class="TriTran\SqsQueueBundle\Command\QueueListCommand">
<tag name="console.command" command="tritran:sqs_queue:list"/>
</service>

<service id="tritran.sqs_queue.command.queue_ping" class="TriTran\SqsQueueBundle\Command\QueuePingCommand">
<tag name="console.command" command="tritran:sqs_queue:ping"/>
</service>

<service id="tritran.sqs_queue.command.queue_purge" class="TriTran\SqsQueueBundle\Command\QueuePurgeCommand">
<tag name="console.command" command="tritran:sqs_queue:purge"/>
</service>

<service id="tritran.sqs_queue.command.queue_update" class="TriTran\SqsQueueBundle\Command\QueueUpdateCommand">
<tag name="console.command" command="tritran:sqs_queue:update"/>
</service>

<service id="tritran.sqs_queue.command.queue_worker" class="TriTran\SqsQueueBundle\Command\QueueWorkerCommand">
<tag name="console.command" command="tritran:sqs_queue:worker"/>
</service>

</services>
Expand Down
3 changes: 1 addition & 2 deletions Tests/app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public function registerBundles()
{
return [
new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new \Symfony\Bundle\TwigBundle\TwigBundle(),
new \Aws\Symfony\AwsBundle(),
new \TriTran\SqsQueueBundle\TriTranSqsQueueBundle()
];
Expand All @@ -30,4 +29,4 @@ public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
}
}
}
12 changes: 12 additions & 0 deletions Tests/app/KernelTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace TriTran\SqsQueueBundle\Tests\app;

use AppKernel;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase as SymfonyKernelTestCase;
use Symfony\Component\Console\Application;
Expand Down Expand Up @@ -47,6 +48,17 @@ protected function getContainer($reinitialize = false, array $kernelOptions = []
return $this->container;
}

/**
* @inheritdoc
*/
protected static function createKernel(array $options = [])
{
$kernel = new AppKernel('test', true);
$kernel->boot();

return $kernel;
}

/**
* @param ContainerAwareCommand $command
*
Expand Down
4 changes: 1 addition & 3 deletions Tests/app/config/config_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ framework:
secret: 'secret'
router:
resource: ~
strict_requirements: %kernel.debug%
templating:
engines: ['twig']
strict_requirements: '%kernel.debug%'
test: ~

aws:
Expand Down
75 changes: 43 additions & 32 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,46 @@
{
"name": "tritran/sqs-queue-bundle",
"description": "Simple SQS Queue for Symfony",
"type": "symfony-bundle",
"homepage": "http://www.ideason.vn",
"license": "MIT",
"authors": [
{
"name": "Tri D. Tran",
"homepage": "http://www.ideason.vn"
}
],
"require": {
"php": ">=5.5",
"symfony/symfony": "~2.7|~3.0",
"aws/aws-sdk-php-symfony": "~1.0"
},
"require-dev": {
"symfony/monolog-bundle": "~2.5",
"symfony/monolog-bridge": "~2.4",
"phpunit/phpunit": "6.0.*",
"phpmd/phpmd": "2.6.*",
"squizlabs/php_codesniffer": "^3.0"
},
"suggest": {
},
"autoload": {
"psr-4": {
"TriTran\\SqsQueueBundle\\": ""
"name": "tritran/sqs-queue-bundle",
"description": "Simple SQS Queue for Symfony",
"type": "symfony-bundle",
"homepage": "http://www.ideason.vn",
"license": "MIT",
"authors": [
{
"name": "Tri D. Tran",
"homepage": "http://www.ideason.vn"
}
],
"require": {
"php": ">=7.0.0",
"symfony/dependency-injection": "~2.7|~3.3|~4.0",
"symfony/config": "~2.8|~3.3|~4.0",
"symfony/console": "~2.7|~3.3|~4.0",
"aws/aws-sdk-php-symfony": "~2.0"
},
"require-dev": {
"symfony/framework-bundle": "~2.3|~3.0|~4.0",
"symfony/yaml": "~2.3|~3.0|~4.0",
"phpunit/phpunit": "6.0.*",
"phpmd/phpmd": "2.6.*",
"squizlabs/php_codesniffer": "^3.0"
},
"suggest": {
},
"exclude-from-classmap": [
"/Tests/"
]
}
"autoload": {
"psr-4": {
"TriTran\\SqsQueueBundle\\": ""
},
"exclude-from-classmap": [
"/Tests/app/cache/",
"/Tests/app/logs/"
]
},
"autoload-dev": {
"psr-4": {
"TriTran\\SqsQueueBundle\\": "Tests/"
},
"classmap": [
"Tests/app"
]
}
}
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</testsuites>

<php>
<server name="KERNEL_DIR" value="Tests/app/" />
<env name="KERNEL_CLASS" value="Tests/app/AppKernel"/>
</php>

<filter>
Expand Down

0 comments on commit ed02e58

Please sign in to comment.