Technical blog of COil: Symfony, PHP, PEAR & webdev

» Collapse all «

Tag - plugin


Wednesday 5 October 2011

symfony1 sfTCPDFPlugin 1-6-3 released

Last week I also released the 1.6.3 version of the sfTCPDFPlugin. It is just of small update to check that it works without problem with the last TCPDF library which is actually at version 5_9_120 (2011-09-22). (Note that the release strategy of this library is very fast with a lot of minor versions). You can check the CHANGELOG here.


PS: There is now more than 100 registered users for this plugin ! :)

See you. COil :)

Thursday 29 September 2011

symfony1 sfTaskLoggerPlugin 1-0-3 released

Last week I released the 1.0.3 version of the sfTaskLoggerPlugin. It corrects several bugs and adds several features. The main improvement of this version is that it is bundled with a fully customized Doctrine admin generator module in order to manage and check the tasks launched by the plugin. You can check the changelog here. I hope that with this version the plugin will overtake the huge number of registered users of 8 ! :D


PS : Note that there is a bug in the partial that shows the task total length, use the svn trunk (which is actually stable et revision 33110) if you want to correct it.

See you. COil :)

Monday 11 April 2011

sfMyPlugins, 2 years later

Well, 2 years have passed since my post: "Writing symfony plugins is great... maintaining them is better !". I followed my own advices and all my plugins where updated for symfony 1.4 which will be the last major version of the 1.x branch. Now let's see how things evolved since 2 years:


  • User counts: 11 (+8 users since 12 apr 2009)
  • Available for: sf 1.4, 1.3, 1.2
  • Users feedbacks: 0
  • I like and use the sfDB4toPropelPlugin !
  • Want the Symfony2 bundle ? Send me an email ! ^^

I must admit I don't use this plugin any more. Because most of people are using Doctrine as it is the recommended ORM for symfony now. But it can be useful for a small project. I didn't had feedbacks about it, it just "do the job" as it should. (It's very stable because it was extensively used for 2 big 1.0 projects)


  • User counts: 55 (+39 users since 12 apr 2009)
  • Available for: sf 1.4, 1.3, 1.2, 1.1, 1.0
  • Users feedbacks: 1
  • I like and use the sfLightboxPlugin !

It's probably the most useless of my plugin, but I think it is used because it is well documented, very easy to use and available for all symfony major versions.


  • User counts: 93 (+84 users since 12 apr 2009)
  • Available for: 1.4, 1.3, 1.2
  • Users feedbacks: 4
  • I like and use the sfTCPDFPlugin !

This plugin had a very nice users boost since its creation, its my most popular plugin. Therefore I suppose that it works quiet well. :) It allows to avoid dealing with the unfriendly TCPDF constants with a help of a multi-configurations YAML file.


  • User counts: 8
  • Available for: 1.4, 1.3, 1.2, 1.1
  • Users feedbacks: 3
  • I like and use the sfTaskLoggerPlugin !

Even I think this is the most useful plugin I have done, it is also the most unpopular. It may be due to the large amount of plugins already dealing with tasks, crons, jobs-queues and so on... sfDoctrineCronManagerPlugin, axCronPlugin, sfMCronPlugin, sfJobQueuePlugin, sfGearmanPlugin. I must admit I didn't tried the others as mine fits my needs and the ones of the companies I worked for until now.


  • User counts: 27 (+27 users since 7 jan 2011)
  • Available for: 1.4, 1.3, 1.2
  • Users feedbacks: 7
  • I like and use the sfProjectAnalyserPlugin !

This is my last plugin (well "our" plugin as I was not the only to contribute, thanks to all the contributors !) This is probably the most interesting as people where quiet curious about it and we had quiet a lot of positive feedbacks. What is it for ?

The sfProjectAnalyserPlugin allows you to analyse your symfony project, it can raise several coding standards alerts. A YAML configuration file allows you to switch what to analyse and also allows you to parameter threshold for each alert. This plugin can be helpful in mainly two situations:

  • You quickly want to check the volumetry and code quality of a symfony project your are going to maintain.
  • While developing a project from scratch, as a continuous integration tool, to ensure that as the project grows, you keep on following the symfony coding standards you defined at the very beginning of your project.

Others plugins

  • RIP: sfJoomla15BridgePlugin, I gave the leadership of this plugin to another developer (but there is no more activity).
  • RIP: sfWorkbenchPlugin: The XML structure of the generated WB schema was quiet hard to parse and I didn't find time to finish its proof of concept. Nevertheless, I would be glad if someone could take over this plugin. It could be very useful and used by many "lazy" developers (Well like me !) :p

