Instantly share code, notes, and snippets.

View onename
Verifying that +andreia is my blockchain ID. https://onename.com/andreia
View keybase.md

Keybase proof

I hereby claim:

  • I am andreia on github.
  • I am andreia (https://keybase.io/andreia) on keybase.
  • I have a public key whose fingerprint is 8D20 56C4 04DA 2B8E 3A1F 8B39 18D7 0631 1E7C 0522

To claim this, I am signing this object:

View gist:e11f997cf90195a5cb29
<?php
namespace Acme\DemoBundle\EventSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
/**
* Changes Form->submit() behavior so that it treats not set values as if they
View config.yml
old_sound_rabbit_mq:
connections:
default:
host: 'localhost'
port: 5672
user: 'guest'
password: 'guest'
vhost: '/'
lazy: false
producers:
View services.yml
acme_generate_image_service:
class: Acme\Component\GenerateImageConsumer
arguments:
- @logger
View GenerateImageConsumer.php
<?php
namespace Acme\Component;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface;
use PhpAmqpLib\Message\AMQPMessage;
class GenerateImageConsumer implements ConsumerInterface
{
View services.yml
acme.uploadimage:
class: Acme\Component\UploadImage
arguments:
- @old_sound_rabbit_mq.acme_generate_image_producer
- { generate_folder: "./generated/" }
View UploadImage.php
<?php
namespace Acme\Component;
use OldSound\RabbitMqBundle\RabbitMq\Producer;
class UploadImage
{
protected $options = array();
protected $generateFolder = null;
View DemoController.php
<?php
/**
* @Route("/acme/upload")
*/
public function uploadAction()
{
// realiza algum processamento, recebe o arquivo $file de um formulário, por exemplo
// chama o serviço que faz o upload da imagem
View composer.json
diff --git a/composer.json b/composer.json
index 8f905d7..c2d7588 100644
--- a/composer.json
+++ b/composer.json
@@ -6,18 +6,18 @@
},
"require": {
"php": "&gt;=5.3.3",
- "symfony/symfony": "2.1.*",