<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://mirmodynamics.com/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>Mirmo Dynamics</title>
  <link>http://mirmodynamics.com/</link>
  <atom:link href="http://mirmodynamics.com/feed/rss2" rel="self" type="application/rss+xml"/>
  <description>Si tu kiffes pas reunoi, t'écoutes pas et puis c'est tout.</description>
  <language>en</language>
  <pubDate>Wed, 01 Jul 2009 17:32:25 +0200</pubDate>
  <copyright>2003-2009 &amp;copy; Geoffrey Bachelet</copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Help Symfony: fix one bug per day and win some gifts !</title>
    <link>http://mirmodynamics.com/post/2009/07/01/Help-Symfony%3A-fix-one-bug-per-day-and-win-some-gifts-%21</link>
    <guid isPermaLink="false">urn:md5:601fa602193a596a65fe14b912586ba1</guid>
    <pubDate>Wed, 01 Jul 2009 19:31:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Geekeries</category>
        <category>1day1ticket</category><category>symfony</category>    
    <description>    &lt;p&gt;Today is the first day of the &amp;quot;1 day / 1 ticket&amp;quot; Symfony event.&lt;/p&gt;


&lt;p&gt;Starting from today, each ticket you close (or help closing) from &lt;a href=&quot;http://trac.symfony-project.org/wiki/1day1ticket&quot;&gt;this list&lt;/a&gt; by either submitting a patch, submitting unit tests, etc will earn you points. At the end of the month, gifts are attributed to people with the most points.&lt;/p&gt;


&lt;p&gt;This is a fun and exciting way to help your (hopefuly) favorite opensource project ;)&lt;/p&gt;


&lt;p&gt;For more details on rules, please &lt;a href=&quot;http://trac.symfony-project.org/wiki/1day1ticket&quot;&gt;see the official page&lt;/a&gt;.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/07/01/Help-Symfony%3A-fix-one-bug-per-day-and-win-some-gifts-%21#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/07/01/Help-Symfony%3A-fix-one-bug-per-day-and-win-some-gifts-%21#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1197</wfw:commentRss>
      </item>
    
  <item>
    <title>subversion, tags and externals</title>
    <link>http://mirmodynamics.com/post/2009/06/15/subversion%2C-tags-and-externals</link>
    <guid isPermaLink="false">urn:md5:ae722a347e5f29838f36f81c6dd904cf</guid>
    <pubDate>Mon, 15 Jun 2009 16:14:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Geekeries</category>
        <category>fail</category><category>git</category><category>svn</category><category>tags</category>    
    <description>    &lt;p&gt;It's been brought to my attention today (by my fellow developper &lt;a href=&quot;http://dakrazy.net/&quot;&gt;hartym&lt;/a&gt;) that there is a HUGE problem with tags in subversion.&lt;/p&gt;


&lt;p&gt;The problem is very simple, when you create a tag for your project, and that your project uses &lt;code&gt;svn:externals&lt;/code&gt; (quite a common situation), externals in the tags ARE NOT FROZEN. Which means that, if you checkout your tag at a T time, and an external gets modified at T+x, a checkout at T+x will not be the same than the one at T.&lt;/p&gt;


&lt;p&gt;Wow.&lt;/p&gt;


&lt;p&gt;I'm going to seriously consider switching to git.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/06/15/subversion%2C-tags-and-externals#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/06/15/subversion%2C-tags-and-externals#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1196</wfw:commentRss>
      </item>
    
  <item>
    <title>Debriefing Symfony Live 2009</title>
    <link>http://mirmodynamics.com/post/2009/06/14/Debriefing-Symfony-Live-2009</link>
    <guid isPermaLink="false">urn:md5:4903d9f57ed1048a8569aacbfcda14ec</guid>
    <pubDate>Sun, 14 Jun 2009 15:50:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Ego</category>
        <category>debrief</category><category>sflive09fr</category><category>talking</category>    
    <description>    &lt;p&gt;Bon ben voilà, vendredi dernier était le grand jour pour moi: ma première conférence. Que dire, sinon que les conditions n'auraient pas pu etre pires ? J'avais déjà un peu les chocopétoches, parceque perso parler en public, j'ai un peu du mal, je n'étais pas non plus entièrement satisfait des slides, mais j'imagine que c'est normal, et puis je parlais devant pas mal de personnes qui m'impressionnent un peu. Bref, autant dire que vers 8h30 (ma conf étant a 9h), je faisais pas trop le fier.&lt;/p&gt;


&lt;p&gt;8h30, c'est l'heure à laquelle mon portable a sonné pour m'annoncer que mon co-conférencier serait à la bourre. Ok super, c'est lui qui a la dernière version des slides, c'est lui qui fait la première partie, wow, trop bien. Ni une ni deux, j'en parle à mon boss, qui décide de swapper sa conf (10h) avec la mienne. Le coeur léger (malgrès le fait que parler après mon boss, ça me foutait un peu les boules (il parle très bien)), &lt;a href=&quot;http://twitter.com/ubermuda/status/2128423570&quot;&gt;je m'en vais décharger ma haine sur twitter&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;8h58, mon boss vient me voir: &lt;em&gt;écoute, les gens viennent voir symfony 2, là y'a pas tout le monde, si on leur dit a 10h quand ils vont arriver que ben désolé symfony 2 c'était à 9h finalement, ça le fait pas, donc tu vas faire ta conf&lt;/em&gt;. Décomposition. &lt;em&gt;Mais je vais remplacer Hugo dans ta conf&lt;/em&gt;.&lt;/p&gt;


