Skip to content

Commit fc5180a

Browse files
authored
Add enqueue and alpine (#7)
Add enqueue and alpine
1 parent 30a20db commit fc5180a

30 files changed

+2471
-1352
lines changed

.env.dist

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ DATABASE_NAME=webhooks
77
DATABASE_USER=webhooks
88
DATABASE_PASSWORD=webhooks
99

10-
RABBITMQ_HOST=rabbit
11-
RABBITMQ_PORT=5672
12-
RABBITMQ_USER=guest
13-
RABBITMQ_PASSWORD=guest
14-
RABBITMQ_VIRTUAL_HOST=/
10+
RABBITMQ_DSN=amqp://guest:guest@rabbit:5672/
1511

1612
SYMFONY_SECRET=yHSmQvobci6RyGVRRCZDYzEqVCpvnMkI+i59buP8PwI=

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ language: php
66

77
cache:
88
- vendor
9+
910
php:
10-
- '7.0'
1111
- '7.1'
1212

1313
before_script:
14-
- composer install -o
14+
- composer install -o --ignore-platform-reqs
1515

1616
after_script:
1717
- |
18-
if [ $TRAVIS_PHP_VERSION = '7.0' ]; then
18+
if [ $TRAVIS_PHP_VERSION = '7.1' ]; then
1919
travis_retry wget https://scrutinizer-ci.com/ocular.phar
2020
php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
2121
fi
@@ -26,4 +26,4 @@ install:
2626
- export PATH="$HOME/.composer/vendor/bin:$PATH"
2727
- travis_retry composer self-update && composer --version
2828

29-
script: phpunit --configuration phpunit.xml
29+
script: phpunit --configuration phpunit.xml

app/AppKernel.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,18 @@ public function registerBundles()
1414
new Symfony\Bundle\MonologBundle\MonologBundle(),
1515
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
1616
new Webhook\Bundle\WebhookBundle(),
17+
18+
/** Third party bundles */
1719
new Nelmio\CorsBundle\NelmioCorsBundle(),
20+
new Enqueue\Bundle\EnqueueBundle(),
1821
];
1922

2023
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
2124
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
2225
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
2326
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
2427
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
28+
$bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
2529
}
2630

2731
return $bundles;

app/config/config.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,12 @@ nelmio_cors:
6262
allow_headers: "*"
6363
allow_methods: ['PATCH', 'POST', 'PUT', 'GET', 'DELETE', 'OPTIONS']
6464
max_age: 3600
65+
66+
enqueue:
67+
client:
68+
app_name: "webhooks"
69+
transport:
70+
default: 'rabbitmq_amqp'
71+
rabbitmq_amqp:
72+
dsn: '%rabbitmq_dsn%'
73+
delay_strategy: 'dlx'

app/config/config_dev.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ framework:
55
router:
66
resource: '%kernel.root_dir%/config/routing_dev.yml'
77
strict_requirements: true
8-
8+
9+
enqueue:
10+
client:
11+
traceable_producer: true
12+
913
monolog:
1014
handlers:
1115
main:

app/config/parameters.yml.dist

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,4 @@ parameters:
1010

1111
secret: "%env(SYMFONY_SECRET)%"
1212

13-
rabbitmq_host: "%env(RABBITMQ_HOST)%"
14-
rabbitmq_port: "%env(RABBITMQ_PORT)%"
15-
rabbitmq_user: "%env(RABBITMQ_USER)%"
16-
rabbitmq_password: "%env(RABBITMQ_PASSWORD)%"
17-
rabbitmq_virtual_host: "%env(RABBITMQ_VIRTUAL_HOST)%"
13+
rabbitmq_dsn: "%env(RABBITMQ_DSN)%"

bin/symfony_requirements

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env php
22
<?php
33

4-
require_once dirname(__FILE__).'/./SymfonyRequirements.php';
4+
require_once dirname(__FILE__).'/../var/SymfonyRequirements.php';
55

66
$lineSize = 70;
77
$symfonyRequirements = new SymfonyRequirements();

composer.json

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"require": {
3-
"php": ">=7.0",
4-
"bunny/bunny": "^0.2.4",
3+
"php": ">=7.1",
54
"doctrine/doctrine-bundle": "^1.6",
65
"doctrine/doctrine-cache-bundle": "^1.2",
76
"doctrine/orm": "^2.5",
@@ -13,10 +12,18 @@
1312
"php-http/message": "^1.5",
1413
"ramsey/uuid": "^3.5",
1514
"sensio/distribution-bundle": "^5.0",
16-
"symfony/monolog-bundle": "^3.0.2",
17-
"symfony/polyfill-apcu": "^1.0",
15+
"sensio/framework-extra-bundle": "^3.0",
16+
"symfony/monolog-bundle": "^3.0",
1817
"symfony/symfony": "^3.3",
19-
"twig/twig": "^1.0||^2.0"
18+
"symfony/polyfill-apcu": "^1.0",
19+
"enqueue/enqueue-bundle": "^0.7",
20+
"enqueue/amqp-ext": "^0.7",
21+
"php-amqplib/php-amqplib": "^2.6",
22+
"enqueue/enqueue": "^0.7",
23+
"twig/twig": "^1.0||^2.0",
24+
"php-pm/php-pm": "dev-master",
25+
"php-pm/httpkernel-adapter": "dev-master",
26+
"react/http": "dev-master#cd15204bd15d106d7832c680e4fb0ca0ce2f5e30"
2027
},
2128
"autoload": {
2229
"psr-4": {
@@ -55,12 +62,6 @@
5562
"@symfony-scripts"
5663
]
5764
},
58-
"config": {
59-
"platform": {
60-
"php": "7.0"
61-
},
62-
"sort-packages": true
63-
},
6465
"extra": {
6566
"symfony-app-dir": "app",
6667
"symfony-bin-dir": "bin",
@@ -70,6 +71,9 @@
7071
"symfony-assets-install": "relative",
7172
"incenteev-parameters": {
7273
"file": "app/config/parameters.yml"
74+
},
75+
"branch-alias": {
76+
"dev-master": "3.2-dev"
7377
}
7478
}
7579
}

0 commit comments

Comments
 (0)