That's 208 "regular" users for all these plugins, which is quiet a good score. I think my "symfony1 plugin developer career" is now over. I hope they have been useful for some of you. Obviously I will continue to maintain theme if big bugs were discovered. But don't except major new features. And now let's publish my first Symfony2 "bundle". ^^

Sunday 3 May 2009

sfTCPDFPlugin v1.6.1 released

This new release for symfony 1.2 is quiet interesting as it introduces a new custom configuration handler witch allows you to manage all the TCPDF constants through YAML files and you can also manage multiple configurations. If you are using the plugin don't forget to use the "I USE AND LIKE THIS PLUGIN" on the symfony plugin website. ^^


  • Corrected config loader
  • Converted README to Markdown syntax
  • Added a method to get the final TCPDF configuration
  • New plugin configuration handler that allows you to use multiple configugurations for different actions and pdf
  • Reorganized svn structure of the plugin, created 1.0, 1.1 and 1.2 branch
  • New version for symfony 1.2

Sunday 12 April 2009

Writing symfony plugins is great... maintaining them is better !

Wow, that's quiet a long time i didn't blogged !! Let see if i can write something interesting ! :) As you have probably noticed, the symfony plugin count has recently reached the 500. This is really huge ! To celebrate this, Fabien has added an interesting functionality "I use this plugin" which allows you to tell the plugins you use in yours projects. This "plugin users count" will show which are used and work, so you don't have to waste time on a plugin which does not work at all... Like the sfNadaPlugin... :p Moreover i think there will be another good side effect of this new functionality, is to encourage the plugins authors to update their plugin more frequently or to convert them for the different major versions of symfony. That's what i did the last week.



sDB4toPropelPlugin is a plugin that adds to symfony a new task: propel:db4-to-propel that allows you to convert a DB4 schema (a DBDesigner4 schema) into a valid Propel schema.yml file, with this plugin you can just forget the boring work of building your schema.yml by hand. ;)
This is probably the most interesting of my plugins and i am quiet surprised there is only 3 guys who use it :/ (including me). The last interesting functionality that was added with the 1.0.3 version is that you can declare tables as "external", that means that inside your DB4 schema you can make links to plugins tables, like sf_guard_user. This is very practical, i used it since more than 2 years (the 1.0 and 1.1 versions were never published) so that why i am quiet surprised this plugin doesn't have more success... Perhaps it just get lost among the 500 others. ;) If you use and like this plugin and want to help me in giving it more visibility on the symfony website, click on the following link :D


I will start soon the development of the worthy successor of this plugin, the sfWorkbenchPlugin, any help will be welcome ! :) This time i'd like to make the plugin Propel and Doctrine friendly, which would be very interesting for all symfony users.



sfLightboxPlugin is a symfony plugin that provides an easy to use wrapper for the Lightbox2 javascript library.



The sfTCPDFPlugin provides abstraction for the TCPDF library. The main interest of this FPDF "fork" resides in the fact that it handles any UTF8 strings which the native encoding format used by symfony.

I have just updated this plugin, this new version for symfony 1.2 introduces a new interesting functionality , it's a handy config handler to manage several TCPDF configurations with a YAML file, so you don't have to set the TCPDF constants. So this version is far more practical that the old one.



This was an experimental plugin, but i shamefully abandoned it... But there's a reason; it's because this old plugin was for symfony 1.0 and the old Joomla 1.0 version. Now there is a new plugin the sfJoomla15BridgePlugin for symfony 1.2 and Joomla 1.5.x which is based on my previous code, so i have joined the dev team of this plugin. Even if have abandoned the plugin i have updated its description to invite the users not to use this one but the new one, so they don't waste their time on it. (i have received several mails about it from users who didn't saw the new 1.5 plugin... :x)


I already have several ideas for my next plugins. One that was never published and one about tests... But this will be part of another post. I wish i could find some time to post a little more frequently.

  • You can find all my plugins here

See you. symfoniquement votre. ++ COil :)

Sunday 7 December 2008

Jobeet: An alternative tutorial for Day 3

Hi symfonians ! ^^