&lt;p&gt;Ok. Très bien. Je vais brancher mon pc sur le rétro, obligé de rebooter sous windows pour avoir la sortie VGA qui marche (on ne ricane pas dans le fond, et oui ça doit surement marcher sous linux, mais pas trop le temps de chercher là), je ressors le vieux PDF des slides de y'a un mois, et zou, on part en petite impro. Fabien (mon boss) commence à parler, c'est chouette, ça se passe bien, jusqu'a environ une vingtaine de slide, où on se rend compte que, ben, y'a plus de slides. Gros gros moment de solitude. A partir de là, c'est freestyle complet.A mon tour de parler, la gorge désséchée, une petite tremblote de la main qui tient le micro, mais ça va, j'arrive quand meme a débiter mon petit laius, à quelques oublis près.&lt;/p&gt;


&lt;p&gt;On finit sur la petite séance de questions, qui s'est plutot bien passé (merci à la personne qui a parlé de code coverage, c'est typiquement le truc qui était dans les slides et que j'ai oublié).&lt;/p&gt;


&lt;p&gt;Bref, au final, je ne suis pas mort, personne ne m'as hué à la sortie, et ça me fait une expérience vraiment enrichissante du blablatage en public.&lt;/p&gt;


&lt;p&gt;Quelques leçons que j'ai tiré de tout ça:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;toujours, TOUJOURS, etre pret à etre laché seul dans la nature, meme si on a une confiance aveugle en son co-conférencier, on ne sait jamais ce qui peut arriver&lt;/li&gt;
&lt;li&gt;NE PAS se mettre devant le rétroprojecteur, ça illumine&lt;/li&gt;
&lt;li&gt;parler en public, quand on maitrise assez son sujet, c'est pas si sorcier que ça&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Et surtout, ce que je retiendrais le plus: je pense que ce qui me faisait le plus peur avant la conf, c'était le public. Quand on parle en public, on peut penser avoir à défendre son steack, et le défendre contre qui ? le public. Il n'en est rien. On est meme au contraire en position de force par rapport au public, parcequ'on possède une connaissance qu'il convoite (sinon il ne serait pas là). Donc voilà, le public, ce n'est pas l'ennemi, c'est un ami qui nous veut du bien.&lt;/p&gt;


&lt;p&gt;Dernière chose: ça me désole vraiment que la conf ce soit déroulée comme ça, et pour m'excuser, je vais publier une petite série d'articles sur les tests unitaires et fonctionnels, avec notament les exemples présents dans les slides qui n'ont pas pu etre montrés. Stay tuned.&lt;/p&gt;


&lt;p&gt;PS: Les conférences étaient filmées, elles seront mises en lignes fin de semaine prochaine sur &lt;a href=&quot;http://www.phptv.fr/&quot; title=&quot;http://www.phptv.fr/&quot;&gt;http://www.phptv.fr/&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Quelques photos en attendant:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.flickr.com/photos/fdap&quot; title=&quot;http://www.flickr.com/photos/fdap&quot;&gt;http://www.flickr.com/photos/fdap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://soulmotions.free.fr/PHP/&quot; title=&quot;http://soulmotions.free.fr/PHP/&quot;&gt;http://soulmotions.free.fr/PHP/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.flickr.com/photos/tags/sflive09fr&quot; title=&quot;http://www.flickr.com/photos/tags/sflive09fr&quot;&gt;http://www.flickr.com/photos/tags/s...&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/06/14/Debriefing-Symfony-Live-2009#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/06/14/Debriefing-Symfony-Live-2009#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1195</wfw:commentRss>
      </item>
    
  <item>
    <title>Speaking at Symfony Live 09</title>
    <link>http://mirmodynamics.com/post/2009/05/06/Speaking-at-Symfony-Live-09</link>
    <guid isPermaLink="false">urn:md5:04df1543573abbe471f86517b110d1a7</guid>
    <pubDate>Wed, 06 May 2009 09:22:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Ego</category>
        <category>continuous integration</category><category>sflive09fr</category><category>symfony</category><category>talk</category><category>unit testing</category>    
    <description>    &lt;p&gt;For those not following &lt;a href=&quot;http://twitter.com/ubermuda&quot;&gt;me on twitter&lt;/a&gt; (shame on you), &lt;a href=&quot;http://www.symfony-live.com/schedule#session-hh1&quot;&gt;I will be speaking about unit and functional testing in Symfony&lt;/a&gt; (with a tiny bit of continuous integration too) at &lt;a href=&quot;http://www.symfony-live.com/&quot;&gt;Symfony Live 2009&lt;/a&gt;. I will not be alone since my workmate &lt;a href=&quot;http://www.hugohamon.com/&quot;&gt;Hugo Hamon&lt;/a&gt; will be under the spotlights with me. Also, the talk will be given in french.&lt;/p&gt;


&lt;p&gt;Hope to see you there :)&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/05/06/Speaking-at-Symfony-Live-09#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/05/06/Speaking-at-Symfony-Live-09#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1193</wfw:commentRss>
      </item>
    
  <item>
    <title>SQLSTATE[HY000]: General error: 1005 Can't create table '*' (errno: 150)</title>
    <link>http://mirmodynamics.com/post/2009/04/02/SQLSTATE%5BHY000%5D%3A-General-error%3A-1005-Can-t-create-table-%2A-%28errno%3A-150%29</link>
    <guid isPermaLink="false">urn:md5:d13814e8b3b075af9b6b090d2a89778c</guid>
    <pubDate>Thu, 02 Apr 2009 15:18:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Geekeries</category>
        <category>doctrine</category><category>error</category><category>foreignkey</category><category>frustration</category><category>mysql</category><category>schema</category>    
    <description>    &lt;p&gt;You may or may have not already stumbled upon this rather obscure error message (no, I'm not starting a serie on &lt;a href=&quot;http://mirmodynamics.com/post/2009/03/31/Ajax-query-failing-unexpectedly&quot;&gt;obscures error messages&lt;/a&gt;). Well the first thing to think when you encounter this is your foreign keys. This message generally denotes a failure in foreign keys creation, for example when the two columns you are trying to link are not of the &lt;strong&gt;exact&lt;/strong&gt; same type (that is, you can't link an &lt;code&gt;integer(4)&lt;/code&gt; to an &lt;code&gt;integer(11)&lt;/code&gt;).&lt;/p&gt;


