Skip to content

Instantly share code, notes, and snippets.

View ahmed-bhs's full-sized avatar
👽

Ahmed EBEN HASSINE 脳の流れ ahmed-bhs

👽
View GitHub Profile
framework:
messenger:
transports:
amqp: '%env(MESSENGER_TRANSPORT_DSN)%'
routing:
'App\Message\SendNotification': amqp
[unix_http_server]
file=/tmp/supervisor.sock
[supervisord]
logfile=/tmp/supervisord.log
pidfile=/var/run/supervisord.pid
nodaemon=true
[program:php-fpm]
command = /usr/local/sbin/php-fpm
#config.yml
swiftmailer:
url: '%env(MAILER_URL)%'
# spool: ~
#.env
MAILER_URL=smtp://maildev:25
# .env
ENQUEUE_DSN=sqs:?secret=[AWSSecretKey]&key=[AWSAccessKey]region=[region]
# messenger.yml
framework:
messenger:
transports:
sqs: enqueue://default?&topic[name]=test&queue[name]=test
routing:
'App\Message\SendNotification': sqs
#.env
ENQUEUE_DSN=redis://redis:6379
127.0.0.1:6379> KEYS *
1) "messages"
127.0.0.1:6379> lrange messages 0 -1 `
https://www.immigration.interieur.gouv.fr/fr/Info-ressources/Demarches/Formulaires-Cerfa/Les-travailleurs-etrangers/Formulaire-n-15187-1-Demande-d-autorisation-de-travail-pour-conclure-un-contrat-de-travail-avec-un-salarie-etranger-residant-hors-de-France
@ahmed-bhs
ahmed-bhs / 1.php
Last active October 6, 2018 19:20
<?php
protected function getContainerExtensionClass()
{
$basename = preg_replace('/Bundle$/', '', $this->getName());
return $this->getNamespace().'\\DependencyInjection\\'.$basename.'Extension';
}
@ahmed-bhs
ahmed-bhs / 2.php
Last active October 6, 2018 19:20
<?php
//AppKernel.php
class AppKernel extends Kernel
{
//...
protected function build(ContainerBuilder $container)
{
$container->registerExtension(new \Portal\Common\Infrastructure\Symfony\DependencyInjection\AppExtension());
<?php
// portal/src/Symfony
# could have been portal/src/Portal/Common/Infrastructure/Symfony but I got lazy
namespace Portal\Common\Infrastructure\Symfony;
use Portal\Common\Infrastructure\Symfony\DependencyInjection\AppContextExtension;
use Symfony\Component\HttpKernel\Bundle\Bundle;
# I suppose SymfonyBundle might be a better name
class PortalBundle extends Bundle