Skip to content

Instantly share code, notes, and snippets.

View bpolaszek's full-sized avatar

Beno!t POLASZEK bpolaszek

View GitHub Profile
@bpolaszek
bpolaszek / check-environment-variables.php
Last active November 5, 2018 11:15
Check that all environment variables defined in your .env.dist are properly set.
#!/usr/bin/env php
<?php
/**
* Checks that all environment variables are set before deploying.
*
* @author Beno!t POLASZEK - 2018
* @link https://gist.github.com/bpolaszek/559dbc341dec51303fc0dea8162cf735#gistcomment-2747882
*/
@bpolaszek
bpolaszek / CleanAssociationsTrait.php
Created September 24, 2015 09:43
Doctrine : Fix ManyToOne relationships when the value in database is 0 instead of NULL
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Event\LifecycleEventArgs;
/**
* Trait CleanAssociationsTrait
*
* This trait is intended to fix the Doctrine ManyToOne relationships when the stored value in database is a 0 instead of NULL.
* Sometimes you plug Doctrine on an existing database without foreign key support.