&lt;p&gt;Now what if you are absolutely certain that your two columns are of the same type ? I just had the problem with this piece of doctrine schema (simplified for example purpose):&lt;/p&gt;

&lt;pre&gt;
Media:
  columns:
    image:           { type: string(255), notnull: true, unique: true }

ExplorationMission:
  columns:
    probe_image:         { type: integer, notnull: true }
  relations:
    ProbeImage:          { class: Media, local: probe_image, foreign: id, onDelete: 'SET NULL' }
&lt;/pre&gt;


&lt;p&gt;Can you spot the problem ?&lt;/p&gt;


&lt;p&gt;It's rather obvious when you know it, but I spent rather some time cursing mysql in vain. The point is that there is a major logic error in this schema. it declares the &lt;code&gt;probe_image&lt;/code&gt; as &lt;code&gt;NOT NULL&lt;/code&gt; while it gently asks the &lt;acronym&gt;FK&lt;/acronym&gt; to set it null on delete. See ?&lt;/p&gt;


&lt;p&gt;Hope it saves some frustration :-)&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/04/02/SQLSTATE%5BHY000%5D%3A-General-error%3A-1005-Can-t-create-table-%2A-%28errno%3A-150%29#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/04/02/SQLSTATE%5BHY000%5D%3A-General-error%3A-1005-Can-t-create-table-%2A-%28errno%3A-150%29#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1190</wfw:commentRss>
      </item>
    
  <item>
    <title>Ajax query failing unexpectedly ?</title>
    <link>http://mirmodynamics.com/post/2009/03/31/Ajax-query-failing-unexpectedly</link>
    <guid isPermaLink="false">urn:md5:4c0e02c551d601e2c8ce02bc4b6e1a52</guid>
    <pubDate>Tue, 31 Mar 2009 18:14:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Geekeries</category>
        <category>adblock</category><category>ajax</category><category>exception</category><category>firebug</category><category>jquery</category>    
    <description>    &lt;p&gt;I was gently doing some ajax black voodoo when I came upon this obscure-ish error in my firebug console:&lt;/p&gt;

&lt;pre&gt;
Error: uncaught exception: [Exception... &amp;quot;Component returned failure code: 0x805e000a [nsIXMLHttpRequest.open]&amp;quot;  nsresult: 0x805e000a (&amp;lt;unknown&amp;gt;)&amp;quot;
&lt;/pre&gt;


&lt;p&gt;&lt;em&gt;What the fuck&lt;/em&gt; I though. And then after some (useless) firefox rebooting, I decided to ask the all-mighty Google.&lt;/p&gt;


&lt;p&gt;&lt;em&gt;No shit&lt;/em&gt;, he said, &lt;em&gt;I know what you are talking about, and thou shall find more informations at this place&lt;/em&gt;, and to point me to &lt;a href=&quot;http://groups.google.com/group/jquery-en/browse_thread/thread/44cd7c8352a11e4a&quot;&gt;this thread&lt;/a&gt;, where you can read the following:&lt;/p&gt;


&lt;p&gt;&lt;em&gt;AdBlock Plus was killing it HAH!&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;And then I disabled AdBlock Plus, and exactly as the writings told, it worked.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/03/31/Ajax-query-failing-unexpectedly#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/03/31/Ajax-query-failing-unexpectedly#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1189</wfw:commentRss>
      </item>
    
  <item>
    <title>Customizing actions in symfony's admin generator</title>
    <link>http://mirmodynamics.com/post/2009/03/30/Customizing-actions-in-symfony-s-admin-generator</link>
    <guid isPermaLink="false">urn:md5:7e4c96ac2f177d1f6eb9779bab92e71f</guid>
    <pubDate>Mon, 30 Mar 2009 23:31:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>admingen</category><category>customize</category><category>helper</category><category>quickie</category><category>symfony</category>    
    <description>    &lt;p&gt;A quick tip about symfony's admin generator: if you want to have a custom action, with the following &lt;code&gt;generator.yml&lt;/code&gt; bit for example (actions prefixed with an underscore are builtin admin-gen actions):&lt;/p&gt;

&lt;pre&gt;
form:
  actions:
    _delete:  ~
    _cancel:  ~
    _save:    ~
    _save_and_add: ~
    custom: ~
&lt;/pre&gt;


&lt;p&gt;You can totally customize the link generated for this action (to add javascript for example) using the generator helper in your module's &lt;code&gt;lib/&lt;/code&gt; directory:&lt;/p&gt;

&lt;code class=&quot;php&quot;&gt;&lt;pre class=&quot;php&quot;&gt;public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; linkToCustom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$object&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$params&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'&amp;lt;a href=&amp;quot;#&amp;quot; onclick=&amp;quot;console.log(&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\'&lt;/span&gt;woohoo&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\'&lt;/span&gt;); return false;&amp;quot;&amp;gt;log woohoo&amp;lt;/a&amp;gt;'&lt;/span&gt;;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/code&gt;


&lt;p&gt;You get passed the current object as an argument, and whatever parameters you passed in the &lt;code&gt;generator.yml&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;
    custom: { label: 'WOOHOO' }
&lt;/pre&gt;


&lt;code class=&quot;php&quot;&gt;&lt;pre class=&quot;php&quot;&gt;public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; linkToCustom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$object&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$params&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'&amp;lt;a href=&amp;quot;'&lt;/span&gt;.url_for&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getUrlForAction&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'custom'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;'&amp;quot; onclick=&amp;quot;console.log(&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\'&lt;/span&gt;woohoo&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\'&lt;/span&gt;); return false;&amp;quot;&amp;gt;'&lt;/span&gt;.__&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$params&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'label'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;'&amp;lt;/a&amp;gt;'&lt;/span&gt;;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/code&gt;


&lt;p&gt;Also, as you can see that standard helpers are available too.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/03/30/Customizing-actions-in-symfony-s-admin-generator#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/03/30/Customizing-actions-in-symfony-s-admin-generator#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1188</wfw:commentRss>
      </item>
    
  <item>
    <title>Symfony Live les 11 et 12 Juin 2009</title>
    <link>http://mirmodynamics.com/post/2009/03/20/Symfony-Live-les-11-et-12-Juin-2009</link>
    <guid isPermaLink="false">urn:md5:de4bad71148b72520a75a1aefe0f9039</guid>
    <pubDate>Fri, 20 Mar 2009 20:07:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>conferences</category><category>event</category><category>peaceandlove</category><category>sensiolabs</category><category>symfony</category><category>symfonylive</category>    
    <description>    &lt;p&gt;&lt;a href=&quot;http://www.sensiolabs.com/blog/post/2009/03/20/Symfony-Live-%3A-Conf%C3%A9rence-francophone-sur-Symfony-%C3%A0-Paris-les-11-12-juin-2009&quot;&gt;Sensio Labs organise les 11 et 12 juin l'événement Symfony Live&lt;/a&gt;. Voilà tout est presque dit, cliquouillez le lien pour plus d'infos.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://mirmodynamics.com/public/2a20t-ade6528d35d0a31fff8eb9e2cb5cab1d.49c3e987-original.jpg&quot; alt=&quot;Symfony Live Flyer&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Symfony Live Flyer, Mar 2009&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/03/20/Symfony-Live-les-11-et-12-Juin-2009#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/03/20/Symfony-Live-les-11-et-12-Juin-2009#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1185</wfw:commentRss>
      </item>
    
  <item>
    <title>Automatically cd to a symfony project's root in vim</title>
    <link>http://mirmodynamics.com/post/2009/03/18/Automatically-cd-to-a-symfony-project-s-root-in-vim</link>
    <guid isPermaLink="false">urn:md5:61347ede04eb1bebad2f907168976ff4</guid>
    <pubDate>Wed, 18 Mar 2009 14:10:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>ctags</category><category>gist</category><category>root</category><category>script</category><category>symfony</category><category>vim</category>    
    <description>    &lt;p&gt;I made a little vimscript to automatically cd to the project root of a symfony project. It makes it easier for me to use the ctags :-)&lt;/p&gt;