Well, i didn't post very often during these last months. So let's try to write something interesting. In this post i will show you an alternative way to build your database with symfony, propel and the DB4 tool. This tutorial is not really an "alternative" to the official tutorial. :) Let's say that we will just see another way to build our database, i won't be as exhaustive as Fabien did in the Jobeet Day 3 tutorial, therefore, for all details please refer to the official Jobeet tutorial.


  • Having done at least day 1 and 2 of the Jobeet tutorial. (or you already know symfony, in this case you will need a fresh symfony 1.2 project)
  • Not being too angry with Propel :p

What you will learn:

  • Using the sfDB4toPropelPlugin to build your schema.yml without writing a single line of this file.

What you will NOT learn:

  • How wonderful symfony is. For this, read the official Jobeet tutorial of Fabien. :)

So let's go... We will start at this part of the Jobeet 3 tutorial.


1 - Plugin installation

First we will install the sfDB4toPropel plugin, i did not released any package for the symfony 1.2 version yet, so we will install it via SVN. (edit: i've just released the 1.0.2 version for sf 1.2.0)

   $ cd plugins
   $ mkdir sfDB4toPropelPlugin
   $ cd sfDB4toPropelPlugin
   $ svn co

Be careful not to check out the root of the plugin but the branch related to the symfony version you want to use, actually 1.1 or 1.2)

(PS: You can also set an svn external to the plugin if your project already uses a svn repository)


Continue reading...

Thursday 3 April 2008

symfony 1.0 tutorial : Extending the admin generator

[En] Tutorial content:

  • Creating a plugin with a custom admin generator theme
  • Extending the sfActions class
  • Extending the sfPropelAdminGenerator class

Here is little contribution for the symfony code sprint, a symfony tutorial about the admin generator. :) Do you know about it ? I think it's one of my favourite symfony tool, i have developed several applications with symfony and for 75% of them i have made a custom admin generator theme. And as said in the symfony documentation, the admin generator is very very very powerful. ;)
In this tutorial we will see a concrete example on how to extend it to provide a useful new feature. Witch feature ? Well it was one of the things a customer asked me, "I want to be able to delete several rows at a time with check boxes" ... Ahhhhh indeed, it's not a native feature of the admin generator. So.... let's do it... :)

::: Pre-requisite :::

Well i will not explain here how to install symfony as there are lots of tutorials about this on the symfony website and in the wiki. So i will assume you have a clean symfony installation so you can type the symfony command in cli. I used the 1.0.13 version for this tutorial.

::: Creating and setting a new project :::

:: Creating the new project ::

First we will create the new project that we will call tutorial, create a new folder tutorial and launch the init-project task into it.

symfony init-project tutorial

Now let's create the backend application:

symfony init-app backend

As it is always better to have a submain for our application add the following in you apache httpd.conf file and change it with your own path

## COil symfony tutorial n°1 : Extending the admin generator ##

<VirtualHost *:80>
  DocumentRoot "C:\wamp\www\tutorial\web"
  DirectoryIndex index.php
  Alias /sf "c:\wamp\bin\php\php5.2.5\PEAR\data\symfony\web\sf"
  <Directory "C:\wamp\www\tutorial\web">
    AllowOverride All

Add the sub-domain in you hosts file:

Ok, at this point we should have our "Project created!" page. So Let's try to browse


:: The database ::

Create a local database, let's call it tutorial again. (same as the project name)
Modify the database settings in the config/database.yml and config/propel.ini file, your database.yml file should look like this:

    class:          sfPropelDatabase
      dsn:          mysql://root@localhost/tutorial

Now we need a schema, let's take the one of Askeet

Ok now let's try to build the database:

symfony.bat propel-build-all-load backend

Oops, it seems there are some errors. :) As we are quite lazy just delete the password columns and the QuestionTag section of the /datas/fixtures/test_data.yml file.
Let's try again to run the last command. If your are successful you should now have some tables and data in your tutorial database. If not, you probably missed something. ;) At this point we have a valid application with a database, some tables and fixtures. Settings are ok, so can go to the next step.


Continue reading...

Tuesday 18 March 2008

Symfony 1.0 tip : Registration of plugin routes

[En] Here is a little tip Fabien gave me. I am actually developing a plugin witch has quiet a lot of routes (about 40). Normally you can add the routes with the prependRoute function, like does the sfGuardplugin.

if (sfConfig::get('app_sf_guard_plugin_routes_register', true) && in_array('sfGuardAuth', sfConfig::get('sf_enabled_modules', array())))
  $r = sfRouting::getInstance();
  // preprend our routes
  $r->prependRoute('sf_guard_signin', '/login', array('module' => 'sfGuardAuth', 'action' => 'signin'));
  $r->prependRoute('sf_guard_signout', '/logout', array('module' => 'sfGuardAuth', 'action' => 'signout'));
  $r->prependRoute('sf_guard_password', '/request_password', array('module' => 'sfGuardAuth', 'action' => 'password'));

