Skip to content

Instantly share code, notes, and snippets.

@javiereguiluz
javiereguiluz / gist:a5514ec6cde2a63be441
Last active May 3, 2017 18:21
How to add a deprecation note about Symfony features

In order to generate and log a warning message about a deprecated Symfony feature, use the trigger_error() function as follows:

trigger_error('The enctype method of the form helper was removed. You should use the new method start instead.', E_USER_DEPRECATED);

Please, be as explicit as possible in the deprecation message and always explain the alternative way to use that feature, property, method or class.

@javiereguiluz
javiereguiluz / gist:a66f084a4f2cf11cf0ee
Last active August 27, 2016 17:47
Discussion about the different solutions to display a flash message

The problem to solve

We want to show a flash message as the result of executing some controller. This message will only last for the next request.

Proposed Solution #1

I propose to use the new addFlash() method available in the base controller of Symfony 2.6:

@javiereguiluz
javiereguiluz / WallpaperNotifier.php
Created April 17, 2012 09:15
The winner proposal of the Sismo Challenge programming contest
<?php
namespace Sismo\Contrib;
use Sismo\Notifier\Notifier;
use Sismo\Commit;
/**
* Notifies builds via the wallpaper (Mac only).
*
@javiereguiluz
javiereguiluz / gist:1293646
Created October 17, 2011 20:10
Configuración mínima de Apache2 para un proyecto Symfony2
<VirtualHost *:80>
DocumentRoot "/Users/javier/sf/cupon.local/web"
DirectoryIndex app.php
ServerName cupon.local
<Directory "/Users/javier/sf/cupon.local/web">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>