&lt;pre&gt;
&amp;quot;-------------------------------------------------------------------------------
&amp;quot;  Description: Finds and cd to the symfony root of the project
&amp;quot;    Copyright: Copyright (C) 2009 Geoffrey Bachelet
&amp;quot;   Maintainer: Geoffrey Bachelet
&amp;quot;      Version: 1.0
&amp;quot;-------------------------------------------------------------------------------

if exists('find_symfony_root_loaded')
  finish
endif

let find_symfony_root_loaded = 1

if ! exists('find_symfony_root_symfony_executable')
  let find_symfony_root_symfony_executable = 'symfony'
endif

&amp;quot; root detection when opening a new vim seems to work
&amp;quot; only if these two events are bound. not sure why.
autocmd BufWinEnter,BufRead * call FindSymfonyRoot()

function FindSymfonyRoot()
  let l:cwd = GetAbsoluteDirname(@%)
  let l:symfony_root = findfile(g:find_symfony_root_symfony_executable, l:cwd.';')
  let l:symfony_root = GetAbsoluteDirname(l:symfony_root)
  if strlen(l:symfony_root) != 0
    execute 'cd '.l:symfony_root
  endif
endfunction

function GetAbsoluteDirname(path)
  let l:path = a:path
  &amp;quot; gets the dirname
  if !isdirectory(l:path)
    let l:path = strpart(l:path, 0, strridx(l:path, '/'))
  endif

  &amp;quot; makes it absolute
  if match(l:path, '/') != 0
    let l:path = getcwd().'/'.l:path
  endif

  return l:path
endfunction
&lt;/pre&gt;


&lt;p&gt;note for later: add vimscript support to geshi&lt;/p&gt;


&lt;p&gt;Or see &lt;a href=&quot;http://gist.github.com/81105&quot;&gt;the highlighted version on gist&lt;/a&gt;.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/03/18/Automatically-cd-to-a-symfony-project-s-root-in-vim#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/03/18/Automatically-cd-to-a-symfony-project-s-root-in-vim#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1184</wfw:commentRss>
      </item>
    
  <item>
    <title>Rewrite rule to add missing www</title>
    <link>http://mirmodynamics.com/post/2009/03/17/Rewrite-rule-to-add-missing-www</link>
    <guid isPermaLink="false">urn:md5:0bab59ade6517a990b75546554dba814</guid>
    <pubDate>Tue, 17 Mar 2009 19:30:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Geekeries</category>
        <category>apache</category><category>mod_rewrite</category><category>rewritecond</category><category>rewriterule</category>    
    <description>    &lt;pre&gt;
  RewriteEngine on
  RewriteCond %{SERVER_NAME} !^www\..*$
  RewriteRule ^/(.*)$ http://www.%{SERVER_NAME}/$1 [L,QSA,R=302]
&lt;/pre&gt;


&lt;p&gt;From &lt;a href=&quot;http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewriterule&quot;&gt;the manual&lt;/a&gt;, using &lt;code&gt;%1&lt;/code&gt; as a back reference from the &lt;code&gt;RewriteCond&lt;/code&gt; in the &lt;code&gt;RewriteRule&lt;/code&gt; should work, but it didn't on my installation. Weird.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/03/17/Rewrite-rule-to-add-missing-www#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/03/17/Rewrite-rule-to-add-missing-www#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1183</wfw:commentRss>
      </item>
    
  <item>
    <title>How to render a partial in an action with symfony 1.1+</title>
    <link>http://mirmodynamics.com/post/2009/03/12/How-to-render-a-partial-in-an-action-with-symfony-1.1</link>
    <guid isPermaLink="false">urn:md5:58fcdf11f847730d1a68596cafcde372</guid>
    <pubDate>Thu, 12 Mar 2009 12:29:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>1.1</category><category>1.2</category><category>action</category><category>partial</category><category>render</category><category>symfony</category>    
    <description>    &lt;code class=&quot;php&quot;&gt;&lt;pre class=&quot;php&quot;&gt;public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; executeFoobar&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;renderPartial&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'my_partial'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/code&gt;