But for each prependRoute call an array_merge is done on all existing routes.

   * Adds a new route at the beginning of the current list of routes.
   * @see connect
  public function prependRoute($name, $route, $default = array(), $requirements = array())
    $routes = $this->routes;
    $this->routes = array();
    $newroutes = $this->connect($name, $route, $default, $requirements);
    $this->routes = array_merge($newroutes, $routes);

    return $this->routes;

So the tip here is to save all routes, clear them, add the routes of the plugin and then append the saved routes. Witch can be done like this:

  // Save and clear all routes
  $r = sfRouting::getInstance();
  $routes = $r->getRoutes();
  // Plugin home
  $r->connect('plugin_home', '/my_super_plugin/homepage', array(
    'module' => 'my_plugin_module', 
    'action' => 'my_plugin_action',
    'additional_parameter'   => 1

  // Another route
  $r->connect('plugin_home', '/my_super_plugin/section1', array(
    'module' => 'my_plugin_module', 
    'action' => 'my_plugin_action_section1',
    'additional_parameter'   => 2

  // ... other routes

  // Then merge new routes with the saved one
  $r->setRoutes($r->getRoutes() + $routes);

That's it. :) Of course it is always better to have all routes of the application in the routing.yml but in my case it was not possible.

Sunday 2 March 2008

sfLightboxPlugin 1.0.6

[En] New version with the last version of lightbox (2.03.3) + new helpers. You can check the demo here on my blog.

  • Updated lightbox library to v2.03.3
  • 3 new helpers (light_image_text, light_slide_image, light_slide_text)
  • New parameter for images slideshows to allow to display images as a html list (li..)
  • Slideshow navigation with the keyboard (left, right, ESC)

Thanks for your feedback ! Enjoy. :)

[Fr] Nouvelle version incluant la dernière version de lightbox (2.03.3) et quelques nouveaux helpers. Vous pouvez visualiser la demo ici sur mon blog.

  • Mise à jour de la librairie lightbox pour la version v2.03.3
  • 3 nouveaux helpers (light_image_text, light_slide_image, light_slide_text)
  • Nouveau paramètre pour les slideshows pour afficher les images comme une liste html (li..)
  • Navigation dans le slideshow à l'aide du clavier (gauche, droite, ESC)

Merci pour votre feedback ! Enjoy. :)

sfLightboxPlugin 1.0.6

Tuesday 12 June 2007

Plugins, plugins and (sf) plugins

[EN] Translation coming soon (edit 19/07: too lazy to do the translation)

[FR] Pas mal de mouvements ces derniers temps dans la section, on compte pas moins de 80 plugins désormais et on se rapproche de la barre fatidique des 100, c'est vraiment excellent pour le framework et lui donne une richesse certaine. On y trouve vraiment de tout, de la série de plugin sur propel qui permettent d'ajouter à cet ORM des fonctionnalités comme l'audit d'objet, la gestion d'arbre... aux plugins plus farfelus qui permettent de gérer des smileys ou qui permettent l'intégration de librairies javascript externes, ou encore qui permettent de s'interfacer avec d'autres applications PHP (sfGallery2Plugin...) Le mieux étant encore d'aller sur le wiki pour dénicher ceux qui pourront vous être utiles... Quant à mes plugins, ils se portent plutôt bien !

  • sfLightboxPlugin en est à la version 1.0.5, la prochaine publication 1.1.0 sera faite par Demental et incluera donc comme le numéro de version le laisse entendre, de nouvelles fonctionnalités. Stay tuned ! ;)
  • sfTCPDFPlugin à été mis à jour par fred, qui a corrigé les bugs, rendu le plugin customisable, corrigé et mis à jour l'exemple complet de la librairie TCPDF. C'est vraiment cool de voir son travail repris, amélioré et publié par quelqu'un d'autre. Mais c'est le principe même de l'open source n'est-ce pas ? :)
  • sfJoomlaPlugin lui au contraire est en train de tomber aux oubliettes... Quelques personnes s'y étaient intéressé mais depuis plus grand chose, il est vrai que d'interfacer un framework et un CMS aussi "fouilli" ( ;) ) que Joomla reste une idée assez marginale... Enfin il a le mérite d'exister, si ça peut/a pu servir à quelqu'un... :)

- page 1 of 2