Coding
dimanche, août 21 2011, 13:31 :: Coding
For debugging purposes, it's sometimes usefull to print the queries executed by a Symfony2 Command. Here is my tiny piece of code to do it. protected function execute(InputInterface $input, OutputInterface $output) { //...
lire la suite
samedi, mai 7 2011, 14:06 :: Coding
Recently I created a quite sensible application using symfony 1.4. As many people, I chose sfDoctrineGuardPlugin as authentication/password recovery/account managing system. But even with this piece of software, you are...
lire la suite
lundi, juillet 19 2010, 15:16 :: Coding
First, edit your config/databases.yml and add : [yml] all: doctrine: class: sfDoctrineDatabase param: dsn: mysql:socket=/var/run/mysqld/mysqld.sock;dbname=mydb username: mydb password: mypassword encoding: utf8...
lire la suite
mardi, avril 6 2010, 18:06 :: Coding
For one of my projects I have to check if a record already exists in my database, deleted or not. The preDqlSelect looks like this : /** * Implement preDqlSelect() hook and add the deleted flag to all queries for which...
lire la suite
vendredi, mars 19 2010, 08:29 :: Coding
A new release of the Notify plugin for aMSN is now available. You can download it on http://www.amsn-project.net/plugins.... Changelog: Fix UTF8 detection, thanks to bardo Version 1.5...
lire la suite
jeudi, février 4 2010, 14:14 :: Coding
I tested different loops. Here is my test script : ┌─(yoda@ev5)(14:32:05) └─(~/var/www/test)-> cat for_foreach_while.php #!/usr/bin/php
lire la suite
mercredi, février 3 2010, 14:03 :: Coding
It's possible, when validating a form, to check if a field is correct dependently of an other field's value. First, in your configure method, after the declaration of your validators, add :...
lire la suite
mercredi, janvier 20 2010, 19:24 :: Coding
Hey, yes it's possible to change the default type of your primary keys with a simple configuration Open your config/databases.yml. It should looks like this : [yml] # You can find more information about this file on the...
lire la suite
mercredi, décembre 2 2009, 10:03 :: Coding
In symfony, it's possible to return a value in your execute() method. Let's create a test task : ┌─(yoda@box)(09:46:59) └─(~/var/www/test)-> ./symfony generate:task test >> task Creating...
lire la suite
lundi, novembre 30 2009, 13:41 :: Coding
It happen sometimes that you have to set/override a value within a form but without using a hidden field (that can be overridden) Here is a short solution to set the user id in the object we are going to save. Let's say...
lire la suite
lundi, novembre 30 2009, 13:21 :: Coding
I recently had a problem when loading fixtures in my symfony project. I was loading cities, about 37 000 of them, and the doctrine:data-load was extremly slow (about 5 minutes). I finally found a solution to load an sql...
lire la suite
mardi, août 4 2009, 14:24 :: Coding
Il arrive souvent qu'on ai besoin de retourner plusieurs informations distinctes dans une fonction ou une méthode. La plupart du temps, il suffit de retourner un tableau indexé de manière intelligente. class CSS { public...
lire la suite
samedi, juillet 11 2009, 14:13 :: Coding
Hey, I just uploaded my first plugin for symfony ! This plugin is a simple wrapper for a jQuery Carousel found at http://sorgalla.com/projects/jcarousel/...
lire la suite
lundi, décembre 8 2008, 20:04 :: Coding
Here is a new version of my console mpd remote script....
lire la suite
samedi, décembre 6 2008, 18:21 :: Coding
Récemment, je me suis occupé de la création d'un site web tout joli tout beau, dans lequel les webmasters peuvent composer certaines parties de leur site web via un éditeur online wysiwyg. Mais à certains endroits,...
lire la suite
dimanche, octobre 19 2008, 15:22 :: Coding
New version of my notify plugin for aMSN Changelog: Added "dash hack" : http://www.amsn-project.net/forums/viewtopic.php?t=5847, thanks to nico@nc Re-enable sounds on events:...
lire la suite
jeudi, août 21 2008, 11:53 :: Coding
Hey, i'm still looking for my best audio player. At the moment i'm testing MPD with Sonata as Front-end. Unfortunately, mpd doesn't come with a remote controle system that can be used with my Logitech keyboard. So I...
lire la suite
samedi, mai 10 2008, 14:32 :: Coding
Here is a new version of my plugin called Notify. Changelog : I was using wrong aMSN's preferences Fixed when the header is empty (setting "aMSN") This plugin replace aMSN's own notification system by using libnotify. It...
lire la suite
jeudi, mai 8 2008, 15:11 :: Coding
I'm currently making a website with a complicated design. I use to play with Firebug to controle layers placement, to trace unwanted margins and so many strange html behaviors. But ... Internet Explorer is a crappy piece...
lire la suite
mardi, mars 25 2008, 15:02 :: Coding
J'avais écrit un code du genre pour afficher/cacher un div à la con : function toggleVis(pDiv) { item = document.getelementbyid(pDiv); if(item.style.display == "none") { item.style.display = "block"; return true; }...
lire la suite