&lt;p&gt;This is an attempt to take over the first place on google for the query &lt;em&gt;how to render partial action symfony&lt;/em&gt;.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/03/12/How-to-render-a-partial-in-an-action-with-symfony-1.1#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/03/12/How-to-render-a-partial-in-an-action-with-symfony-1.1#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1182</wfw:commentRss>
      </item>
    
  <item>
    <title>Using the timestamp data type in doctrine fixtures</title>
    <link>http://mirmodynamics.com/post/2009/03/10/Using-the-timestamp-data-type-in-doctrine-fixtures</link>
    <guid isPermaLink="false">urn:md5:176b6a1c1d7c2471e40780c650506039</guid>
    <pubDate>Tue, 10 Mar 2009 18:55:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>doctrine</category><category>fixtures</category><category>symfony</category><category>timestamp</category>    
    <description>    &lt;p&gt;Please note that to be valid, you have to enclose the value within single quotes. For example, say you have the following (totally useless) schema:&lt;/p&gt;

&lt;pre&gt;
Foobar:
  columns:
    published_at: { type: timestamp }
&lt;/pre&gt;


&lt;p&gt;And you want to create fixtures for this table. You might go this way (please also note that symfony allows php in fixtures files):&lt;/p&gt;

&lt;pre&gt;
Foobar:
  foobar_1:
    published_at: &amp;lt;?php echo time(); ?&amp;gt;
&lt;/pre&gt;


&lt;p&gt;Which won't work, since the &lt;code&gt;Doctrine_Validator_Timestamp&lt;/code&gt; expects a date in the &lt;code&gt;Y-m-d H:i:s&lt;/code&gt; format. So maybe you'll try this one:&lt;/p&gt;

&lt;pre&gt;
    published_at: &amp;lt;?php echo date('Y-m-d H:i:s'); ?&amp;gt;
&lt;/pre&gt;


&lt;p&gt;Which still doesn't work, since the value gets converted to an unix timestamp.&lt;/p&gt;


&lt;p&gt;The right way is (note the enclosing single quotes):&lt;/p&gt;

&lt;pre&gt;
   published_at: '&amp;lt;?php echo date('Y-m-d H:i:s'); ?&amp;gt;'
&lt;/pre&gt;


&lt;p&gt;Yay o//&lt;/p&gt;


&lt;p&gt;This &lt;em&gt;behavior&lt;/em&gt; is explained in &lt;a href=&quot;http://trac.doctrine-project.org/ticket/1716&quot;&gt;this ticket might help&lt;/a&gt;.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/03/10/Using-the-timestamp-data-type-in-doctrine-fixtures#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/03/10/Using-the-timestamp-data-type-in-doctrine-fixtures#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1181</wfw:commentRss>
      </item>
    
  <item>
    <title>having fun with vim, an event tracker</title>
    <link>http://mirmodynamics.com/post/2009/03/08/having-fun-with-vim%2C-an-event-tracker</link>
    <guid isPermaLink="false">urn:md5:dd9c2194c796331acd7a9a403f01f67e</guid>
    <pubDate>Sun, 08 Mar 2009 21:16:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Coding</category>
        <category>timetracking</category><category>vim</category><category>vimscript</category>    
    <description>    &lt;p&gt;The idea of this script came by realizing that the main reason I (almost) never fill my timesheet, is because I just forget it. How easier could it be if my editor (namely vim) could fill it for me ? Or at least, help me fill it. This script is meant to help this process. It will hook to every configured event (in the code below, &lt;code&gt;BufRead&lt;/code&gt; and &lt;code&gt;BufNewFile&lt;/code&gt;) and add a log line to the log file. Easy heh ? Of course, the script it self won't be of much use, I'll have to add some more events to track as well as writting some kind of frontend for it, with reporting &amp;amp; all.&lt;/p&gt;

&lt;pre&gt;
if exists('trackloaded')
  finish
endif

&amp;quot; list of autocmd events:
&amp;quot; http://www.vim.org/htmldoc/autocmd.html#autocmd-events
let trackevents = ['BufRead', 'BufNewFile', 'BufEnter', 'BufWrite', 'BufLeave']
let trackfile   = '/tmp/timetrack.dat'
let trackloaded = 1

for event in trackevents
  execute 'autocmd '.event.' * call Track(&amp;quot;'.event.'&amp;quot;)'
endfor

unlet event

function Track(event)
  let l:filename = @%
  if l:filename != g:trackfile
    if match(l:filename, '/') != 0
      let l:filename = getcwd().'/'.l:filename
    endif
    silent execute '!echo `date +\%s` '.a:event.' '.l:filename.' &amp;gt;&amp;gt; '.g:trackfile
  endif
endfunction
&lt;/pre&gt;


