Par un détour à Yoda

{ }

recherche

Aller au contenu | Aller au menu | Aller à la recherche

Coding

Symfony2 and Doctrine: Print sql queries

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

[Symfony] Coupling sfDoctrineGuardPlugin

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

Symfony - Doctrine: Use a fully UTF8

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

Doctrine: Howto bypass the SoftDelete

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

Notify: New release of the aMSN plugin

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

PHP bench: count + for vs foreach vs

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

Symfony: Validate fields depending of

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

Symfony: change the default type of your

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

Symfony, tasks and return values

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

[Symfony] Overwrite a value in a form

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

[Symfony] Load an sql dump within a task

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

[PHP] Pensez à STDClass

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

My first plugin for symfony

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

MPD Remote control script v0.2

Here is a new version of my console mpd remote script.... lire la suite

Recomposer un HTML valide après l'avoir

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

Notify plugin for aMSN updated (1.3)

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

MPD Remote control script

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

Plugin Notify for aMSN

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

Developer toolbar for Internet Explorer

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

Javascript (Bon à savoir)

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

- page 1 de 2