&lt;p&gt;You might note from this snippet that I'm not very comfortable with vimscripting :-) If you have a better way of doing this (I'm thinking mostly about the file writting here), don't hesitate to tell me.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/03/08/having-fun-with-vim%2C-an-event-tracker#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/03/08/having-fun-with-vim%2C-an-event-tracker#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1180</wfw:commentRss>
      </item>
    
  <item>
    <title>symfony api opensearch plugin</title>
    <link>http://mirmodynamics.com/post/2009/02/25/symfony-api-opensearch-plugin</link>
    <guid isPermaLink="false">urn:md5:e449070cd708b21673c69220a5804736</guid>
    <pubDate>Wed, 25 Feb 2009 00:08:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>api</category><category>documentation</category><category>opensearch</category><category>symfony</category>    
    <description>    &lt;p&gt;In case you didn't notice, as of today (well, yesterday really) the symfony's api documentation features an opensearch plugin with autocompletion, that you can use straight from the  comfort of your favorite browser (given that it supports the opensearch standard, which is the case for at least firefox and IE, although you won't get autocomplete in this last case).&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://www.symfony-project.org/blog/2009/02/24/opensearch-support-for-the-symfony-api&quot;&gt;More informations on the symfony blog&lt;/a&gt;.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/02/25/symfony-api-opensearch-plugin#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/02/25/symfony-api-opensearch-plugin#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1178</wfw:commentRss>
      </item>
    
  <item>
    <title>symfony: use your own View class</title>
    <link>http://mirmodynamics.com/post/2009/02/23/symfony%3A-use-your-own-View-class</link>
    <guid isPermaLink="false">urn:md5:1ee2dba1b9237504be3a017c9a957bd2</guid>
    <pubDate>Mon, 23 Feb 2009 20:57:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>configuration</category><category>extending</category><category>module.yml</category><category>sfConfig</category><category>sfPHPView</category><category>symfony</category><category>view</category>    
    <description>    &lt;p&gt;The view class name in symfony is determined per-module, it means that you need to use a module-level configuration setting via the &lt;code&gt;module.yml&lt;/code&gt; configuration file. Say you want to use the &lt;code&gt;myView&lt;/code&gt; class to handle your view in the &lt;code&gt;default&lt;/code&gt; module of your &lt;code&gt;frontend&lt;/code&gt; application, create the file &lt;code&gt;sf_root_dir/apps/frontend/config/module.yml&lt;/code&gt; and put the following in it:&lt;/p&gt;

&lt;pre&gt;
default:
  view_class:  my
&lt;/pre&gt;


&lt;p&gt;Symfony will add the &lt;code&gt;View&lt;/code&gt; suffix for you. Of course, you have to take care of making this class available to the framework. The &lt;code&gt;sf_root_dir/apps/frontend/lib/myView.class.php&lt;/code&gt; file would be a good place for this.&lt;/p&gt;


&lt;p&gt;As often with &lt;code&gt;sfConfig&lt;/code&gt;, you could have put the &lt;code&gt;module.yml&lt;/code&gt; config file in &lt;code&gt;sf_root_dir/config/&lt;/code&gt; to make it global to your whole project.&lt;/p&gt;


&lt;p&gt;&lt;acronym&gt;PS&lt;/acronym&gt;: extending the &lt;code&gt;sfPHPView&lt;/code&gt; class could be a good idea to get you started too ;)&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/02/23/symfony%3A-use-your-own-View-class#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/02/23/symfony%3A-use-your-own-View-class#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1175</wfw:commentRss>
      </item>
    
  <item>
    <title>Replacing short tags with proper PHP tags</title>
    <link>http://mirmodynamics.com/post/2009/01/29/Replacing-short-tags-with-proper-PHP-tags</link>
    <guid isPermaLink="false">urn:md5:d6481ef46111e084484a9fa1c9c30d82</guid>
    <pubDate>Thu, 29 Jan 2009 10:37:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Coding</category>
        <category>pcre</category><category>php</category><category>regexp</category><category>short_tags</category>    
    <description>    &lt;p&gt;This is a little script I made to get rid of those damned short tags.&lt;/p&gt;

&lt;code class=&quot;php&quot;&gt;&lt;pre class=&quot;php&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #b1b100;&quot;&gt;while&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$file&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/trim&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;trim&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/fgets&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;fgets&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;STDIN&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span style=&quot;color: #0000ff;&quot;&gt;$content&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/file_get_contents&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;file_get_contents&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
  &lt;span style=&quot;color: #0000ff;&quot;&gt;$search&lt;/span&gt;  = &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'/&amp;lt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\?&lt;/span&gt;=/'&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;'/&amp;lt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\?&lt;/span&gt;(?!php|xml)/'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;
  &lt;span style=&quot;color: #0000ff;&quot;&gt;$replace&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'&amp;lt;?php echo '&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;'&amp;lt;?php '&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
  &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$content&lt;/span&gt; != &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$new_content&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/preg_replace&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;preg_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$search&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$replace&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$content&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
    file_put_contents&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$file&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$new_content&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;
  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/code&gt;


&lt;p&gt;Just put this in a file, &lt;code&gt;short_tags.php&lt;/code&gt; for example, and run something like:&lt;/p&gt;

&lt;pre&gt;
$ find . -name &amp;quot;*.php&amp;quot; | php ./short_tags.php
&lt;/pre&gt;


&lt;p&gt;I would have done it with &lt;code&gt;sed&lt;/code&gt;, but it doesn't seem to support &lt;acronym&gt;PCRE&lt;/acronym&gt;, and I don't know how to do negative lookahead (the &lt;code&gt;(?!php|xml)&lt;/code&gt; thingy) with POSIX based regexp (if it's even supported) :/&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: Actually, POSIX Regexps DO support negative lookahead (as well as positive lookahead and lookbehind) with the same syntax as PCRE regexps. But grep doesn't use POSIX regexps, it uses things called &lt;acronym title=&quot;Basic RegExps&quot;&gt;BRE&lt;/acronym&gt; and &lt;acronym title=&quot;Extended RegExps&quot;&gt;ERE&lt;/acronym&gt; that I've never heard of before. Too bad.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/01/29/Replacing-short-tags-with-proper-PHP-tags#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/01/29/Replacing-short-tags-with-proper-PHP-tags#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1174</wfw:commentRss>
      </item>
    
  <item>
    <title>Good morning, jour #3</title>
    <link>http://mirmodynamics.com/post/2009/01/23/Good-morning%2C-jour-3</link>
    <guid isPermaLink="false">urn:md5:50451d6d64daa2d534d62420f9eacaff</guid>
    <pubDate>Fri, 23 Jan 2009 13:58:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Ego</category>
        <category>axbo</category><category>graphiques</category><category>matin</category><category>review</category><category>réveil</category><category>sommeil</category>    
    <description>    &lt;p&gt;Bon ben ce matin je me suis réveillé avant le début de la &lt;em&gt;période de réveil&lt;/em&gt; de mon Axbo, du coup je me suis levé, puisque je commence a prendre cette habitude. Par contre j'ai remarqué que l'Axbo semble perdre du temps assez rapidement, il indiquait 7h ce matin quand mon iphone indiquait 7h30. A voir donc.&lt;/p&gt;


&lt;p&gt;Sinon, voilà mes graphes pour les deux premiers jours:&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://mirmodynamics.com/public/axbo/2009-01-20.png&quot;&gt;&lt;img src=&quot;http://mirmodynamics.com/public/axbo/.2009-01-20_m.jpg&quot; alt=&quot;2009-01-20.png&quot; title=&quot;2009-01-20.png, Jan 2009&quot; /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://mirmodynamics.com/public/axbo/2009-01-21.png&quot;&gt;&lt;img src=&quot;http://mirmodynamics.com/public/axbo/.2009-01-21_m.jpg&quot; alt=&quot;2009-01-21.png&quot; title=&quot;2009-01-21.png, Jan 2009&quot; /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;En gros, plus les barres sont hautes, plus je bouge. On voit nettement que la première nuit (le 20), je me suis souvent réveillé, et sur la deuxième nuit on voit également très bien le moment où je me suis relevé dans la nuit. Passionnant hein.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/01/23/Good-morning%2C-jour-3#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/01/23/Good-morning%2C-jour-3#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1173</wfw:commentRss>
      </item>
    
  <item>
    <title>Multiple domains for one symfony project, the basics, config file version</title>
    <link>http://mirmodynamics.com/post/2009/01/19/Multiple-domains-for-one-symfony-project%2C-the-basics%2C-config-file-version</link>
    <guid isPermaLink="false">urn:md5:d1988ef40eb48bba444de255d9def1cb</guid>
    <pubDate>Thu, 22 Jan 2009 22:02:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>cache</category><category>carshop</category><category>config</category><category>dispatcher</category><category>doctrine</category><category>howto</category><category>multidomain</category><category>symfony</category>    
    <description>    &lt;p&gt;When I published my post about &lt;a href=&quot;http://mirmodynamics.com/post/2008/12/22/Multiple-domains-for-one-symfony-project%2C-the-basics&quot;&gt;using a single symfony application to serve multiple domains&lt;/a&gt; using a database to store the site-specific data, there was some people to complain about the extra query you get on each request. Right. Using a (cached) config file instead is not that hard as long as you use it only to match a domain name against a numeric id. Storing more site-specific data is a bit more problematic, but we will solve this in a later post.&lt;/p&gt;


&lt;p&gt;And because I'm lazy, I won't re-write the entire article, just highlight the differences between the two methods, so you might as well read &lt;a href=&quot;http://mirmodynamics.com/post/2008/12/22/Multiple-domains-for-one-symfony-project%2C-the-basics&quot;&gt;the database version&lt;/a&gt; if you did not already.&lt;/p&gt;


&lt;p&gt;Now, first thing, the config file. We will create a simple project-wide config file: &lt;code&gt;/config/app.yml&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;
all:
  paris.carshop: 1
  auckland.carshop: 2
&lt;/pre&gt;


&lt;p&gt;Then we detect the site and add a generic &lt;code&gt;sfConfig&lt;/code&gt; entry for it. This is done, as before, in &lt;code&gt;/config/ProjectConfiguration.class.php&lt;/code&gt;. We will only change the &lt;code&gt;detectSite()&lt;/code&gt; method to take advantage of the cached config information:&lt;/p&gt;

&lt;code class=&quot;php&quot;&gt;&lt;pre class=&quot;php&quot;&gt;public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; detectSite&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;sfEvent &lt;span style=&quot;color: #0000ff;&quot;&gt;$event&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
    sfConfig::&lt;span style=&quot;color: #006600;&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'site_id'&lt;/span&gt; =&amp;gt; sfConfig::&lt;span style=&quot;color: #006600;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'app_'&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'HTTP_HOST'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;
  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/code&gt;


&lt;p&gt;Easy heh ?&lt;/p&gt;


&lt;p&gt;Now we just have to adapt the model classes to use this config entry. The &lt;code&gt;CarTable::createQuery()&lt;/code&gt; method will look like:&lt;/p&gt;

&lt;code class=&quot;php&quot;&gt;&lt;pre class=&quot;php&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**
 * Creates a query, adding the site criteria automatically
 *
 * @return Doctrine_Query
 * @see Doctrine_Table::createQuery()
 */&lt;/span&gt;
&amp;nbsp;
public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; createQuery&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$alias&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;''&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span style=&quot;color: #0000ff;&quot;&gt;$query&lt;/span&gt; = parent::&lt;span style=&quot;color: #006600;&quot;&gt;createQuery&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$alias&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;
  &lt;span style=&quot;color: #0000ff;&quot;&gt;$query&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'site_id = ?'&lt;/span&gt;, sfConfig::&lt;span style=&quot;color: #006600;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'site_id'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;
  
  &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$query&lt;/span&gt;;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/code&gt;


&lt;p&gt;The &lt;code&gt;Car::save()&lt;/code&gt; method:&lt;/p&gt;

&lt;code class=&quot;php&quot;&gt;&lt;pre class=&quot;php&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**
 * Automatically populates the site_id field if necessary
 * 
 * @see sfDoctrineRecord::save()
 */&lt;/span&gt;
&amp;nbsp;
public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; save&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Doctrine_Connection &lt;span style=&quot;color: #0000ff;&quot;&gt;$conn&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/empty&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;empty&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;site_id&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setSiteId&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;sfConfig::&lt;span style=&quot;color: #006600;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'site_id'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;
  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
  &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; parent::&lt;span style=&quot;color: #006600;&quot;&gt;save&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/code&gt;


&lt;p&gt;And you're all set ! For the record, here are the other modified files from the last post:&lt;/p&gt;


&lt;p&gt;&lt;code&gt;config/doctrine/schema.yml&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;
Car:
  columns:
    site_id:      { type: integer }
    name:         { type: string(255) }
    description:  { type: clob }
    image:        { type: string(255) }
&lt;/pre&gt;


&lt;p&gt;&lt;code&gt;data/fixtures/&lt;/code&gt; now contains only the &lt;code&gt;Car&lt;/code&gt; fixtures:&lt;/p&gt;

&lt;pre&gt;
Car:
  car_1:
    site_id: 1
    name: Peugeot 307
    description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
  car_2:
    site_id: 1
    name: Renault Laguna
    description: Maecenas tortor nunc, aliquam et, ultrices id, ornare consectetur, mauris.
  car_3:
    site_id: 2
    name: Subaru Impreza
    description: Ut accumsan diam et orci. Sed sit amet neque ac diam rutrum iaculis.
&lt;/pre&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/01/19/Multiple-domains-for-one-symfony-project%2C-the-basics%2C-config-file-version#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/01/19/Multiple-domains-for-one-symfony-project%2C-the-basics%2C-config-file-version#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1169</wfw:commentRss>
      </item>
    
  <item>
    <title>Good morning, jour #2</title>
    <link>http://mirmodynamics.com/post/2009/01/22/Good-morning%2C-jour-2</link>
    <guid isPermaLink="false">urn:md5:acd1c60985c6d8a2a0b61f93859a533b</guid>
    <pubDate>Thu, 22 Jan 2009 13:33:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Ego</category>
        <category>axbo</category><category>logiciels</category><category>matin</category><category>opinions</category><category>review</category><category>réveil</category><category>sommeil</category>    
    <description>    &lt;p&gt;Deuxième jour. Ce matin il m'a réveillé à 7h pétante, c'est à dire la limite que je lui avais fixé. En gros il n'a pas trouvé de bon moment entre 6h30 et 7h. C'est peut-être du au fait que je me suis levé cette nuit pour aller boire, ça a du le perturber un peu. Je vérifierai ça ce soir sur les graphs.&lt;/p&gt;


&lt;p&gt;Parlons des graphs justement. J'ai installé les logiciels fournis sur le site web, dont celui qui permet d'avoir des graphs d'analyse des mouvements pendant le sommeil. Soyons clair: je n'ai rien compris aux graphs. Tout s'installe très facilement, l'axbo est immédiatement reconnu, le logiciel est assez simple d'utilisation, mais juste les graphs, je n'y comprends rien. Bon j'ai pas regardé longtemps non plus, mais j'espère trouver quelques explications quelque part sur internet.&lt;/p&gt;


&lt;p&gt;Du coup j'ai également uploadé le pack de sons disponible sur le site, mais je n'ai pas l'impression qu'on puisse uploader nos propres sons (dommage).&lt;/p&gt;


&lt;p&gt;Dernière chose, la mise à jour du firmware, encore une fois rien à dire. On installe un petit logiciel (encore) qui va s'occuper de vérifier si une nouvelle version est à jour, et le cas échéant de mettre l'Axbo à jour.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/01/22/Good-morning%2C-jour-2#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/01/22/Good-morning%2C-jour-2#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1172</wfw:commentRss>
      </item>
    
  <item>
    <title>Good morning, jour #1</title>
    <link>http://mirmodynamics.com/post/2009/01/21/Good-morning%2C-jour-1</link>
    <guid isPermaLink="false">urn:md5:f13c9e10be33f156c4919c00bec1b69e</guid>
    <pubDate>Wed, 21 Jan 2009 09:50:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Ego</category>
        <category>axbo</category><category>défauts</category><category>matin</category><category>review</category><category>réveil</category><category>sommeil</category>    
    <description>    &lt;p&gt;Aujourd'hui était donc le jour de mon premier réveil avec mon Axbo. Comme j'ai très mal dormi cette nuit (téléphone à une heure du mat, réveil toutes les heures), je ne peux pas trop encore juger de la qualité de mon réveil, on retiendra surtout que:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Le bracelet-éponge ne m'a absolument pas gêné pour dormir&lt;/li&gt;
&lt;li&gt;L'heure est un peu difficile à lire de loin (pas assez de contraste)&lt;/li&gt;
&lt;li&gt;Je me suis levé quand mon réveil a sonné (7h54, réglé pour 8h) sans trop de mal&lt;/li&gt;
&lt;li&gt;Je n'ai pas osé me lever cette nuit pour aller boire de peur d'affoler le capteur du réveil&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;En plus de ces considérations, suite à une discussion hier sur &lt;acronym&gt;IRC&lt;/acronym&gt;, et pour faire l'équilibre avec mon billet élogieux d'hier, signalons quand même que l'Axbo ne dispose pas d'une fonction &lt;em&gt;snooze&lt;/em&gt; (justifié par le fait que quand il sonne, il &lt;strong&gt;faut&lt;/strong&gt; se lever parce que c'est la Bonne Heure (c)). On a aussi déploré l'absence de synchronisation sur une horloge atomique, qui est effectivement &lt;em&gt;nice to have&lt;/em&gt;, mais pas bloquant non plus. Dans un registre plus grave (pas la fin du monde non plus), l'alarme n'est pas réglable &lt;em&gt;par jour&lt;/em&gt;. C'est à dire qu'il sonne tous les jours à la même heure (enfin dans la même fenêtre de temps quoi), donc pour le week-end il faut penser à désactiver l'alarme (il y a un raccourci pour ça je crois, et ce sera peut-être ajouté dans une mise à jour du firmware, allez savoir).&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/01/21/Good-morning%2C-jour-1#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/01/21/Good-morning%2C-jour-1#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1171</wfw:commentRss>
      </item>
    
</channel>
</rss>