<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>William&#039;s Blog &#187; Symfony</title> <atom:link href="http://www.willdurand.fr/tag/symfony/feed/" rel="self" type="application/rss+xml" /><link>http://www.willdurand.fr</link> <description>Développeur web indépendant, étudiant et passionné ! #Symfony2 #Rails #Diem #Git #Nginx #WebPerfs #SoftwareQuality</description> <lastBuildDate>Thu, 20 Oct 2011 14:59:05 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Symfony, Jenkins &amp; co</title><link>http://www.willdurand.fr/symfony-jenkins-co/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=symfony-jenkins-co</link> <comments>http://www.willdurand.fr/symfony-jenkins-co/#comments</comments> <pubDate>Tue, 22 Mar 2011 00:34:26 +0000</pubDate> <dc:creator>Will</dc:creator> <category><![CDATA[symfony]]></category> <category><![CDATA[Hudson]]></category> <category><![CDATA[Pdepend]]></category> <category><![CDATA[phpcpd]]></category> <category><![CDATA[PhpDocumentor]]></category> <category><![CDATA[phploc]]></category> <category><![CDATA[phpmd]]></category> <category><![CDATA[PHP_CodeSniffer]]></category> <category><![CDATA[Symfony]]></category><guid
isPermaLink="false">http://www.willdurand.fr/?p=880</guid> <description><![CDATA[Bonjour, Depuis quelques temps j&#8217;ai repris mes travaux déjà énoncés symfony rencontre Hudson, Mantis et les autres. J&#8217;ai mis à disposition un template générique d&#8217;un build.xml pour Phing exclusivement, accessible sur mon Github : jenkins-phing-symfony. Il permet d&#8217;analyser son code symfony 1.x avec à peu près tous les outils en vogue du moment. A ce [...]]]></description> <content:encoded><![CDATA[<p>Bonjour,</p><p>Depuis quelques temps j&#8217;ai repris mes travaux déjà énoncés <a
href="http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/">symfony rencontre Hudson, Mantis et les autres</a>.
J&#8217;ai mis à disposition un <em>template générique</em> d&#8217;un <code>build.xml</code> pour <a
href="http://phing.info/trac/"><strong>Phing</strong></a> exclusivement, accessible sur mon <a
href="http://github.com/willdurand">Github</a> : <a
href="https://github.com/willdurand/jenkins-phing-symfony"><strong>jenkins-phing-symfony</strong></a>.
Il permet d&#8217;analyser son code <strong>symfony 1.x</strong> avec à peu près tous les outils en vogue du moment.</p><p>A ce propos, <a
href="http://github.com/sebastianbergmann/phploc">PHPLoc</a> ne comporte pas de tâche Phing mais <a
href="http://github.com/raphaelstolt">Raphael Stolt</a> en a écrit une qui semble fonctionner : <a
href="https://github.com/raphaelstolt/phploc-phing">phploc-phing</a>.</p><p>A noter également qu&#8217;il faut passer une variable à ce script pour indiquer le nom du projet:</p><div
class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; phing main -DprojectName=$JOB_NAME</div></div><p>Plusieurs <em>targets</em> sont disponibles :</p><ul><li><code>main</code> : Lance tout ce qui suit ;</li><li><code>clean</code> ;</li><li><code>pdepend</code> : Lance l&#8217;analyse de code statique avec <a
href="http://pdepend.org/">PHP Depend</a> ;</li><li><code>phpcpd</code> : Lance l&#8217;analyse de code dupliqué <a
href="https://github.com/sebastianbergmann/phpcpd">PHPCPD</a> ;</li><li><code>phpcs</code> : Lance l&#8217;analyse checkstyle avec <a
href="http://pear.php.net/package/PHP_CodeSniffer">PHP_CodeSniffer</a> ;</li><li><code>phpdoc</code> : Lance la génération de la documentation avec <a
href="http://www.phpdoc.org/">phpDocumentor</a> ;</li><li><code>phploc</code> : Lance l&#8217;analyse <a
href="http://github.com/sebastianbergmann/phploc">PHPLoc</a> ;</li><li><code>phpmd</code> : Lance l&#8217;analyse <a
href="http://phpmd.org/">PHP Mess Detector</a>.</li></ul><p>D&#8217;autre part, j&#8217;ai mis à jour mes règles <strong>Checkstyle</strong> (<a
href="http://pear.php.net/package/PHP_CodeSniffer">PHP_CodeSniffer</a>) pour <strong>symfony 1.x</strong> : <a
href="http://github.com/willdurand/phpcs-symfony"><strong>phpcs-symfony</strong></a>.</p><div
class="codecolorer-container xml vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;?xml</span> <span
style="color: #000066;">version</span>=<span
style="color: #ff0000;">&quot;1.0&quot;</span><span
style="color: #000000; font-weight: bold;">?&gt;</span></span><br
/> &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;ruleset</span> <span
style="color: #000066;">name</span>=<span
style="color: #ff0000;">&quot;Symfony&quot;</span><span
style="color: #000000; font-weight: bold;">&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;description<span
style="color: #000000; font-weight: bold;">&gt;</span></span></span>symfony coding standard<span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;/description<span
style="color: #000000; font-weight: bold;">&gt;</span></span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #808080; font-style: italic;">&lt;!-- Tab indentation --&gt;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;rule</span> <span
style="color: #000066;">ref</span>=<span
style="color: #ff0000;">&quot;Generic.WhiteSpace.DisallowTabIndent&quot;</span><span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #808080; font-style: italic;">&lt;!-- symfony uses 2 spaces to indent --&gt;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;rule</span> <span
style="color: #000066;">ref</span>=<span
style="color: #ff0000;">&quot;Symfony.WhiteSpace.ScopeIndent&quot;</span><span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #808080; font-style: italic;">&lt;!-- --&gt;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;rule</span> <span
style="color: #000066;">ref</span>=<span
style="color: #ff0000;">&quot;Generic.ControlStructures.InlineControlStructure&quot;</span><span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #808080; font-style: italic;">&lt;!-- --&gt;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;rule</span> <span
style="color: #000066;">ref</span>=<span
style="color: #ff0000;">&quot;Symfony.ControlStructures.ControlSignature&quot;</span><span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #808080; font-style: italic;">&lt;!-- ensures there is no space after cast tokens --&gt;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;rule</span> <span
style="color: #000066;">ref</span>=<span
style="color: #ff0000;">&quot;Generic.Formatting.SpaceAfterCast&quot;</span><span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #808080; font-style: italic;">&lt;!-- ensures that variables are not passed by reference when calling a function --&gt;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;rule</span> <span
style="color: #000066;">ref</span>=<span
style="color: #ff0000;">&quot;Generic.Functions.CallTimePassByReference&quot;</span><span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #808080; font-style: italic;">&lt;!-- PHP constants should be lowercase --&gt;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;rule</span> <span
style="color: #000066;">ref</span>=<span
style="color: #ff0000;">&quot;Generic.PHP.LowerCaseConstant&quot;</span><span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #808080; font-style: italic;">&lt;!-- No spaces on square brackets --&gt;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;rule</span> <span
style="color: #000066;">ref</span>=<span
style="color: #ff0000;">&quot;Squiz.Arrays.ArrayBracketSpacing&quot;</span><span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #808080; font-style: italic;">&lt;!-- Don't allow ELSEIF, just ELSE IF --&gt;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;rule</span> <span
style="color: #000066;">ref</span>=<span
style="color: #ff0000;">&quot;Squiz.ControlStructures.ElseIfDeclaration&quot;</span><span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #808080; font-style: italic;">&lt;!-- Ensures there is a space between each condition of foreach loops --&gt;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;rule</span> <span
style="color: #000066;">ref</span>=<span
style="color: #ff0000;">&quot;Squiz.ControlStructures.ForEachLoopDeclaration&quot;</span><span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #808080; font-style: italic;">&lt;!-- Ensures there is a space between each condition of for loops --&gt;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;rule</span> <span
style="color: #000066;">ref</span>=<span
style="color: #ff0000;">&quot;Squiz.ControlStructures.ForLoopDeclaration&quot;</span><span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #808080; font-style: italic;">&lt;!-- Ensures all control structure keyworkds are lowercase --&gt;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;rule</span> <span
style="color: #000066;">ref</span>=<span
style="color: #ff0000;">&quot;Squiz.ControlStructures.LowercaseDeclaration&quot;</span><span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #808080; font-style: italic;">&lt;!-- Ensures all calls to inbuilt PHP functions are lowercase --&gt;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;rule</span> <span
style="color: #000066;">ref</span>=<span
style="color: #ff0000;">&quot;Squiz.PHP.LowercasePHPFunctions&quot;</span><span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #808080; font-style: italic;">&lt;!-- Verifies that class members have scope modifiers --&gt;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;rule</span> <span
style="color: #000066;">ref</span>=<span
style="color: #ff0000;">&quot;Squiz.Scope.MemberVarScope&quot;</span><span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #808080; font-style: italic;">&lt;!-- Verifies that class members have scope modifiers --&gt;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;rule</span> <span
style="color: #000066;">ref</span>=<span
style="color: #ff0000;">&quot;Squiz.Scope.MethodScope&quot;</span><span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;/ruleset<span
style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div><p>Après exécution sur mes projets, ces règles permettent de bien respecter les standards imposés par symfony <strong>1.x</strong> (uniquement).</p><p>Voilà pour les nouvelles <img
src='http://www.willdurand.fr/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p><h3 class='related_post_title'>Related Posts</h3><ul
class='related_post'><li><a
href='http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/' title='symfony rencontre Hudson, Mantis et les autres'>symfony rencontre Hudson, Mantis et les autres</a></li><li><a
href='http://www.willdurand.fr/faut-il-tester-les-tests/' title='Faut-il tester&#8230; les tests ?'>Faut-il tester&#8230; les tests ?</a></li><li><a
href='http://www.willdurand.fr/symfony-live-2011/' title='Symfony live 2011'>Symfony live 2011</a></li><li><a
href='http://www.willdurand.fr/creation-automatique-dun-projet-symfony-mysql-git-et-apache2/' title='Création automatique d&#8217;un projet symfony + MySQL + Git et Apache2'>Création automatique d&#8217;un projet symfony + MySQL + Git et Apache2</a></li><li><a
href='http://www.willdurand.fr/deploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem/' title='Déploiement automatisé avec Capistrano et Git pour symfony et Diem'>Déploiement automatisé avec Capistrano et Git pour symfony et Diem</a></li></ul> <a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/printfriendly.png" class="sociable-img sociable-hovers" title="Print" alt="Print" /></a><a
rel="nofollow" target="_blank"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F&amp;title=%20Symfony%2C%20Jenkins%20%26%20co&amp;bodytext=Bonjour%2C%0D%0A%0D%0ADepuis%20quelques%20temps%20j%27ai%20repris%20mes%20travaux%20d%C3%A9j%C3%A0%20%C3%A9nonc%C3%A9s%20%5Bsymfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres%5D%28http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F%29.%0D%0AJ%27ai%20mis%20%C3%A0%20disposition%20un%20_template%20g%C3%A9n%C3%A9rique_%20d" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a
rel="nofollow" target="_blank"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F&amp;title=%20Symfony%2C%20Jenkins%20%26%20co" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a
rel="nofollow" target="_blank"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F&amp;title=%20Symfony%2C%20Jenkins%20%26%20co&amp;notes=Bonjour%2C%0D%0A%0D%0ADepuis%20quelques%20temps%20j%27ai%20repris%20mes%20travaux%20d%C3%A9j%C3%A0%20%C3%A9nonc%C3%A9s%20%5Bsymfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres%5D%28http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F%29.%0D%0AJ%27ai%20mis%20%C3%A0%20disposition%20un%20_template%20g%C3%A9n%C3%A9rique_%20d" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a
rel="nofollow" target="_blank"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F&amp;t=%20Symfony%2C%20Jenkins%20%26%20co" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a
rel="nofollow" target="_blank"  href="http://twitter.com/home?status=%20Symfony%2C%20Jenkins%20%26%20co%20-%20http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a
rel="nofollow" target="_blank"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F&amp;title=%20Symfony%2C%20Jenkins%20%26%20co&amp;annotation=Bonjour%2C%0D%0A%0D%0ADepuis%20quelques%20temps%20j%27ai%20repris%20mes%20travaux%20d%C3%A9j%C3%A0%20%C3%A9nonc%C3%A9s%20%5Bsymfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres%5D%28http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F%29.%0D%0AJ%27ai%20mis%20%C3%A0%20disposition%20un%20_template%20g%C3%A9n%C3%A9rique_%20d" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a
rel="nofollow" target="_blank"  href="http://www.friendfeed.com/share?title=%20Symfony%2C%20Jenkins%20%26%20co&amp;link=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/friendfeed.png" class="sociable-img sociable-hovers" title="FriendFeed" alt="FriendFeed" /></a><a
rel="nofollow" target="_blank"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F&amp;title=%20Symfony%2C%20Jenkins%20%26%20co&amp;source=William%26%23039%3Bs+Blog+D%C3%A9veloppeur+web+ind%C3%A9pendant%2C+%C3%A9tudiant+et+passionn%C3%A9+%21+%23Symfony2+%23Rails+%23Diem+%23Git+%23Nginx+%23WebPerfs+%23SoftwareQuality&amp;summary=Bonjour%2C%0D%0A%0D%0ADepuis%20quelques%20temps%20j%27ai%20repris%20mes%20travaux%20d%C3%A9j%C3%A0%20%C3%A9nonc%C3%A9s%20%5Bsymfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres%5D%28http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F%29.%0D%0AJ%27ai%20mis%20%C3%A0%20disposition%20un%20_template%20g%C3%A9n%C3%A9rique_%20d" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a
rel="nofollow" target="_blank"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F&amp;t=%20Symfony%2C%20Jenkins%20%26%20co" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/myspace.png" class="sociable-img sociable-hovers" title="MySpace" alt="MySpace" /></a><a
rel="nofollow" target="_blank"  href="http://www.netvibes.com/share?title=%20Symfony%2C%20Jenkins%20%26%20co&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/netvibes.png" class="sociable-img sociable-hovers" title="Netvibes" alt="Netvibes" /></a><a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/pdf.png" class="sociable-img sociable-hovers" title="PDF" alt="PDF" /></a><a
rel="nofollow" target="_blank"  href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F&amp;title=%20Symfony%2C%20Jenkins%20%26%20co&amp;body=Bonjour%2C%0D%0A%0D%0ADepuis%20quelques%20temps%20j%27ai%20repris%20mes%20travaux%20d%C3%A9j%C3%A0%20%C3%A9nonc%C3%A9s%20%5Bsymfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres%5D%28http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F%29.%0D%0AJ%27ai%20mis%20%C3%A0%20disposition%20un%20_template%20g%C3%A9n%C3%A9rique_%20d" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/ping.png" class="sociable-img sociable-hovers" title="Ping.fm" alt="Ping.fm" /></a><a
rel="nofollow" target="_blank"  href="http://www.willdurand.fr/feed/" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><a
rel="nofollow" target="_blank"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/technorati.png" class="sociable-img sociable-hovers" title="Technorati" alt="Technorati" /></a><a
rel="nofollow" target="_blank"  href="http://www.viadeo.com/shareit/share/?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F&title=%20Symfony%2C%20Jenkins%20%26%20co&urllanguage=fr" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/viadeo.png" class="sociable-img sociable-hovers" title="viadeo FR" alt="viadeo FR" /></a><a
rel="nofollow" target="_blank"  href="http://www.wikio.com/vote?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/wikio.png" class="sociable-img sociable-hovers" title="Wikio" alt="Wikio" /></a><a
rel="nofollow" target="_blank"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-jenkins-co%2F&amp;submitHeadline=%20Symfony%2C%20Jenkins%20%26%20co&amp;submitSummary=Bonjour%2C%0D%0A%0D%0ADepuis%20quelques%20temps%20j%27ai%20repris%20mes%20travaux%20d%C3%A9j%C3%A0%20%C3%A9nonc%C3%A9s%20%5Bsymfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres%5D%28http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F%29.%0D%0AJ%27ai%20mis%20%C3%A0%20disposition%20un%20_template%20g%C3%A9n%C3%A9rique_%20d&amp;submitCategory=science&amp;submitAssetType=text" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/yahoobuzz.png" class="sociable-img sociable-hovers" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a><br
/><br
/>]]></content:encoded> <wfw:commentRss>http://www.willdurand.fr/symfony-jenkins-co/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Symfony live 2011</title><link>http://www.willdurand.fr/symfony-live-2011/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=symfony-live-2011</link> <comments>http://www.willdurand.fr/symfony-live-2011/#comments</comments> <pubDate>Wed, 02 Mar 2011 17:05:58 +0000</pubDate> <dc:creator>Will</dc:creator> <category><![CDATA[Ma vie]]></category> <category><![CDATA[symfony]]></category> <category><![CDATA[conférence]]></category> <category><![CDATA[Symfony]]></category> <category><![CDATA[symfony-live]]></category> <category><![CDATA[Symfony2]]></category><guid
isPermaLink="false">http://www.willdurand.fr/?p=825</guid> <description><![CDATA[J&#8217;y serai ! Voilà en gros tout ce que j&#8217;avais à dire dans cet article Pour étoffer un peu, Symfony Live c&#8217;est la conférence tendance pour les gens qui aiment [s&#124;S]ymfony, qui aiment PHP (pourquoi pas ?) et qui aiment bien discuter et écouter de bonnes conférences. C&#8217;est organisé par Sensio Labs, agence que l&#8217;on [...]]]></description> <content:encoded><![CDATA[<p
style="text-align: justify;"><strong>J&#8217;y serai !</strong></p><p
style="text-align: justify;">Voilà en gros tout ce que j&#8217;avais à dire dans cet article <img
src='http://www.willdurand.fr/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> Pour étoffer un peu, <a
href="http://symfony-live.com">Symfony Live</a> c&#8217;est la conférence tendance pour les gens qui aiment <strong>[s|S]ymfony</strong>, qui aiment PHP (pourquoi pas ?) et qui aiment bien discuter et écouter de bonnes conférences. C&#8217;est organisé par <a
href="http://sensiolabs.com">Sensio Labs</a>, agence que l&#8217;on ne présente plus, ça se déroule les 3 et 4 mars à Paris (Cité Internationale Universitaire) et c&#8217;est à peu près tout ce qu&#8217;il faut savoir.</p><p
style="text-align: justify;">Le vendredi soir, il y aura un meetup <strong>Github</strong> je ne sais trop où, comme d&#8217;hab&#8217; je vais essayer de pas me perdre dans Paris (d&#8217;ailleurs j&#8217;espère que mon stage me permettra également de me repérer un peu dans Paris&#8230;). Il y aura des conférences doublées donc comme au Forum PHP, il faudra faire des choix. J&#8217;ai fait quelques choix, les voici :</p><h2 style="text-align: justify;">Jeudi</h2><p
style="text-align: justify;">10h30-11h20 : Je ne sais pas&#8230;</p><p
style="text-align: justify;">11h30-12h20 : <a
href="http://www.symfony-live.com/paris/schedule#session-xl1">Restful avec symfony et Symfony2</a> par deux compères de CleverAge : Xavier Lacot et Damien Alexandre.</p><p
style="text-align: justify;">13h30-14h20 : <a
href="http://www.symfony-live.com/paris/schedule#session-sc1">Contributing with Git : Reducing the frictions of Open Source collaboration with the Git VCS</a> par Scott Chacon (ce mec travaille chez <a
href="http://www.github.com">Github</a> !!)</p><p
style="text-align: justify;">14h30-15h20 : je ne sais pas.</p><p
style="text-align: justify;">15h30-16h20 : je ne sais pas non plus.</p><p
style="text-align: justify;">16h30-17h20 : <a
href="http://www.symfony-live.com/paris/schedule#session-bs2">Leveraging Symfony2 Forms</a> par Bernhard Schussek (histoire de pas galérer sur les forms&#8230;)</p><h2 style="text-align: justify;">Vendredi</h2><p
style="text-align: justify;">8h30-9h20 : <a
href="http://www.symfony-live.com/paris/schedule#session-lksjw1">Symfony2 &#8211; from the trenches</a> par Lukas Kahwe Smith et Jonathan Wage (le titre déchirait !)</p><p
style="text-align: justify;">9h30-10h20 : <a
href="http://www.symfony-live.com/paris/schedule#session-kw1">Introducing Assetic: Asset Management for PHP 5.3</a> par Kris Wallsmith.</p><p
style="text-align: justify;">10h30-11h20 : <a
href="http://www.symfony-live.com/paris/schedule#session-fp1">HTTP Cache</a> par <del>dieu</del> Fabien Potencier. (Et là, ce fût le plus gros dilemme&#8230;. Je voulais tellement voir cette conférence sur Solr <img
src='http://www.willdurand.fr/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> )</p><p
style="text-align: justify;">11h30-12h20 : <a
href="http://www.symfony-live.com/paris/schedule#session-kl1">Varnish Cache and you</a> par Kristian Lyngstøl.</p><p
style="text-align: justify;">13h30-14h20 : <a
href="http://www.symfony-live.com/paris/schedule#session-hh1">Symfony2 en pièces détachées !</a> par Hugo Hamon. La conf&#8217; sur Twig semble sympa mais je pense qu&#8217;il y a plus à apprendre de l&#8217;ami Hugo.</p><p
style="text-align: justify;">14h30-15h20 : <a
href="http://www.symfony-live.com/paris/schedule#session-jw1">Doctrine in the Real World</a> par Jonathan Wage (encore !)</p><p
style="text-align: justify;">15h30-16h20 : <a
href="http://www.symfony-live.com/paris/schedule#session-ll1">Jeux sociaux, Symfony et Cloud Computing</a> par Laurent Letourmy (je les avais zappé lors du Forum PHP, je me rattrape ici).</p><p
style="text-align: justify;">16h30-17h20 : <a
href="http://www.symfony-live.com/paris/schedule#session-ar1">Iscool Story</a> par Alexandre Rodière et Bertrand Tornil (Weka again).</p><p
style="text-align: justify;">&nbsp;</p><p
style="text-align: justify;">Voilà, ce planning est susceptible de changer mais certainement pas trop. Je ferai comme d&#8217;hab&#8217; un résumé de chaque journée et pour chaque conférence vue.</p><p
style="text-align: justify;">A demain pour certain <img
src='http://www.willdurand.fr/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /></p><h3 class='related_post_title'>Related Posts</h3><ul
class='related_post'><li><a
href='http://www.willdurand.fr/symfony-live-2011-journee-2/' title='Symfony live 2011 &#8211; Journée 2'>Symfony live 2011 &#8211; Journée 2</a></li><li><a
href='http://www.willdurand.fr/symfony-live-2011-journee-1/' title='Symfony live 2011 &#8211; Journée 1'>Symfony live 2011 &#8211; Journée 1</a></li><li><a
href='http://www.willdurand.fr/tests-unitaires-et-fonctionnels-sur-un-bundle-en-symfony2/' title='Tests unitaires et fonctionnels sur un Bundle en Symfony2'>Tests unitaires et fonctionnels sur un Bundle en Symfony2</a></li><li><a
href='http://www.willdurand.fr/symfony-jenkins-co/' title=' Symfony, Jenkins &amp; co'> Symfony, Jenkins &#038; co</a></li><li><a
href='http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/' title='symfony rencontre Hudson, Mantis et les autres'>symfony rencontre Hudson, Mantis et les autres</a></li></ul> <a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/printfriendly.png" class="sociable-img sociable-hovers" title="Print" alt="Print" /></a><a
rel="nofollow" target="_blank"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F&amp;title=Symfony%20live%202011&amp;bodytext=J%27y%20serai%20%21%0D%0AVoil%C3%A0%20en%20gros%20tout%20ce%20que%20j%27avais%20%C3%A0%20dire%20dans%20cet%20article%20%3A-%29%20Pour%20%C3%A9toffer%20un%20peu%2C%20Symfony%20Live%20c%27est%20la%20conf%C3%A9rence%20tendance%20pour%20les%20gens%20qui%20aiment%20%5Bs%7CS%5Dymfony%2C%20qui%20aiment%20PHP%20%28pourquoi%20pas%20%3F%29%20et%20qui%20aiment%20bien%20discuter%20et%20%C3%A9coute" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a
rel="nofollow" target="_blank"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F&amp;title=Symfony%20live%202011" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a
rel="nofollow" target="_blank"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F&amp;title=Symfony%20live%202011&amp;notes=J%27y%20serai%20%21%0D%0AVoil%C3%A0%20en%20gros%20tout%20ce%20que%20j%27avais%20%C3%A0%20dire%20dans%20cet%20article%20%3A-%29%20Pour%20%C3%A9toffer%20un%20peu%2C%20Symfony%20Live%20c%27est%20la%20conf%C3%A9rence%20tendance%20pour%20les%20gens%20qui%20aiment%20%5Bs%7CS%5Dymfony%2C%20qui%20aiment%20PHP%20%28pourquoi%20pas%20%3F%29%20et%20qui%20aiment%20bien%20discuter%20et%20%C3%A9coute" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a
rel="nofollow" target="_blank"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F&amp;t=Symfony%20live%202011" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a
rel="nofollow" target="_blank"  href="http://twitter.com/home?status=Symfony%20live%202011%20-%20http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a
rel="nofollow" target="_blank"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F&amp;title=Symfony%20live%202011&amp;annotation=J%27y%20serai%20%21%0D%0AVoil%C3%A0%20en%20gros%20tout%20ce%20que%20j%27avais%20%C3%A0%20dire%20dans%20cet%20article%20%3A-%29%20Pour%20%C3%A9toffer%20un%20peu%2C%20Symfony%20Live%20c%27est%20la%20conf%C3%A9rence%20tendance%20pour%20les%20gens%20qui%20aiment%20%5Bs%7CS%5Dymfony%2C%20qui%20aiment%20PHP%20%28pourquoi%20pas%20%3F%29%20et%20qui%20aiment%20bien%20discuter%20et%20%C3%A9coute" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a
rel="nofollow" target="_blank"  href="http://www.friendfeed.com/share?title=Symfony%20live%202011&amp;link=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/friendfeed.png" class="sociable-img sociable-hovers" title="FriendFeed" alt="FriendFeed" /></a><a
rel="nofollow" target="_blank"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F&amp;title=Symfony%20live%202011&amp;source=William%26%23039%3Bs+Blog+D%C3%A9veloppeur+web+ind%C3%A9pendant%2C+%C3%A9tudiant+et+passionn%C3%A9+%21+%23Symfony2+%23Rails+%23Diem+%23Git+%23Nginx+%23WebPerfs+%23SoftwareQuality&amp;summary=J%27y%20serai%20%21%0D%0AVoil%C3%A0%20en%20gros%20tout%20ce%20que%20j%27avais%20%C3%A0%20dire%20dans%20cet%20article%20%3A-%29%20Pour%20%C3%A9toffer%20un%20peu%2C%20Symfony%20Live%20c%27est%20la%20conf%C3%A9rence%20tendance%20pour%20les%20gens%20qui%20aiment%20%5Bs%7CS%5Dymfony%2C%20qui%20aiment%20PHP%20%28pourquoi%20pas%20%3F%29%20et%20qui%20aiment%20bien%20discuter%20et%20%C3%A9coute" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a
rel="nofollow" target="_blank"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F&amp;t=Symfony%20live%202011" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/myspace.png" class="sociable-img sociable-hovers" title="MySpace" alt="MySpace" /></a><a
rel="nofollow" target="_blank"  href="http://www.netvibes.com/share?title=Symfony%20live%202011&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/netvibes.png" class="sociable-img sociable-hovers" title="Netvibes" alt="Netvibes" /></a><a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/pdf.png" class="sociable-img sociable-hovers" title="PDF" alt="PDF" /></a><a
rel="nofollow" target="_blank"  href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F&amp;title=Symfony%20live%202011&amp;body=J%27y%20serai%20%21%0D%0AVoil%C3%A0%20en%20gros%20tout%20ce%20que%20j%27avais%20%C3%A0%20dire%20dans%20cet%20article%20%3A-%29%20Pour%20%C3%A9toffer%20un%20peu%2C%20Symfony%20Live%20c%27est%20la%20conf%C3%A9rence%20tendance%20pour%20les%20gens%20qui%20aiment%20%5Bs%7CS%5Dymfony%2C%20qui%20aiment%20PHP%20%28pourquoi%20pas%20%3F%29%20et%20qui%20aiment%20bien%20discuter%20et%20%C3%A9coute" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/ping.png" class="sociable-img sociable-hovers" title="Ping.fm" alt="Ping.fm" /></a><a
rel="nofollow" target="_blank"  href="http://www.willdurand.fr/feed/" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><a
rel="nofollow" target="_blank"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/technorati.png" class="sociable-img sociable-hovers" title="Technorati" alt="Technorati" /></a><a
rel="nofollow" target="_blank"  href="http://www.viadeo.com/shareit/share/?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F&title=Symfony%20live%202011&urllanguage=fr" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/viadeo.png" class="sociable-img sociable-hovers" title="viadeo FR" alt="viadeo FR" /></a><a
rel="nofollow" target="_blank"  href="http://www.wikio.com/vote?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/wikio.png" class="sociable-img sociable-hovers" title="Wikio" alt="Wikio" /></a><a
rel="nofollow" target="_blank"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-live-2011%2F&amp;submitHeadline=Symfony%20live%202011&amp;submitSummary=J%27y%20serai%20%21%0D%0AVoil%C3%A0%20en%20gros%20tout%20ce%20que%20j%27avais%20%C3%A0%20dire%20dans%20cet%20article%20%3A-%29%20Pour%20%C3%A9toffer%20un%20peu%2C%20Symfony%20Live%20c%27est%20la%20conf%C3%A9rence%20tendance%20pour%20les%20gens%20qui%20aiment%20%5Bs%7CS%5Dymfony%2C%20qui%20aiment%20PHP%20%28pourquoi%20pas%20%3F%29%20et%20qui%20aiment%20bien%20discuter%20et%20%C3%A9coute&amp;submitCategory=science&amp;submitAssetType=text" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/yahoobuzz.png" class="sociable-img sociable-hovers" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a><br
/><br
/>]]></content:encoded> <wfw:commentRss>http://www.willdurand.fr/symfony-live-2011/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>symfony rencontre Hudson, Mantis et les autres</title><link>http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=symfony-rencontre-hudson-mantis-et-les-autres</link> <comments>http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/#comments</comments> <pubDate>Fri, 27 Aug 2010 09:51:53 +0000</pubDate> <dc:creator>Will</dc:creator> <category><![CDATA[Boulot]]></category> <category><![CDATA[symfony]]></category> <category><![CDATA[Checkstyle]]></category> <category><![CDATA[Couverture de code]]></category> <category><![CDATA[Hudson]]></category> <category><![CDATA[Mantis]]></category> <category><![CDATA[Pdepend]]></category> <category><![CDATA[Phing]]></category> <category><![CDATA[PhpDocumentor]]></category> <category><![CDATA[PHP_CodeSniffer]]></category> <category><![CDATA[Symfony]]></category> <category><![CDATA[Tests fonctionnels]]></category> <category><![CDATA[Tests unitaires]]></category><guid
isPermaLink="false">http://www.willdurand.fr/?p=608</guid> <description><![CDATA[Bonjour, depuis un certain temps déjà, je me pose deux questions : &#171;&#160;comment améliorer mon travail ?&#160;&#187; et&#8230; &#171;&#160;Comment améliorer mon travail ?&#160;&#187;. La première question traite essentiellement de ce que je produis, du code écrit, des fonctionnalités que je mets en place, &#8230; tandis que la deuxième question définit mes conditions de travail. Autrement dit, [...]]]></description> <content:encoded><![CDATA[<p
style="text-align: justify;">Bonjour, depuis un certain temps déjà, je me pose deux questions : &laquo;&nbsp;comment améliorer mon travail ?&nbsp;&raquo; et&#8230; &laquo;&nbsp;Comment améliorer mon travail ?&nbsp;&raquo;. La première question traite essentiellement de ce que je produis, du code écrit, des fonctionnalités que je mets en place, &#8230; tandis que la deuxième question définit mes <span
style="text-decoration: underline;">conditions de travail</span>. Autrement dit, qu&#8217;est-ce qui va faire <span
style="text-decoration: underline;">la différence</span> entre tout le monde et moi (jeune entrepreneur) ? Et qu&#8217;est-ce qui va <span
style="text-decoration: underline;">me faciliter la vie</span> et ainsi impacter la première question ?</p><p
style="text-align: justify;">C&#8217;est là que les outils que je vais présenter dans cet article interviennent. Aujourd&#8217;hui je parlerai de <strong>Hudson</strong>, <strong>Mantis</strong>, <strong>Phing</strong>, <strong>Checkstyle</strong>, <strong>PhpDocumentor</strong>, <strong>Pdepend</strong> et je montrerai l&#8217;interconnexion de tout ça sur un projet <strong>symfony</strong>.</p><p
style="text-align: justify;"></p><h2>Mantis</h2><p
style="text-align: center;"><a
rel="attachment wp-att-626" href="http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/mantis/"><img
class="aligncenter size-large wp-image-626" title="mantis" src="http://www.willdurand.fr/wp-content/uploads/2010/08/mantis-1024x107.png" alt="" width="700" /></a></p><p
style="text-align: justify;"><strong>Mantis</strong> est un <strong>bug tracker</strong>, c&#8217;est-à-dire un <span
style="text-decoration: underline;">rapporteur de défaillances</span>. Il permet de consigner tous les problèmes survenus sur une application, de déclarer des <span
style="text-decoration: underline;">priorités</span> plus ou moins importantes mais surtout d&#8217;avoir un réel <span
style="text-decoration: underline;">échange</span> entre le rapporteur (le client) et l&#8217;équipe technique (composée de&#8230; moi). L&#8217;avantage d&#8217;avoir ce type d&#8217;outil dépasse ce que je viens de dire mais je m&#8217;en sers essentiellement pour avoir un endroit adapté où récolter les défaillances de mes applications. <strong>Mantis</strong> s&#8217;occupe d&#8217;avertir tous les gens concernés par <span
style="text-decoration: underline;">mail</span>, lorsqu&#8217;un bug est ajouté ou résolu par exemple. Ainsi, je ne perds aucun retour client auparavant stocké dans ma boîte mail sous forme de dizaines de mails et lorsque je résous un bug, le rapporteur concerné est <span
style="text-decoration: underline;">prévenu automatiquement</span>.</p><p
style="text-align: justify;">Nous allons voir pourquoi c&#8217;est si intéressant.</p><p
style="text-align: justify;"></p><h2>Hudson</h2><p
style="text-align: justify;">J&#8217;ai déjà parlé d&#8217;<strong>Hudson</strong>, sans vraiment rentrer dans les détails parce que je ne vais pas réécrire ce qui a déjà été publié <em>x</em> fois, mais cette fois-ci je vais rentrer plus dans les détails. Au passage, <strong>Hudson</strong> est un <span
style="text-decoration: underline;">serveur d&#8217;intégration continue</span>.</p><p
style="text-align: justify;">Pour un projet <strong>symfony</strong>, je crée un projet <em>freestyle</em>, connecté à <strong>Git</strong> avec un déclencheur sur tout changement dans le <em>repository </em>distant. J&#8217;ajoute ensuite une succession de tâches <strong>symfony</strong> :</p><p
style="text-align: justify;">- création du répertoire <em>log/</em></p><p
style="text-align: justify;">- suppression de la base de tests <strong>SQLite</strong></p><p
style="text-align: justify;">- création de la base de tests</p><p
style="text-align: justify;">- tests</p><p
style="text-align: justify;"></p><p
style="text-align: justify;">Ceci est un projet basique qui me permet d&#8217;avoir une intégration continue et une alerte rapide par mail si un problème survient.</p><p
style="text-align: justify;">Oui mais voilà, ce n&#8217;est pas suffisant, on peut mieux faire. J&#8217;ai parlé de <strong>Mantis</strong> juste avant, il serait bien de pouvoir connecter <strong>Hudson</strong> avec <strong>Mantis</strong>. C&#8217;est justement ce que fait le <a
href="http://wiki.hudson-ci.org/display/HUDSON/Mantis+Plugin"><strong>Mantis Plugin</strong></a> pour <strong>Hudson</strong>. Ainsi, si je &laquo;&nbsp;commit&nbsp;&raquo; une modification qui a résolue un bug, exemple :</p><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">fix issue 0000007</div></div><p
style="text-align: justify;">Le plugin va pouvoir lier ce changement avec la page <strong>Mantis</strong> du bug et ajouter les informations liées au commit. Dorénavant, lorsque je &laquo;&nbsp;commiterai&nbsp;&raquo; un fix, le rapporteur sera prévenu de la résolution du bug qu&#8217;il aura soumis. Le gain de temps est indéniable.</p><p
style="text-align: justify;">Configuration Hudson :</p><p
style="text-align: center;"><a
rel="attachment wp-att-625" href="http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/mantis_hudson/"><img
class="size-large wp-image-625 aligncenter" title="mantis_hudson" src="http://www.willdurand.fr/wp-content/uploads/2010/08/mantis_hudson-1024x83.png" alt="" width="700" /></a></p><p
style="text-align: justify;"></p><p
style="text-align: justify;"></p><p
style="text-align: justify;">Mais on peut (encore) faire mieux d&#8217;une autre manière, c&#8217;est-à-dire que si la <em>build</em> est un succès, pourquoi ne pas la déployer. Pour avoir un changement, je dois faire un &laquo;&nbsp;push&nbsp;&raquo; vers le <em>repository</em> distant. Or, on ne &laquo;&nbsp;push&nbsp;&raquo; pas tous les jours ou du moins, pas derrière chaque commit. Ce serait un peu perdre l&#8217;avantage du mode décentralisé de <strong>Git</strong>. Ainsi, quand je choisis de faire un &laquo;&nbsp;push&nbsp;&raquo; c&#8217;est que j&#8217;estime avoir suffisamment modifié mon projet. Ceci m&#8217;amène à penser qu&#8217;il devient intéressant de le déployer.</p><p
style="text-align: justify;">Merci à <strong>Capistrano</strong> (<a
href="http://www.willdurand.fr/deploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem/">lire ici mon article sur le déploiement d&#8217;applis symfony et diem avec Capistrano</a>) et au <a
href="http://wiki.hudson-ci.org/display/HUDSON/SSH+plugin">S<strong>SH Plugin</strong></a> d&#8217;<strong>Hudson</strong>. Ce plugin n&#8217;est pas des plus parfaits mais il fonctionne. Si la build passe, je lance mon déploiement. Normalement, le déploiement n&#8217;échoue pas, si c&#8217;était le cas alors : capistrano ferait un rollback sur la dernière version fonctionnelle et les logs Hudson m&#8217;indiqueraient le problème. Je peux donc être rassuré de ce côté-là.</p><p
style="text-align: justify;">Jusqu&#8217;à présent, je n&#8217;ai parlé que d&#8217;automatisation des aspects &laquo;&nbsp;après développement&nbsp;&raquo; à savoir les <em>feedbacks</em> client et le déploiement. Ce sont les deux points essentiels après réussite des tests. Pour autant, <strong>Hudson</strong> peut aider l&#8217;équipe de développeurs en effectuant une série d&#8217;analyses.</p><p
style="text-align: justify;"></p><h2>Phing : l&#8217;Ant des temps modernes (ou pas)</h2><p
style="text-align: justify;"><strong>Phing</strong>, c&#8217;est <strong>Ant</strong> (utilisé dans le monde Java) version PHP, en quelques mots, un outil d&#8217;automatisation de tâches répétitives. Il faut connaître Ant pour comprendre qu&#8217;il est génial de disposer d&#8217;un outil semblable pour PHP. C&#8217;est grâce à cet outil que je génère des rapports d&#8217;analyse.</p><p
style="text-align: justify;"><strong>Phing</strong> s&#8217;installe via <strong>PEAR</strong>.</p><p
style="text-align: justify;"></p><h2>Checkstyle : mon code a du style !</h2><p
style="text-align: justify;"><strong>Checkstyle</strong> est un outil de contrôle de code. Il vérifie le style du code écrit (indentation, commentaires, &#8230;). Pour l&#8217;utiliser avec PHP, il faut <a
href="http://pear.php.net/package/PHP_CodeSniffer"><strong>PHP_CodeSniffer</strong></a> (on abrège en <em>phpcs</em>) et le <strong><a
href="http://wiki.hudson-ci.org/display/HUDSON/Checkstyle+Plugin">Checkstyle Plugin</a></strong> d&#8217;<strong>Hudson</strong>. Pour l&#8217;utiliser avec <strong>symfony</strong>, on ajoutera le <em>standard</em> symfony : <a
href="http://github.com/denderello/phpcs-symfony">http://github.com/denderello/phpcs-symfony</a> ou si vous utilisez la toute dernière version : <a
href="http://github.com/willdurand/phpcs-symfony">http://github.com/willdurand/phpcs-symfony</a>.</p><p
style="text-align: justify;">Configuration Hudson :</p><p
style="text-align: center;"><a
rel="attachment wp-att-612" href="http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/checkstyle/"><img
class="aligncenter size-large wp-image-612" title="checkstyle" src="http://www.willdurand.fr/wp-content/uploads/2010/08/checkstyle-1024x127.png" alt="" width="700" /></a></p><p
style="text-align: justify;">Configuration du <em>build.xml</em> (Phing) :</p><div
class="codecolorer-container xml vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #808080; font-style: italic;">&lt;!-- PHP CodeSniffer --&gt;</span><br
/> <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;target</span> <span
style="color: #000066;">name</span>=<span
style="color: #ff0000;">&quot;phpcs&quot;</span><span
style="color: #000000; font-weight: bold;">&gt;</span></span><br
/> &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;echo</span> <span
style="color: #000066;">msg</span>=<span
style="color: #ff0000;">&quot;PHP CodeSniffer...&quot;</span> <span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;exec</span> <span
style="color: #000066;">command</span>=<span
style="color: #ff0000;">&quot;phpcs --standard=Symfony --report=checkstyle ${workspace}/apps ${workspace}/lib/filter ${workspace}/lib/form ${workspace}/lib/model ${workspace}/lib/validator ${workspace}/test&quot;</span> <span
style="color: #000000; font-weight: bold;">&gt;</span></span> ${workspace}/log/checkstyle.xml&quot; escape=&quot;false&quot;&gt;<span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;/exec<span
style="color: #000000; font-weight: bold;">&gt;</span></span></span><br
/> <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;/target<span
style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div><p
style="text-align: justify;">Et aperçu du résultat :</p><p
style="text-align: justify;"><a
rel="attachment wp-att-622" href="http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/checkstyle_report/"><img
class="aligncenter size-full wp-image-622" title="checkstyle_report" src="http://www.willdurand.fr/wp-content/uploads/2010/08/checkstyle_report.png" alt="" width="505" height="222" /></a></p><p
style="text-align: justify;"></p><h2>Pdepend : analyse de code statique</h2><p
style="text-align: justify;"><strong><a
href="http://pdepend.org/news.html">Pdepend</a></strong>, analyseur de code statique, permet de calculer des indices (couplage, instabilité, &#8230;) afin de déterminer la qualité du code de la <em>build</em>. Pour cela, il nous faut le <strong><a
href="http://wiki.hudson-ci.org/display/HUDSON/JDepend+Plugin">Jdepend Plugin</a></strong> d&#8217;<strong>Hudson</strong> et avoir installé <strong>pdepend</strong>.</p><p
style="text-align: justify;">Configuration Hudson :</p><p
style="text-align: center;"><a
rel="attachment wp-att-621" href="http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/pdepend/"><img
class="aligncenter size-large wp-image-621" title="pdepend" src="http://www.willdurand.fr/wp-content/uploads/2010/08/pdepend-1024x95.png" alt="" width="700" /></a></p><p
style="text-align: justify;">Configuration du <em>build.xml</em> :</p><div
class="codecolorer-container xml vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #808080; font-style: italic;">&lt;!-- PHP dependency checker --&gt;</span><br
/> &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;target</span> <span
style="color: #000066;">name</span>=<span
style="color: #ff0000;">&quot;pdepend&quot;</span><span
style="color: #000000; font-weight: bold;">&gt;</span></span><br
/> &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;echo</span> <span
style="color: #000066;">msg</span>=<span
style="color: #ff0000;">&quot;PHP Depend...&quot;</span> <span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;exec</span> <span
style="color: #000066;">command</span>=<span
style="color: #ff0000;">&quot;pdepend --jdepend-xml=${workspace}/log/jdepend.xml ${workspace}/apps,${workspace}/lib/filter,${workspace}/lib/form,${workspace}/lib/model,${workspace}/lib/validator,${workspace}/test&quot;</span> <span
style="color: #000066;">escape</span>=<span
style="color: #ff0000;">&quot;false&quot;</span> <span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;/target<span
style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div><p
style="text-align: justify;"></p><h2>DRY ! Analyser les répétitions de code</h2><p>Don&#8217;t Repeat Yourself, adage <strong>symfony</strong>, on souhaite ici analyser le code dupliqué. Pour cela, on utilise <strong>phpcpd</strong> (toujours via <strong>PEAR</strong>) ainsi que le <strong><a
href="http://wiki.hudson-ci.org/display/HUDSON/DRY+Plugin">DRY Plugin</a></strong> d&#8217;<strong>Hudson</strong>.</p><p>Configuration Hudson :</p><p
style="text-align: justify;"><a
rel="attachment wp-att-623" href="http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/pmd/"><img
class="aligncenter size-large wp-image-623" title="pmd" src="http://www.willdurand.fr/wp-content/uploads/2010/08/pmd-1024x200.png" alt="" width="700" /></a>Configuration du <em>build.xml</em> :</p><div
class="codecolorer-container xml vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #808080; font-style: italic;">&lt;!-- PHP copy/paste analysis --&gt;</span><br
/> &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;target</span> <span
style="color: #000066;">name</span>=<span
style="color: #ff0000;">&quot;phpcpd&quot;</span><span
style="color: #000000; font-weight: bold;">&gt;</span></span><br
/> &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;echo</span> <span
style="color: #000066;">msg</span>=<span
style="color: #ff0000;">&quot;PHP Copy/Paste...&quot;</span> <span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;exec</span> <span
style="color: #000066;">command</span>=<span
style="color: #ff0000;">&quot;phpcpd --log-pmd ${workspace}/log/pmd.xml ${workspace}/apps ${workspace}/lib/filter ${workspace}/lib/form ${workspace}/lib/model ${workspace}/lib/validator ${workspace}/test&quot;</span> <span
style="color: #000066;">escape</span>=<span
style="color: #ff0000;">&quot;false&quot;</span> <span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;/target<span
style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div><p
style="text-align: justify;">Et aperçu du résultat :</p><p
style="text-align: justify;"><a
rel="attachment wp-att-624" href="http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/pmd_report/"><img
class="aligncenter size-full wp-image-624" title="pmd_report" src="http://www.willdurand.fr/wp-content/uploads/2010/08/pmd_report.png" alt="" width="506" height="217" /></a></p><p
style="text-align: justify;"></p><h2>PhpDocumentor : génération de la documentation du projet</h2><p
style="text-align: justify;">PhpDocumentor permet de générer la documentation d&#8217;un projet, tout comme Javadoc le ferait. Voici la configuration du<em> build.xml </em>:</p><div
class="codecolorer-container xml vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #808080; font-style: italic;">&lt;!-- PHP API Documentation --&gt;</span><br
/> <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;target</span> <span
style="color: #000066;">name</span>=<span
style="color: #ff0000;">&quot;phpdoc&quot;</span><span
style="color: #000000; font-weight: bold;">&gt;</span></span><br
/> &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;echo</span> <span
style="color: #000066;">msg</span>=<span
style="color: #ff0000;">&quot;PHP Documentor...&quot;</span> <span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;phpdoc</span> <span
style="color: #000066;">title</span>=<span
style="color: #ff0000;">&quot;API Documentation&quot;</span></span><br
/> <span
style="color: #009900;"> &nbsp; &nbsp;<span
style="color: #000066;">destdir</span>=<span
style="color: #ff0000;">&quot;${workspace}/doc&quot;</span></span><br
/> <span
style="color: #009900;"> &nbsp; &nbsp;<span
style="color: #000066;">sourcecode</span>=<span
style="color: #ff0000;">&quot;yes&quot;</span></span><br
/> <span
style="color: #009900;"> &nbsp; &nbsp;<span
style="color: #000066;">defaultpackagename</span>=<span
style="color: #ff0000;">&quot;sfProjetsGagnants&quot;</span></span><br
/> <span
style="color: #009900;"> &nbsp; &nbsp;<span
style="color: #000066;">output</span>=<span
style="color: #ff0000;">&quot;HTML:Smarty:PHP&quot;</span><span
style="color: #000000; font-weight: bold;">&gt;</span></span><br
/> &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;fileset</span> <span
style="color: #000066;">dir</span>=<span
style="color: #ff0000;">&quot;./apps&quot;</span><span
style="color: #000000; font-weight: bold;">&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;include</span> <span
style="color: #000066;">name</span>=<span
style="color: #ff0000;">&quot;**/*.class.php&quot;</span> <span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;/fileset<span
style="color: #000000; font-weight: bold;">&gt;</span></span></span><br
/> &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;fileset</span> <span
style="color: #000066;">dir</span>=<span
style="color: #ff0000;">&quot;./lib/model&quot;</span><span
style="color: #000000; font-weight: bold;">&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;include</span> <span
style="color: #000066;">name</span>=<span
style="color: #ff0000;">&quot;**/*.class.php&quot;</span> <span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;exclude</span> <span
style="color: #000066;">name</span>=<span
style="color: #ff0000;">&quot;**/Base*&quot;</span> <span
style="color: #000000; font-weight: bold;">/&gt;</span></span><br
/> &nbsp; &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;/fileset<span
style="color: #000000; font-weight: bold;">&gt;</span></span></span><br
/> &nbsp; <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;/phpdoc<span
style="color: #000000; font-weight: bold;">&gt;</span></span></span><br
/> <span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;/target<span
style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div><p
style="text-align: justify;"></p><p
style="text-align: justify;">On pourrait ajouter le <strong><a
href="http://wiki.hudson-ci.org/display/HUDSON/DocLinks+Plugin">DocLinks Plugin</a></strong> pour <strong>Hudson</strong> afin de lier la documentation générée à chaque <em>build</em>.</p><p
style="text-align: justify;"></p><h2>Invoquer Phing</h2><p
style="text-align: justify;">Pour invoquer <strong>Phing</strong> dans <strong>Hudson</strong>, on peut soit utiliser le plugin qui gère Phing soit utiliser une commande shell. Je préfère la commande shell pour pouvoir passer des paramètres à mon script.</p><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #7a0874; font-weight: bold;">cd</span> <span
style="color: #007800;">$WORKSPACE</span> <span
style="color: #000000; font-weight: bold;">&amp;&amp;</span> phing main <span
style="color: #660033;">-Dworkspace</span>=<span
style="color: #007800;">$WORKSPACE</span></div></div><h2>Couverture de code</h2><p
style="text-align: justify;">Là je vous laisse lire <a
href="http://www.pmsipilot.org/2010/06/16/code-coverage-des-tests-unitaires-dun-projet-symfony-et-integration-dans-hudson-ci/">cet article</a> qui explique comment obtenir des rapports de couverture de code <strong>symfony</strong> dans <strong>Hudson</strong>.</p><h2 style="text-align: justify;">Conclusion</h2><p
style="text-align: justify;">En plus d&#8217;automatiser un certain nombre de tâches, j&#8217;obtiens des retours sur mon projet : des retours client grâce à <strong>Mantis</strong> et des retours sur la qualité de mon travail. Aujourd&#8217;hui, des outils pour PHP sont là, il est clair que PHP s&#8217;industrialise et grâce à la qualité du framework <strong>symfony</strong>, il devient intéressant d&#8217;adopter les bonnes méthodes et d&#8217;utiliser ces outils. PHP, ce n&#8217;est plus &laquo;&nbsp;<em>Un mini-chat en PHP</em>&nbsp;&raquo; par le <a
href="http://www.siteduzero.com/tutoriel-3-14668-concevez-votre-site-web-avec-php-et-mysql.html">Site du Zéro</a>.</p><p
style="text-align: center;"><object
id="__sse2083732" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param
name="allowFullScreen" value="true" /><param
name="allowScriptAccess" value="always" /><param
name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=php-unetechnologieauservicedelagilit-090928134735-phpapp01&#038;stripped_title=php-une-technologie-au-service-de-lagilit" /><param
name="name" value="__sse2083732" /><param
name="allowfullscreen" value="true" /><embed
id="__sse2083732" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=php-unetechnologieauservicedelagilit-090928134735-phpapp01&#038;stripped_title=php-une-technologie-au-service-de-lagilit" name="__sse2083732" allowscriptaccess="always" allowfullscreen="true"> </embed></object></p><p
style="text-align: right;"></p><p
style="text-align: right;"></p><p
style="text-align: right;"><em>Il n&#8217;est jamais trop tard pour commencer à bien travailler.</em></p><h3 class='related_post_title'>Related Posts</h3><ul
class='related_post'><li><a
href='http://www.willdurand.fr/symfony-jenkins-co/' title=' Symfony, Jenkins &amp; co'> Symfony, Jenkins &#038; co</a></li><li><a
href='http://www.willdurand.fr/faut-il-tester-les-tests/' title='Faut-il tester&#8230; les tests ?'>Faut-il tester&#8230; les tests ?</a></li><li><a
href='http://www.willdurand.fr/tests-unitaires-et-fonctionnels-sur-un-bundle-en-symfony2/' title='Tests unitaires et fonctionnels sur un Bundle en Symfony2'>Tests unitaires et fonctionnels sur un Bundle en Symfony2</a></li><li><a
href='http://www.willdurand.fr/symfony-live-2011/' title='Symfony live 2011'>Symfony live 2011</a></li><li><a
href='http://www.willdurand.fr/creation-automatique-dun-projet-symfony-mysql-git-et-apache2/' title='Création automatique d&#8217;un projet symfony + MySQL + Git et Apache2'>Création automatique d&#8217;un projet symfony + MySQL + Git et Apache2</a></li></ul> <a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/printfriendly.png" class="sociable-img sociable-hovers" title="Print" alt="Print" /></a><a
rel="nofollow" target="_blank"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F&amp;title=symfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres&amp;bodytext=Bonjour%2C%C2%A0depuis%20un%20certain%20temps%20d%C3%A9j%C3%A0%2C%20je%20me%20pose%20deux%20questions%20%3A%20%22comment%20am%C3%A9liorer%20mon%20travail%20%3F%22%20et...%20%22Comment%20am%C3%A9liorer%20mon%20travail%20%3F%22.%20La%20premi%C3%A8re%20question%20traite%20essentiellement%20de%20ce%20que%20je%20produis%2C%20du%20code%20%C3%A9crit%2C%20des%20fonctionnalit%C3%A9s" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a
rel="nofollow" target="_blank"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F&amp;title=symfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a
rel="nofollow" target="_blank"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F&amp;title=symfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres&amp;notes=Bonjour%2C%C2%A0depuis%20un%20certain%20temps%20d%C3%A9j%C3%A0%2C%20je%20me%20pose%20deux%20questions%20%3A%20%22comment%20am%C3%A9liorer%20mon%20travail%20%3F%22%20et...%20%22Comment%20am%C3%A9liorer%20mon%20travail%20%3F%22.%20La%20premi%C3%A8re%20question%20traite%20essentiellement%20de%20ce%20que%20je%20produis%2C%20du%20code%20%C3%A9crit%2C%20des%20fonctionnalit%C3%A9s" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a
rel="nofollow" target="_blank"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F&amp;t=symfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a
rel="nofollow" target="_blank"  href="http://twitter.com/home?status=symfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres%20-%20http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a
rel="nofollow" target="_blank"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F&amp;title=symfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres&amp;annotation=Bonjour%2C%C2%A0depuis%20un%20certain%20temps%20d%C3%A9j%C3%A0%2C%20je%20me%20pose%20deux%20questions%20%3A%20%22comment%20am%C3%A9liorer%20mon%20travail%20%3F%22%20et...%20%22Comment%20am%C3%A9liorer%20mon%20travail%20%3F%22.%20La%20premi%C3%A8re%20question%20traite%20essentiellement%20de%20ce%20que%20je%20produis%2C%20du%20code%20%C3%A9crit%2C%20des%20fonctionnalit%C3%A9s" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a
rel="nofollow" target="_blank"  href="http://www.friendfeed.com/share?title=symfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres&amp;link=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/friendfeed.png" class="sociable-img sociable-hovers" title="FriendFeed" alt="FriendFeed" /></a><a
rel="nofollow" target="_blank"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F&amp;title=symfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres&amp;source=William%26%23039%3Bs+Blog+D%C3%A9veloppeur+web+ind%C3%A9pendant%2C+%C3%A9tudiant+et+passionn%C3%A9+%21+%23Symfony2+%23Rails+%23Diem+%23Git+%23Nginx+%23WebPerfs+%23SoftwareQuality&amp;summary=Bonjour%2C%C2%A0depuis%20un%20certain%20temps%20d%C3%A9j%C3%A0%2C%20je%20me%20pose%20deux%20questions%20%3A%20%22comment%20am%C3%A9liorer%20mon%20travail%20%3F%22%20et...%20%22Comment%20am%C3%A9liorer%20mon%20travail%20%3F%22.%20La%20premi%C3%A8re%20question%20traite%20essentiellement%20de%20ce%20que%20je%20produis%2C%20du%20code%20%C3%A9crit%2C%20des%20fonctionnalit%C3%A9s" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a
rel="nofollow" target="_blank"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F&amp;t=symfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/myspace.png" class="sociable-img sociable-hovers" title="MySpace" alt="MySpace" /></a><a
rel="nofollow" target="_blank"  href="http://www.netvibes.com/share?title=symfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/netvibes.png" class="sociable-img sociable-hovers" title="Netvibes" alt="Netvibes" /></a><a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/pdf.png" class="sociable-img sociable-hovers" title="PDF" alt="PDF" /></a><a
rel="nofollow" target="_blank"  href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F&amp;title=symfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres&amp;body=Bonjour%2C%C2%A0depuis%20un%20certain%20temps%20d%C3%A9j%C3%A0%2C%20je%20me%20pose%20deux%20questions%20%3A%20%22comment%20am%C3%A9liorer%20mon%20travail%20%3F%22%20et...%20%22Comment%20am%C3%A9liorer%20mon%20travail%20%3F%22.%20La%20premi%C3%A8re%20question%20traite%20essentiellement%20de%20ce%20que%20je%20produis%2C%20du%20code%20%C3%A9crit%2C%20des%20fonctionnalit%C3%A9s" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/ping.png" class="sociable-img sociable-hovers" title="Ping.fm" alt="Ping.fm" /></a><a
rel="nofollow" target="_blank"  href="http://www.willdurand.fr/feed/" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><a
rel="nofollow" target="_blank"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/technorati.png" class="sociable-img sociable-hovers" title="Technorati" alt="Technorati" /></a><a
rel="nofollow" target="_blank"  href="http://www.viadeo.com/shareit/share/?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F&title=symfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres&urllanguage=fr" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/viadeo.png" class="sociable-img sociable-hovers" title="viadeo FR" alt="viadeo FR" /></a><a
rel="nofollow" target="_blank"  href="http://www.wikio.com/vote?url=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/wikio.png" class="sociable-img sociable-hovers" title="Wikio" alt="Wikio" /></a><a
rel="nofollow" target="_blank"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.willdurand.fr%2Fsymfony-rencontre-hudson-mantis-et-les-autres%2F&amp;submitHeadline=symfony%20rencontre%20Hudson%2C%20Mantis%20et%20les%20autres&amp;submitSummary=Bonjour%2C%C2%A0depuis%20un%20certain%20temps%20d%C3%A9j%C3%A0%2C%20je%20me%20pose%20deux%20questions%20%3A%20%22comment%20am%C3%A9liorer%20mon%20travail%20%3F%22%20et...%20%22Comment%20am%C3%A9liorer%20mon%20travail%20%3F%22.%20La%20premi%C3%A8re%20question%20traite%20essentiellement%20de%20ce%20que%20je%20produis%2C%20du%20code%20%C3%A9crit%2C%20des%20fonctionnalit%C3%A9s&amp;submitCategory=science&amp;submitAssetType=text" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/yahoobuzz.png" class="sociable-img sociable-hovers" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a><br
/><br
/>]]></content:encoded> <wfw:commentRss>http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/feed/</wfw:commentRss> <slash:comments>10</slash:comments> </item> <item><title>Création automatique d&#8217;un projet symfony + MySQL + Git et Apache2</title><link>http://www.willdurand.fr/creation-automatique-dun-projet-symfony-mysql-git-et-apache2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=creation-automatique-dun-projet-symfony-mysql-git-et-apache2</link> <comments>http://www.willdurand.fr/creation-automatique-dun-projet-symfony-mysql-git-et-apache2/#comments</comments> <pubDate>Sun, 15 Aug 2010 19:23:02 +0000</pubDate> <dc:creator>Will</dc:creator> <category><![CDATA[Serveur]]></category> <category><![CDATA[symfony]]></category> <category><![CDATA[Tips]]></category> <category><![CDATA[Apache2]]></category> <category><![CDATA[Script shell]]></category> <category><![CDATA[Symfony]]></category> <category><![CDATA[vhost]]></category><guid
isPermaLink="false">http://www.willdurand.fr/?p=573</guid> <description><![CDATA[On ne crée pas de projets symfony tous les jours c&#8217;est vrai, mais le processus est souvent le même. En plus de cela, je trouve les manip&#8217; un peu pénible quand il faut toucher à la configuration Apache2. Inspiré de cet article http://www.nacho-martin.com/automating-the-creation-of-new-symfony-1-4-projects-doctrine-git, j&#8217;ai écrit ma propre commande incluant la configuration d&#8217;un vhost Apache2. Je [...]]]></description> <content:encoded><![CDATA[<p
style="text-align: justify;">On ne crée pas de projets <strong>symfony</strong> tous les jours c&#8217;est vrai, mais le processus est souvent le même. En plus de cela, je trouve les manip&#8217; un peu pénible quand il faut toucher à la configuration Apache2. Inspiré de cet article <a
href="http://www.nacho-martin.com/automating-the-creation-of-new-symfony-1-4-projects-doctrine-git">http://www.nacho-martin.com/automating-the-creation-of-new-symfony-1-4-projects-doctrine-git</a>, j&#8217;ai écrit ma propre commande incluant la configuration d&#8217;un vhost Apache2. Je la partage ici.</p><p
style="text-align: justify;">Voici donc le script <em>mkSfProject</em> :</p><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #666666; font-style: italic;">#!/bin/bash</span><br
/> <br
/> <span
style="color: #007800;">SYMFREPO</span>=<span
style="color: #ff0000;">&quot;http://github.com/vjousse/symfony-1.4.git&quot;</span><br
/> <span
style="color: #007800;">DBUSER</span>=<span
style="color: #ff0000;">&quot;us3r&quot;</span><br
/> <span
style="color: #007800;">DBPASS</span>=<span
style="color: #ff0000;">&quot;p4ssw0rd&quot;</span><br
/> <span
style="color: #007800;">VENDOR_DIR</span>=<span
style="color: #ff0000;">&quot;lib/vendor/symfony&quot;</span><br
/> <span
style="color: #007800;">AUTHOR</span>=<span
style="color: #ff0000;">&quot;William DURAND &lt;william .durand1@gmail.com&gt;&quot;</span><br
/> <span
style="color: #007800;">PHP</span>=<span
style="color: #ff0000;">&quot;/usr/bin/php&quot;</span><br
/> <br
/> <span
style="color: #000000; font-weight: bold;">if</span> <span
style="color: #7a0874; font-weight: bold;">&#91;</span> <span
style="color: #660033;">-z</span> <span
style="color: #ff0000;">&quot;<span
style="color: #007800;">$DBPASS</span>&quot;</span> <span
style="color: #7a0874; font-weight: bold;">&#93;</span>; <span
style="color: #000000; font-weight: bold;">then</span><br
/> &nbsp;<span
style="color: #7a0874; font-weight: bold;">echo</span> edit <span
style="color: #007800;">$0</span> to add your mysql password on line <span
style="color: #000000;">4</span>: <span
style="color: #007800;">DBPASS</span>=<span
style="color: #000000; font-weight: bold;">\&quot;</span>password<span
style="color: #000000; font-weight: bold;">\&quot;</span><br
/> &nbsp;<span
style="color: #7a0874; font-weight: bold;">exit</span><br
/> <span
style="color: #000000; font-weight: bold;">fi</span><br
/> <br
/> <span
style="color: #000000; font-weight: bold;">if</span> <span
style="color: #7a0874; font-weight: bold;">&#91;</span> <span
style="color: #660033;">-z</span> <span
style="color: #ff0000;">&quot;$1&quot;</span> <span
style="color: #7a0874; font-weight: bold;">&#93;</span>; <span
style="color: #000000; font-weight: bold;">then</span><br
/> &nbsp;<span
style="color: #7a0874; font-weight: bold;">echo</span> usage: <span
style="color: #007800;">$0</span> project_name<br
/> &nbsp;<span
style="color: #7a0874; font-weight: bold;">exit</span><br
/> <span
style="color: #000000; font-weight: bold;">fi</span><br
/> <br
/> <span
style="color: #666666; font-style: italic;"># Create the project directory</span><br
/> <span
style="color: #c20cb9; font-weight: bold;">mkdir</span> <span
style="color: #007800;">$1</span><br
/> <span
style="color: #7a0874; font-weight: bold;">cd</span> <span
style="color: #007800;">$1</span><br
/> <br
/> <span
style="color: #c20cb9; font-weight: bold;">git</span> init<br
/> <span
style="color: #c20cb9; font-weight: bold;">git</span> clone <span
style="color: #007800;">$SYMFREPO</span> <span
style="color: #007800;">$VENDOR_DIR</span><br
/> <span
style="color: #c20cb9; font-weight: bold;">git</span> submodule add <span
style="color: #007800;">$SYMFREPO</span> <span
style="color: #007800;">$VENDOR_DIR</span><span
style="color: #000000; font-weight: bold;">/</span><br
/> <br
/> <span
style="color: #c20cb9; font-weight: bold;">git</span> submodule foreach <span
style="color: #ff0000;">'git submodule init &amp;&amp; git submodule update'</span><br
/> <br
/> <span
style="color: #c20cb9; font-weight: bold;">git</span> commit <span
style="color: #660033;">-m</span> <span
style="color: #ff0000;">'Initial commit; initialized symfony-git (1.4)'</span><br
/> <br
/> <span
style="color: #666666; font-style: italic;"># Generate the project</span><br
/> <span
style="color: #007800;">$PHP</span> <span
style="color: #007800;">$VENDOR_DIR</span><span
style="color: #000000; font-weight: bold;">/</span>data<span
style="color: #000000; font-weight: bold;">/</span>bin<span
style="color: #000000; font-weight: bold;">/</span>symfony generate:project <span
style="color: #007800;">$1</span><br
/> <br
/> <span
style="color: #666666; font-style: italic;"># Configure the author</span><br
/> <span
style="color: #007800;">$PHP</span> symfony configure:author <span
style="color: #ff0000;">&quot;<span
style="color: #007800;">$AUTHOR</span>&quot;</span><br
/> <br
/> <span
style="color: #666666; font-style: italic;"># Create the .gitignore file</span><br
/> <span
style="color: #7a0874; font-weight: bold;">echo</span> <span
style="color: #ff0000;">&quot;config/databases.yml&quot;</span> <span
style="color: #000000; font-weight: bold;">&gt;</span> .gitignore<br
/> <span
style="color: #7a0874; font-weight: bold;">echo</span> <span
style="color: #ff0000;">&quot;cache/*&quot;</span> <span
style="color: #000000; font-weight: bold;">&gt;&gt;</span> .gitignore<br
/> <span
style="color: #7a0874; font-weight: bold;">echo</span> <span
style="color: #ff0000;">&quot;log/*&quot;</span> <span
style="color: #000000; font-weight: bold;">&gt;&gt;</span> .gitignore<br
/> <br
/> <span
style="color: #666666; font-style: italic;"># Fix permissions</span><br
/> <span
style="color: #007800;">$PHP</span> symfony project:permissions<br
/> <br
/> <span
style="color: #666666; font-style: italic;"># Commit</span><br
/> <span
style="color: #c20cb9; font-weight: bold;">git</span> add .<br
/> <span
style="color: #c20cb9; font-weight: bold;">git</span> commit <span
style="color: #660033;">-m</span> <span
style="color: #ff0000;">'Initialized symfony project'</span><br
/> <br
/> <span
style="color: #666666; font-style: italic;"># Generate a default app and commit</span><br
/> <span
style="color: #007800;">$PHP</span> symfony generate:app frontend<br
/> <span
style="color: #c20cb9; font-weight: bold;">git</span> add .<br
/> <span
style="color: #c20cb9; font-weight: bold;">git</span> commit <span
style="color: #660033;">-m</span> <span
style="color: #ff0000;">'Initialized frontend application'</span><br
/> <br
/> <span
style="color: #666666; font-style: italic;"># Create the database and configure it in symfony</span><br
/> mysqladmin -u<span
style="color: #007800;">$DBUSER</span> -p<span
style="color: #007800;">$DBPASS</span> create <span
style="color: #007800;">$1</span><br
/> <span
style="color: #007800;">$PHP</span> symfony configure:database <span
style="color: #ff0000;">&quot;mysql:dbname=$1;hostname=localhost&quot;</span> <span
style="color: #007800;">$DBUSER</span> <span
style="color: #007800;">$DBPASS</span><br
/> <br
/> <span
style="color: #666666; font-style: italic;"># Create the local URL</span><br
/> <span
style="color: #007800;">URL_PROJECT</span>=<span
style="color: #000000; font-weight: bold;">`</span><span
style="color: #7a0874; font-weight: bold;">echo</span> <span
style="color: #ff0000;">&quot;$1.local&quot;</span> <span
style="color: #000000; font-weight: bold;">|</span> <span
style="color: #c20cb9; font-weight: bold;">tr</span> <span
style="color: #ff0000;">'[[:upper:]]'</span> <span
style="color: #ff0000;">'[[:lower:]]'</span><span
style="color: #000000; font-weight: bold;">`</span><br
/> <br
/> <span
style="color: #666666; font-style: italic;"># vhost config</span><br
/> <span
style="color: #c20cb9; font-weight: bold;">sudo</span> <span
style="color: #7a0874; font-weight: bold;">echo</span> <span
style="color: #ff0000;">&quot;<br
/> &lt;virtualhost *:80&gt;<br
/> &nbsp; ServerName <span
style="color: #007800;">$URL_PROJECT</span><br
/> <br
/> &nbsp; DocumentRoot <span
style="color: #000099; font-weight: bold;">\&quot;</span><span
style="color: #780078;">`pwd`</span>/web<span
style="color: #000099; font-weight: bold;">\&quot;</span><br
/> &nbsp; DirectoryIndex index.php<br
/> <br
/> &nbsp; &lt;directory <span
style="color: #000099; font-weight: bold;">\&quot;</span><span
style="color: #780078;">`pwd`</span><span
style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<br
/> &nbsp; &nbsp; AllowOverride All<br
/> &nbsp; &nbsp; Allow from all<br
/> &nbsp; &lt;/directory&gt;<br
/> <br
/> &nbsp; Alias /sf <span
style="color: #000099; font-weight: bold;">\&quot;</span><span
style="color: #780078;">`pwd`</span>/lib/vendor/symfony/data/web/sf<span
style="color: #000099; font-weight: bold;">\&quot;</span><br
/> &nbsp; &lt;directory <span
style="color: #000099; font-weight: bold;">\&quot;</span><span
style="color: #780078;">`pwd`</span>/lib/vendor/symfony/data/web/sf<span
style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<br
/> &nbsp; &nbsp; AllowOverride All<br
/> &nbsp; &nbsp; Allow from All<br
/> &nbsp; &lt;/directory&gt;<br
/> &lt;/virtualhost&gt;<br
/> &quot;</span> <span
style="color: #000000; font-weight: bold;">&gt;</span> <span
style="color: #ff0000;">&quot;/etc/apache2/sites-available/$1&quot;</span><br
/> <br
/> <span
style="color: #666666; font-style: italic;"># Add local url in /etc/hosts</span><br
/> <span
style="color: #c20cb9; font-weight: bold;">sudo</span> <span
style="color: #7a0874; font-weight: bold;">echo</span> <span
style="color: #ff0000;">&quot;127.0.0.1 &nbsp;<span
style="color: #007800;">$URL_PROJECT</span>&quot;</span> <span
style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span
style="color: #000000; font-weight: bold;">/</span>etc<span
style="color: #000000; font-weight: bold;">/</span>hosts<br
/> <br
/> <span
style="color: #666666; font-style: italic;"># Enable the vhost</span><br
/> <span
style="color: #c20cb9; font-weight: bold;">sudo</span> a2ensite <span
style="color: #007800;">$1</span><br
/> <br
/> <span
style="color: #666666; font-style: italic;"># Reload Apache2</span><br
/> <span
style="color: #c20cb9; font-weight: bold;">sudo</span> <span
style="color: #000000; font-weight: bold;">/</span>etc<span
style="color: #000000; font-weight: bold;">/</span>init.d<span
style="color: #000000; font-weight: bold;">/</span>apache2 reload</div></div><p
style="text-align: justify"></p><p
style="text-align: justify">Je lance cette commande et en moins d&#8217;une minute, j&#8217;ai accès à un projet <strong>symfony</strong> fonctionnel dans mon navigateur. Voilà <img
src='http://www.willdurand.fr/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p><p></p><h3 class='related_post_title'>Related Posts</h3><ul
class='related_post'><li><a
href='http://www.willdurand.fr/lerreur-suexec-policy-violation-avec-symfony-chez-ovh/' title='L&#8217;erreur &laquo;&nbsp;suexec policy violation&nbsp;&raquo; avec symfony (chez OVH&#8230;)'>L&#8217;erreur &laquo;&nbsp;suexec policy violation&nbsp;&raquo; avec symfony (chez OVH&#8230;)</a></li><li><a
href='http://www.willdurand.fr/symfony-jenkins-co/' title=' Symfony, Jenkins &amp; co'> Symfony, Jenkins &#038; co</a></li><li><a
href='http://www.willdurand.fr/symfony-live-2011/' title='Symfony live 2011'>Symfony live 2011</a></li><li><a
href='http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/' title='symfony rencontre Hudson, Mantis et les autres'>symfony rencontre Hudson, Mantis et les autres</a></li><li><a
href='http://www.willdurand.fr/deploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem/' title='Déploiement automatisé avec Capistrano et Git pour symfony et Diem'>Déploiement automatisé avec Capistrano et Git pour symfony et Diem</a></li></ul> <a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/printfriendly.png" class="sociable-img sociable-hovers" title="Print" alt="Print" /></a><a
rel="nofollow" target="_blank"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F&amp;title=Cr%C3%A9ation%20automatique%20d%27un%20projet%20symfony%20%2B%20MySQL%20%2B%20Git%20et%20Apache2&amp;bodytext=On%20ne%20cr%C3%A9e%20pas%20de%20projets%20symfony%20tous%20les%20jours%20c%27est%20vrai%2C%20mais%20le%20processus%20est%20souvent%20le%20m%C3%AAme.%20En%20plus%20de%20cela%2C%20je%20trouve%20les%20manip%27%20un%20peu%20p%C3%A9nible%20quand%20il%20faut%20toucher%20%C3%A0%20la%20configuration%20Apache2.%20Inspir%C3%A9%20de%20cet%20article%20http%3A%2F%2Fwww.nacho-ma" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a
rel="nofollow" target="_blank"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F&amp;title=Cr%C3%A9ation%20automatique%20d%27un%20projet%20symfony%20%2B%20MySQL%20%2B%20Git%20et%20Apache2" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a
rel="nofollow" target="_blank"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F&amp;title=Cr%C3%A9ation%20automatique%20d%27un%20projet%20symfony%20%2B%20MySQL%20%2B%20Git%20et%20Apache2&amp;notes=On%20ne%20cr%C3%A9e%20pas%20de%20projets%20symfony%20tous%20les%20jours%20c%27est%20vrai%2C%20mais%20le%20processus%20est%20souvent%20le%20m%C3%AAme.%20En%20plus%20de%20cela%2C%20je%20trouve%20les%20manip%27%20un%20peu%20p%C3%A9nible%20quand%20il%20faut%20toucher%20%C3%A0%20la%20configuration%20Apache2.%20Inspir%C3%A9%20de%20cet%20article%20http%3A%2F%2Fwww.nacho-ma" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a
rel="nofollow" target="_blank"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F&amp;t=Cr%C3%A9ation%20automatique%20d%27un%20projet%20symfony%20%2B%20MySQL%20%2B%20Git%20et%20Apache2" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a
rel="nofollow" target="_blank"  href="http://twitter.com/home?status=Cr%C3%A9ation%20automatique%20d%27un%20projet%20symfony%20%2B%20MySQL%20%2B%20Git%20et%20Apache2%20-%20http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a
rel="nofollow" target="_blank"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F&amp;title=Cr%C3%A9ation%20automatique%20d%27un%20projet%20symfony%20%2B%20MySQL%20%2B%20Git%20et%20Apache2&amp;annotation=On%20ne%20cr%C3%A9e%20pas%20de%20projets%20symfony%20tous%20les%20jours%20c%27est%20vrai%2C%20mais%20le%20processus%20est%20souvent%20le%20m%C3%AAme.%20En%20plus%20de%20cela%2C%20je%20trouve%20les%20manip%27%20un%20peu%20p%C3%A9nible%20quand%20il%20faut%20toucher%20%C3%A0%20la%20configuration%20Apache2.%20Inspir%C3%A9%20de%20cet%20article%20http%3A%2F%2Fwww.nacho-ma" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a
rel="nofollow" target="_blank"  href="http://www.friendfeed.com/share?title=Cr%C3%A9ation%20automatique%20d%27un%20projet%20symfony%20%2B%20MySQL%20%2B%20Git%20et%20Apache2&amp;link=http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/friendfeed.png" class="sociable-img sociable-hovers" title="FriendFeed" alt="FriendFeed" /></a><a
rel="nofollow" target="_blank"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F&amp;title=Cr%C3%A9ation%20automatique%20d%27un%20projet%20symfony%20%2B%20MySQL%20%2B%20Git%20et%20Apache2&amp;source=William%26%23039%3Bs+Blog+D%C3%A9veloppeur+web+ind%C3%A9pendant%2C+%C3%A9tudiant+et+passionn%C3%A9+%21+%23Symfony2+%23Rails+%23Diem+%23Git+%23Nginx+%23WebPerfs+%23SoftwareQuality&amp;summary=On%20ne%20cr%C3%A9e%20pas%20de%20projets%20symfony%20tous%20les%20jours%20c%27est%20vrai%2C%20mais%20le%20processus%20est%20souvent%20le%20m%C3%AAme.%20En%20plus%20de%20cela%2C%20je%20trouve%20les%20manip%27%20un%20peu%20p%C3%A9nible%20quand%20il%20faut%20toucher%20%C3%A0%20la%20configuration%20Apache2.%20Inspir%C3%A9%20de%20cet%20article%20http%3A%2F%2Fwww.nacho-ma" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a
rel="nofollow" target="_blank"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F&amp;t=Cr%C3%A9ation%20automatique%20d%27un%20projet%20symfony%20%2B%20MySQL%20%2B%20Git%20et%20Apache2" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/myspace.png" class="sociable-img sociable-hovers" title="MySpace" alt="MySpace" /></a><a
rel="nofollow" target="_blank"  href="http://www.netvibes.com/share?title=Cr%C3%A9ation%20automatique%20d%27un%20projet%20symfony%20%2B%20MySQL%20%2B%20Git%20et%20Apache2&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/netvibes.png" class="sociable-img sociable-hovers" title="Netvibes" alt="Netvibes" /></a><a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/pdf.png" class="sociable-img sociable-hovers" title="PDF" alt="PDF" /></a><a
rel="nofollow" target="_blank"  href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F&amp;title=Cr%C3%A9ation%20automatique%20d%27un%20projet%20symfony%20%2B%20MySQL%20%2B%20Git%20et%20Apache2&amp;body=On%20ne%20cr%C3%A9e%20pas%20de%20projets%20symfony%20tous%20les%20jours%20c%27est%20vrai%2C%20mais%20le%20processus%20est%20souvent%20le%20m%C3%AAme.%20En%20plus%20de%20cela%2C%20je%20trouve%20les%20manip%27%20un%20peu%20p%C3%A9nible%20quand%20il%20faut%20toucher%20%C3%A0%20la%20configuration%20Apache2.%20Inspir%C3%A9%20de%20cet%20article%20http%3A%2F%2Fwww.nacho-ma" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/ping.png" class="sociable-img sociable-hovers" title="Ping.fm" alt="Ping.fm" /></a><a
rel="nofollow" target="_blank"  href="http://www.willdurand.fr/feed/" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><a
rel="nofollow" target="_blank"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/technorati.png" class="sociable-img sociable-hovers" title="Technorati" alt="Technorati" /></a><a
rel="nofollow" target="_blank"  href="http://www.viadeo.com/shareit/share/?url=http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F&title=Cr%C3%A9ation%20automatique%20d%27un%20projet%20symfony%20%2B%20MySQL%20%2B%20Git%20et%20Apache2&urllanguage=fr" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/viadeo.png" class="sociable-img sociable-hovers" title="viadeo FR" alt="viadeo FR" /></a><a
rel="nofollow" target="_blank"  href="http://www.wikio.com/vote?url=http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/wikio.png" class="sociable-img sociable-hovers" title="Wikio" alt="Wikio" /></a><a
rel="nofollow" target="_blank"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.willdurand.fr%2Fcreation-automatique-dun-projet-symfony-mysql-git-et-apache2%2F&amp;submitHeadline=Cr%C3%A9ation%20automatique%20d%27un%20projet%20symfony%20%2B%20MySQL%20%2B%20Git%20et%20Apache2&amp;submitSummary=On%20ne%20cr%C3%A9e%20pas%20de%20projets%20symfony%20tous%20les%20jours%20c%27est%20vrai%2C%20mais%20le%20processus%20est%20souvent%20le%20m%C3%AAme.%20En%20plus%20de%20cela%2C%20je%20trouve%20les%20manip%27%20un%20peu%20p%C3%A9nible%20quand%20il%20faut%20toucher%20%C3%A0%20la%20configuration%20Apache2.%20Inspir%C3%A9%20de%20cet%20article%20http%3A%2F%2Fwww.nacho-ma&amp;submitCategory=science&amp;submitAssetType=text" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/yahoobuzz.png" class="sociable-img sociable-hovers" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a><br
/><br
/>]]></content:encoded> <wfw:commentRss>http://www.willdurand.fr/creation-automatique-dun-projet-symfony-mysql-git-et-apache2/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>Déploiement automatisé avec Capistrano et Git pour symfony et Diem</title><link>http://www.willdurand.fr/deploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=deploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem</link> <comments>http://www.willdurand.fr/deploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem/#comments</comments> <pubDate>Wed, 11 Aug 2010 09:09:24 +0000</pubDate> <dc:creator>Will</dc:creator> <category><![CDATA[Diem Project]]></category> <category><![CDATA[symfony]]></category> <category><![CDATA[Sysadmin]]></category> <category><![CDATA[Capistrano]]></category> <category><![CDATA[Déploiement]]></category> <category><![CDATA[Diem]]></category> <category><![CDATA[Git]]></category> <category><![CDATA[Murder]]></category> <category><![CDATA[Symfony]]></category><guid
isPermaLink="false">http://www.willdurand.fr/?p=550</guid> <description><![CDATA[Hier, j&#8217;introduisais mes directives de travail. Aujourd&#8217;hui je vais introduire un sujet souvent sensible : la mise en production. C&#8217;est une tâche qui peut être critique mais si l&#8217;on prend toutes les précautions, nous limitons les risques. On notera bien que le facteur chance est laissé à la porte pour ce genre de manipulation&#8230; La [...]]]></description> <content:encoded><![CDATA[<p
style="text-align: justify;"><em>Hier, j&#8217;introduisais mes directives de travail. Aujourd&#8217;hui je vais introduire un sujet souvent sensible : la mise en production. C&#8217;est une tâche qui peut être critique mais si l&#8217;on prend toutes les précautions, nous limitons les risques. On notera bien que le facteur chance est laissé à la porte pour ce genre de manipulation&#8230;</em></p><p
style="text-align: justify;"></p><p
style="text-align: justify;"></p><p
style="text-align: justify;">La <strong>mise en production</strong> c&#8217;est passer un projet sur le serveur du client pour le rendre accessible aux utilisateurs finaux. Facile ? Non, très souvent les architectures sont différentes et il convient d&#8217;utiliser plusieurs environnements. Pour ma part, je dispose de 3 environnements : <em>dev </em>(sur ma machine), <em>test </em>(sur serveur distant) et <em>préprod </em>(sur serveur distant également). Ces environnements me permettent de tester mes projets sur plusieurs OS, plusieurs types de machine et sur deux SGBDR (bases de données) : j&#8217;ai pris l&#8217;habitude d&#8217;effectuer mes tests sous <strong><a
href="http://www.sqlite.org/">SQLite</a></strong>, j&#8217;ai ainsi  deux sons de cloche (en plus de <strong><a
href="http://www.mysql.com/">MySQL</a></strong>) me permettant de corriger des étourderies lors de la configuration de la base.</p><p
style="text-align: justify;">Ok, tout ce speech pourquoi ? Pour pouvoir comprendre mon intérêt à <strong>automatiser le process de mise en prod&#8217;</strong>. En effet, mes trois environnements me garantissent une certaine <strong>stabilité </strong>de mon application, je n&#8217;ai donc pas à jongler avec les serveurs de chacun de mes clients (pas toujours&#8230;). Je peux donc déployer (mettre en prod&#8217;) mon application presque les yeux fermés. Et ça, ça n&#8217;a pas de prix !</p><p
style="text-align: justify;">Mais je ne joue pas le lanceur de couteaux sans avoir de lames bien aiguisées. J&#8217;utilise des outils éprouvés comme <a
href="http://www.capify.org/index.php/Capistrano"><strong>Capistrano</strong></a> et <a
href="http://git-scm.com/"><strong>Git</strong></a>.</p><p
style="text-align: justify;"></p><p
style="text-align: justify;"><strong>Capistrano </strong>est l&#8217;outil par excellence pour déployer des applis <strong>Rails</strong>. Le problème c&#8217;est que je ne m&#8217;y suis pas encore mis&#8230; Mais qu&#8217;importe, il déploiera mes applications <strong>symfony </strong>et <strong>Diem</strong>. La souplesse de configuration via <span
style="text-decoration: underline;">redéfinition</span> des méthodes permet de déployer à peu près ce que l&#8217;on souhaite. De plus, l&#8217;interconnexion avec <strong>Git </strong>se fait sans problème.</p><p
style="text-align: justify;">Maintenant, courte description :</p><ul><li>Capistrano va <span
style="text-decoration: underline;">cloner votre projet</span> (Git inside) ;</li><li>Capistrano peut compresser votre projet (tar) et l&#8217;envoyer à vos X serveurs  ;</li><li>ou Capistrano va demander à X serveurs de récupérer la dernière version de votre projet ;</li><li>Capistrano va lier (symboliquement) la dernière version en tant que version courante ;</li><li>Capistrano va <span
style="text-decoration: underline;">migrer les bases de données</span> (la migration ici, ce n&#8217;est pas l&#8217;histoire avec les oiseaux&#8230; C&#8217;est plutôt la mise à jour structurelle de vos bases) ;</li><li>Capistrano va <span
style="text-decoration: underline;">déployer votre appli très rapidement</span> sur autant de serveurs que vous le souhaiter ;</li><li>Capistrano <span
style="text-decoration: underline;">exécute des commandes</span> avant ou après le déploiement, pratique pour un<em> sf cc </em>;</li><li>Enfin, <span
style="text-decoration: underline;">Capistrano ne fait pas le café</span> (il ne faut pas abuser quand même&#8230;)</li></ul><p
style="text-align: justify;"></p><p
style="text-align: justify;">Intéressant non ? Une fois <strong>Capistrano </strong>installé (<a
href="http://www.capify.org/index.php/Getting_Started">explications ici</a>), on va pouvoir commencer à travailler.</p><p
style="text-align: justify;">Ce que je fais généralement, je crée un répertoire <em>project_name</em> et je tape la commande :</p><p
style="text-align: justify;"><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">capify .</div></div></p><p
style="text-align: justify;"></p><p
style="text-align: justify;">Ceci me crée un fichier <em>Capfile</em>, un répertoire <em>config/</em> avec un fichier <em>deploy.rb</em>. C&#8217;est ce dernier qui nous intéresse. Le mieux est de partir d&#8217;un fichier vide. Pour pouvoir utiliser <strong>Git</strong>, il faut écrire ceci :</p><div
class="codecolorer-container ruby vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">set <span
style="color:#ff3333; font-weight:bold;">:scm</span>, <span
style="color:#996600;">&quot;git&quot;</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:repository</span>, &nbsp;<span
style="color:#996600;">&quot;~/#{application}.git&quot;</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:branch</span>, <span
style="color:#996600;">&quot;master&quot;</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:checkout</span>, <span
style="color:#996600;">&quot;export&quot;</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:deploy_via</span>, <span
style="color:#ff3333; font-weight:bold;">:remote_cache</span></div></div><p
style="text-align: justify;">J&#8217;indique le chemin de mon dépôt, ici local et la branche (par défaut master). Les paramètres <em>:checkout </em>et <em>:deploy_via </em>ainsi défini permettent de faire un clone complet du projet. Ensuite, quelques paramètres nécessaires :</p><div
class="codecolorer-container ruby vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color:#008000; font-style:italic;"># Port</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:port</span>, <span
style="color:#006666;">9999</span><br
/> <span
style="color:#008000; font-style:italic;"># App ?</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:application</span>, <span
style="color:#996600;">&quot;project_name&quot;</span><br
/> <br
/> <span
style="color:#008000; font-style:italic;"># Where ?</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:deploy_to</span>, <span
style="color:#996600;">&quot;/var/www/#{application}&quot;</span><br
/> <br
/> <span
style="color:#008000; font-style:italic;"># Which server ?</span><br
/> role <span
style="color:#ff3333; font-weight:bold;">:app</span>, <span
style="color:#996600;">&quot;localhost&quot;</span><br
/> role <span
style="color:#ff3333; font-weight:bold;">:web</span>, <span
style="color:#996600;">&quot;localhost&quot;</span><br
/> role <span
style="color:#ff3333; font-weight:bold;">:db</span>, <span
style="color:#996600;">&quot;localhost&quot;</span>, <span
style="color:#ff3333; font-weight:bold;">:primary</span> <span
style="color:#006600; font-weight:bold;">=&gt;</span> <span
style="color:#0000FF; font-weight:bold;">true</span><br
/> <br
/> <span
style="color:#008000; font-style:italic;"># Who ?</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:user</span>, <span
style="color:#996600;">&quot;myUs3r&quot;</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:password</span>, <span
style="color:#996600;">&quot;p4ssw0rd&quot;</span><br
/> <br
/> <span
style="color:#008000; font-style:italic;"># More config</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:keep_releases</span>, <span
style="color:#006666;">3</span><br
/> ssh_options<span
style="color:#006600; font-weight:bold;">&#91;</span><span
style="color:#ff3333; font-weight:bold;">:forward_agent</span><span
style="color:#006600; font-weight:bold;">&#93;</span> = <span
style="color:#0000FF; font-weight:bold;">true</span><br
/> <br
/> <span
style="color:#008000; font-style:italic;"># Path to php executable</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:php</span>, <span
style="color:#996600;">&quot;/usr/bin/php&quot;</span><br
/> <br
/> <span
style="color:#008000; font-style:italic;"># Symfony application name (used for migrations)</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:sf_app</span>, <span
style="color:#996600;">&quot;front&quot;</span><br
/> <span
style="color:#008000; font-style:italic;"># Symfony web directory (www, web, public_html, ...)</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:sf_webdir</span>, <span
style="color:#996600;">&quot;www&quot;</span></div></div><p
style="text-align: justify;"></p><p
style="text-align: justify;">Maintenant, une petite chose à savoir. <strong><span
style="text-decoration: underline;">Capistrano </span></strong><span
style="text-decoration: underline;">versionne les déploiements</span> et ça, c&#8217;est bon ! Mon déploiement plante, <span
style="text-decoration: underline;">rollback </span><span
style="text-decoration: underline;">automatique</span> vers la version précédente. Je m&#8217;aperçois que j&#8217;ai fait une grosse faute d&#8217;orthographe, je lance un rollback et l&#8217;appli passe en version précédente. Pour cela, <strong>Capistrano </strong>construit sa propre structure dans le répertoire défini par <em>:deploy_to</em> :</p><p
style="text-align: justify;"><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #000000; font-weight: bold;">/</span>var<span
style="color: #000000; font-weight: bold;">/</span>www<span
style="color: #000000; font-weight: bold;">/</span>project_name<br
/> &nbsp; <span
style="color: #000000; font-weight: bold;">`</span>_ current <span
style="color: #7a0874; font-weight: bold;">&#40;</span>symlink<span
style="color: #7a0874; font-weight: bold;">&#41;</span><br
/> &nbsp; &nbsp;<span
style="color: #000000; font-weight: bold;">|</span>_ releases<br
/> &nbsp; &nbsp;<span
style="color: #000000; font-weight: bold;">|</span>_ shared</div></div></p><p
style="text-align: justify;"><em>current </em>est le lien symbolique qui pointe toujours vers la version active de l&#8217;application. Le répertoire <em>releases/ </em>possède X répertoires correspondant aux différents déploiements passés. Vous l&#8217;aurez compris, le lien symbolique <em>current </em>pointe vers l&#8217;un de ces répertoires. Le répertoire <em>shared/</em> quant à lui contient des fichiers partagés par toutes les releases. Exemple : le fichier <em>databases.yml</em> de <strong>symfony </strong>qui définit les identifiants de connexion à la base de données ou encore le répertoire <em>uploads/</em> qui contient des données utilisateurs.</p><p
style="text-align: justify;"></p><p
style="text-align: justify;">On peut désormais <span
style="text-decoration: underline;">personnaliser les actions de déploiement</span>. Pour cela, on va redéfinir les actions de <em>:deploy</em>, qui contient les tâches de déploiement appelées lors de tout déploiement.</p><div
class="codecolorer-container ruby vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">namespace <span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#ff3333; font-weight:bold;">:deploy</span><span
style="color:#006600; font-weight:bold;">&#41;</span> <span
style="color:#9966CC; font-weight:bold;">do</span><br
/> <br
/> &nbsp; desc <span
style="color:#006600; font-weight:bold;">&lt;</span> <span
style="color:#006600; font-weight:bold;">&lt;-</span>DESC<br
/> &nbsp; &nbsp; <span
style="color:#006600; font-weight:bold;">&#91;</span>internal<span
style="color:#006600; font-weight:bold;">&#93;</span> Overriding original task to fit to symfony project needs<br
/> &nbsp; DESC<br
/> &nbsp; task <span
style="color:#ff3333; font-weight:bold;">:finalize_update</span>, <span
style="color:#ff3333; font-weight:bold;">:except</span> <span
style="color:#006600; font-weight:bold;">=&gt;</span> <span
style="color:#006600; font-weight:bold;">&#123;</span> <span
style="color:#ff3333; font-weight:bold;">:no_release</span> <span
style="color:#006600; font-weight:bold;">=&gt;</span> <span
style="color:#0000FF; font-weight:bold;">true</span> <span
style="color:#006600; font-weight:bold;">&#125;</span> <span
style="color:#9966CC; font-weight:bold;">do</span><br
/> &nbsp; &nbsp; <span
style="color:#008000; font-style:italic;"># Fix permissions</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;cd #{latest_release} &amp;&amp; find * -type f -exec chmod 644 {} <span
style="color:#000099;">\\</span>;&quot;</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;cd #{latest_release} &amp;&amp; find * -type d -exec chmod 705 {} <span
style="color:#000099;">\\</span>;&quot;</span><br
/> &nbsp; <br
/> &nbsp; &nbsp; run <span
style="color:#006600; font-weight:bold;">&lt;</span> <span
style="color:#006600; font-weight:bold;">&lt;-</span>CMD<br
/> &nbsp; &nbsp; &nbsp; rm <span
style="color:#006600; font-weight:bold;">-</span>rf <span
style="color:#008000; font-style:italic;">#{latest_release}/log &amp;&amp;</span><br
/> &nbsp; &nbsp; &nbsp; ln <span
style="color:#006600; font-weight:bold;">-</span>s <span
style="color:#008000; font-style:italic;">#{shared_path}/log #{latest_release}/log</span><br
/> &nbsp; &nbsp; CMD<br
/> <br
/> &nbsp; &nbsp; run <span
style="color:#006600; font-weight:bold;">&lt;&lt;-</span>CMD<br
/> &nbsp; &nbsp; &nbsp; rm <span
style="color:#006600; font-weight:bold;">-</span>rf <span
style="color:#008000; font-style:italic;">#{latest_release}/cache &amp;&amp;</span><br
/> &nbsp; &nbsp; &nbsp; ln <span
style="color:#006600; font-weight:bold;">-</span>s <span
style="color:#008000; font-style:italic;">#{shared_path}/cache #{latest_release}/cache</span><br
/> &nbsp; &nbsp; CMD<br
/> <br
/> &nbsp; &nbsp; stamp = <span
style="color:#CC00FF; font-weight:bold;">Time</span>.<span
style="color:#9900CC;">now</span>.<span
style="color:#9900CC;">utc</span>.<span
style="color:#9900CC;">strftime</span><span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#996600;">&quot;%Y%m%d%H%M.%S&quot;</span><span
style="color:#006600; font-weight:bold;">&#41;</span><br
/> &nbsp; &nbsp; asset_paths = <span
style="color:#006600; font-weight:bold;">%</span>w<span
style="color:#006600; font-weight:bold;">&#40;</span>images css js<span
style="color:#006600; font-weight:bold;">&#41;</span>.<span
style="color:#9900CC;">map</span> <span
style="color:#006600; font-weight:bold;">&#123;</span> <span
style="color:#006600; font-weight:bold;">|</span>p<span
style="color:#006600; font-weight:bold;">|</span> <span
style="color:#996600;">&quot;#{latest_release}/#{sf_webdir}/#{p}&quot;</span> <span
style="color:#006600; font-weight:bold;">&#125;</span>.<span
style="color:#9900CC;">join</span><span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#996600;">&quot; &quot;</span><span
style="color:#006600; font-weight:bold;">&#41;</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;find #{asset_paths} -exec touch -t #{stamp} {} ';'; true&quot;</span>, <span
style="color:#ff3333; font-weight:bold;">:env</span> <span
style="color:#006600; font-weight:bold;">=&gt;</span> <span
style="color:#006600; font-weight:bold;">&#123;</span> <span
style="color:#996600;">&quot;TZ&quot;</span> <span
style="color:#006600; font-weight:bold;">=&gt;</span> <span
style="color:#996600;">&quot;UTC&quot;</span> <span
style="color:#006600; font-weight:bold;">&#125;</span><br
/> &nbsp; <span
style="color:#9966CC; font-weight:bold;">end</span><br
/> &nbsp; <br
/> &nbsp; desc <span
style="color:#006600; font-weight:bold;">&lt;</span> <span
style="color:#006600; font-weight:bold;">&lt;-</span>DESC<br
/> &nbsp; &nbsp; Overriding original task to exclude restart<br
/> &nbsp; DESC<br
/> &nbsp; task <span
style="color:#ff3333; font-weight:bold;">:default</span> <span
style="color:#9966CC; font-weight:bold;">do</span><br
/> &nbsp; &nbsp; update<br
/> &nbsp; <span
style="color:#9966CC; font-weight:bold;">end</span><br
/> &nbsp; <br
/> &nbsp; desc <span
style="color:#006600; font-weight:bold;">&lt;&lt;-</span>DESC<br
/> &nbsp; &nbsp; Overriding original task to use symfony migrations<br
/> &nbsp; DESC<br
/> &nbsp; task <span
style="color:#ff3333; font-weight:bold;">:migrations</span> <span
style="color:#9966CC; font-weight:bold;">do</span><br
/> &nbsp; &nbsp; update<br
/> &nbsp; &nbsp; <span
style="color:#008000; font-style:italic;">#sf.migrate</span><br
/> &nbsp; <span
style="color:#9966CC; font-weight:bold;">end</span> &nbsp;<br
/> &nbsp; <br
/> &nbsp; after <span
style="color:#996600;">&quot;deploy:update&quot;</span>, <span
style="color:#996600;">'deploy:customize'</span><br
/> &nbsp; <br
/> &nbsp; desc <span
style="color:#006600; font-weight:bold;">&lt;&lt;-</span>DESC<br
/> &nbsp; &nbsp; Custom tasks<br
/> &nbsp; DESC<br
/> &nbsp; task <span
style="color:#ff3333; font-weight:bold;">:customize</span> <span
style="color:#9966CC; font-weight:bold;">do</span><br
/> &nbsp; &nbsp; sf.<span
style="color:#9900CC;">symlinks</span><br
/> &nbsp; &nbsp; sf.<span
style="color:#9900CC;">remove_dev_environments</span><br
/> &nbsp; &nbsp; <span
style="color:#008000; font-style:italic;"># clear cache</span><br
/> &nbsp; &nbsp; sf.<span
style="color:#9900CC;">cc</span><br
/> &nbsp; &nbsp; <span
style="color:#008000; font-style:italic;"># Diem</span><br
/> &nbsp; &nbsp; dm.<span
style="color:#9900CC;">cc</span><br
/> &nbsp; &nbsp; dm.<span
style="color:#9900CC;">setup</span><br
/> &nbsp; <span
style="color:#9966CC; font-weight:bold;">end</span><br
/> &nbsp;<br
/> <span
style="color:#9966CC; font-weight:bold;">end</span></div></div><p>&lt;</p><p>p style=&nbsp;&raquo;text-align: justify;&nbsp;&raquo;></p><p
style="text-align: justify;">Après déploiement, on va créer fixer les droits, les répertoires de logs et de cache. Ensuite on met à jour la base de données (Doctrine migration). Pour finir on exécute une série de tâches &laquo;&nbsp;<em>custom</em>&nbsp;&raquo; qui permettent de supprimer les contrôleurs de développement (frontend_dev, backend_dev, &#8230;), de recréer les liens symboliques pour les fichiers partagés, de vider le cache <strong>symfony </strong>ou <strong>Diem</strong>, &#8230;</p><p
style="text-align: justify;">Voyons la suite de commandes pour <strong>symfony </strong>:</p><div
class="codecolorer-container ruby vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">namespace <span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#ff3333; font-weight:bold;">:sf</span><span
style="color:#006600; font-weight:bold;">&#41;</span> <span
style="color:#9966CC; font-weight:bold;">do</span><br
/> &nbsp; <br
/> &nbsp; desc <span
style="color:#006600; font-weight:bold;">&lt;</span> <span
style="color:#006600; font-weight:bold;">&lt;-</span>DESC<br
/> &nbsp; &nbsp; Run the <span
style="color:#996600;">&quot;doctrine migration&quot;</span> task<br
/> &nbsp; DESC<br
/> &nbsp; task <span
style="color:#ff3333; font-weight:bold;">:migrate</span> <span
style="color:#9966CC; font-weight:bold;">do</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;cd #{current_path} &amp;&amp; #{php} symfony doctrine:generate-migrations-diff &amp;&amp; #{php} symfony doctrine:migrate&quot;</span> &nbsp; &nbsp;<br
/> &nbsp; <span
style="color:#9966CC; font-weight:bold;">end</span><br
/> <br
/> &nbsp; desc <span
style="color:#006600; font-weight:bold;">&lt;&lt;-</span>DESC<br
/> &nbsp; &nbsp; Run the <span
style="color:#996600;">&quot;symfony cc&quot;</span> task<br
/> &nbsp; DESC<br
/> &nbsp; task <span
style="color:#ff3333; font-weight:bold;">:cc</span> <span
style="color:#9966CC; font-weight:bold;">do</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;cd #{current_path} &amp;&amp; #{php} symfony cc&quot;</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;cd #{current_path} &amp;&amp; rm -rf cache/*&quot;</span><br
/> &nbsp; <span
style="color:#9966CC; font-weight:bold;">end</span><br
/> <br
/> &nbsp; desc <span
style="color:#006600; font-weight:bold;">&lt;&lt;-</span>DESC<br
/> &nbsp; &nbsp; Create symlink to symfony specific targets<br
/> &nbsp; DESC<br
/> &nbsp; task <span
style="color:#ff3333; font-weight:bold;">:symlinks</span> <span
style="color:#9966CC; font-weight:bold;">do</span><br
/> &nbsp; &nbsp; <span
style="color:#008000; font-style:italic;"># symlink to database.yml</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;rm -rf #{current_path}/config/databases.yml&quot;</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;ln -s #{shared_path}/databases.yml #{current_path}/config/databases.yml&quot;</span><br
/> &nbsp; &nbsp;<br
/> &nbsp; &nbsp; <span
style="color:#008000; font-style:italic;"># symlink to uploads</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;rm -rf #{current_path}/#{sf_webdir}/uploads&quot;</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;ln -s #{shared_path}/uploads #{current_path}/#{sf_webdir}/uploads&quot;</span><br
/> &nbsp; &nbsp; &nbsp;<br
/> &nbsp; &nbsp; <span
style="color:#008000; font-style:italic;"># symlink to .htaccess</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;rm -rf #{current_path}/#{sf_webdir}/.htaccess&quot;</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;ln -s #{shared_path}/.htaccess #{current_path}/#{sf_webdir}/.htaccess&quot;</span><br
/> <br
/> &nbsp; &nbsp; <span
style="color:#008000; font-style:italic;"># symlink to app.yml</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;rm -rf #{current_path}/apps/#{sf_app}/config/app.yml&quot;</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;ln -s #{shared_path}/app.yml #{current_path}/apps/#{sf_app}/config/app.yml&quot;</span><br
/> &nbsp; <span
style="color:#9966CC; font-weight:bold;">end</span> <br
/> &nbsp; <br
/> &nbsp; desc <span
style="color:#006600; font-weight:bold;">&lt;&lt;-</span>DESC<br
/> &nbsp; &nbsp; Remove DEV environments<br
/> &nbsp; DESC<br
/> &nbsp; task <span
style="color:#ff3333; font-weight:bold;">:remove_dev_environments</span> <span
style="color:#9966CC; font-weight:bold;">do</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;rm -rf #{current_path}/#{sf_webdir}/*dev.php&quot;</span> &nbsp; &nbsp;<br
/> &nbsp; <span
style="color:#9966CC; font-weight:bold;">end</span> <br
/> &nbsp; <br
/> &nbsp; desc <span
style="color:#006600; font-weight:bold;">&lt;&lt;-</span>DESC<br
/> &nbsp; &nbsp; Disable symfony application<br
/> &nbsp; DESC<br
/> &nbsp; task <span
style="color:#ff3333; font-weight:bold;">:disable</span> <span
style="color:#9966CC; font-weight:bold;">do</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;cd #{current_path} &amp;&amp; #{php} symfony project:disable #{sf_app} prod&quot;</span> &nbsp; &nbsp;<br
/> &nbsp; <span
style="color:#9966CC; font-weight:bold;">end</span> <br
/> &nbsp; <br
/> &nbsp; desc <span
style="color:#006600; font-weight:bold;">&lt;&lt;-</span>DESC<br
/> &nbsp; &nbsp; Enable symfony application<br
/> &nbsp; DESC<br
/> &nbsp; task <span
style="color:#ff3333; font-weight:bold;">:enable</span> <span
style="color:#9966CC; font-weight:bold;">do</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;cd #{current_path} &amp;&amp; #{php} symfony project:enable #{sf_app} prod&quot;</span> &nbsp; &nbsp;<br
/> &nbsp; <span
style="color:#9966CC; font-weight:bold;">end</span> &nbsp; <br
/> <span
style="color:#9966CC; font-weight:bold;">end</span></div></div><p>&lt;</p><p>p style=&nbsp;&raquo;text-align: justify;&nbsp;&raquo;>Et voilà la suite de commandes pour <strong>Diem </strong>:</p><div
class="codecolorer-container ruby vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">namespace <span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#ff3333; font-weight:bold;">:dm</span><span
style="color:#006600; font-weight:bold;">&#41;</span> <span
style="color:#9966CC; font-weight:bold;">do</span><br
/> <br
/> &nbsp; desc <span
style="color:#006600; font-weight:bold;">&lt;</span> <span
style="color:#006600; font-weight:bold;">&lt;-</span>DESC<br
/> &nbsp; &nbsp; Run the <span
style="color:#996600;">&quot;Diem setup&quot;</span> task<br
/> &nbsp; DESC<br
/> &nbsp; task <span
style="color:#ff3333; font-weight:bold;">:setup</span> <span
style="color:#9966CC; font-weight:bold;">do</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;cd #{current_path} &amp;&amp; #{php} symfony dm:setup&quot;</span> &nbsp; &nbsp;<br
/> &nbsp; <span
style="color:#9966CC; font-weight:bold;">end</span><br
/> <br
/> &nbsp; desc <span
style="color:#006600; font-weight:bold;">&lt;&lt;-</span>DESC<br
/> &nbsp; &nbsp; Clear Diem cache <span
style="color:#9966CC; font-weight:bold;">and</span> fix permissions<br
/> &nbsp; DESC<br
/> &nbsp; task <span
style="color:#ff3333; font-weight:bold;">:cc</span> <span
style="color:#9966CC; font-weight:bold;">do</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;rm -rf #{current_path}/#{sf_webdir}/cache&quot;</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;mkdir #{current_path}/#{sf_webdir}/cache&quot;</span><br
/> &nbsp; &nbsp; run <span
style="color:#996600;">&quot;chmod 777 #{current_path}/#{sf_webdir}/cache&quot;</span> &nbsp; &nbsp;<br
/> &nbsp; <span
style="color:#9966CC; font-weight:bold;">end</span><br
/> &nbsp; <br
/> <span
style="color:#9966CC; font-weight:bold;">end</span></div></div><p>&lt;</p><p>p style=&nbsp;&raquo;text-align: justify;&nbsp;&raquo;>Et voilà ! Un simple <strong>cap deploy</strong> fait tout le reste. Vous pouvez ajouter autant de serveurs que vous le souhaiter et lancer également toutes les commandes qui vous font plaisir.</p><p
style="text-align: justify;">Si vous avez des problèmes d&#8217;hébergement, exemple chez OVH qui ne laisse pas d&#8217;accès externe sur leurs serveurs Plan (&#8230;), vous pouvez utiliser la configuration suivante qui va archiver votre projet et l&#8217;envoyer en SFTP :</p><div
class="codecolorer-container ruby vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">set <span
style="color:#ff3333; font-weight:bold;">:deploy_via</span>, <span
style="color:#ff3333; font-weight:bold;">:copy</span><br
/> <br
/> <span
style="color:#008000; font-style:italic;"># Use copy to bypass firewall...</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:copy_strategy</span>, <span
style="color:#ff3333; font-weight:bold;">:export</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:copy_cache</span>, <span
style="color:#996600;">&quot;/tmp/#{application}&quot;</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:copy_exclude</span>, <span
style="color:#006600; font-weight:bold;">&#91;</span><span
style="color:#996600;">&quot;.git/*&quot;</span><span
style="color:#006600; font-weight:bold;">&#93;</span><br
/> set <span
style="color:#ff3333; font-weight:bold;">:copy_compression</span>, <span
style="color:#ff3333; font-weight:bold;">:gzip</span></div></div><p
style="text-align: justify;"></p><p
style="text-align: justify;">Cette configuration est largement inspirée de ces articles :</p><ul
style="text-align: justify;"><li
style="text-align: justify;"><a
href="http://refineweb.co.uk/2010/01/18/preparing-a-symfony-project-ready-for-deployment-into-production-using-capistrano/">http://refineweb.co.uk/2010/01/18/preparing-a-symfony-project-ready-for-deployment-into-production-using-capistrano/</a></li><li><a
href="http://blog.servergrove.com/2010/07/12/symfony-git-capistrano-capifony/">http://blog.servergrove.com/2010/07/12/symfony-git-capistrano-capifony/</a></li><li><a
href="http://blog.codingspree.net/2008/5/12/deploying-symfony-project-with-capistrano/">http://blog.codingspree.net/2008/5/12/deploying-symfony-project-with-capistrano/</a></li></ul><p
style="text-align: justify;"></p><p
style="text-align: justify;">Pour terminer, hier je vous parlais d&#8217;<strong>Hudson</strong>, un serveur d&#8217;intégration continue. En liant les deux, j&#8217;obtiens une <span
style="text-decoration: underline;">automatisation complète</span> de mon &laquo;&nbsp;<em>after code</em>&laquo;&nbsp;. C&#8217;est-à-dire que j&#8217;écris mon code comme un barbu (et mes tests). Lorsque j&#8217;ai bien commité et que je push mes modifs, <strong>Hudson </strong>voit ces mises à jour, il va relancer les tests. Si tout passe la build estampillée &laquo;&nbsp;<em>success</em>&nbsp;&raquo; va être déployée automatiquement par <strong>Capistrano</strong>.</p><p
style="text-align: justify;">Et moi dans l&#8217;histoire ? Je n&#8217;ai rien à faire. Au pire, je suis alerté par mail si un test ne passe pas et si la build ne peut être déployée, <strong>Capistrano </strong>fera un rollback automatiquement sur sa dernière version stable. Manquerait plus qu&#8217;une cafetière USB et une tâche Hudson pour lancer le café et là&#8230; utopie !</p><p
style="text-align: justify;"></p><p
style="text-align: justify;">A noter qu&#8217;un projet nommé <strong>Capifony </strong>a vu le jour depuis quelques temps. C&#8217;est un <strong>Capistrano </strong>réécrit pour gérer nativement les projets <strong>symfony</strong>, je n&#8217;ai pas testé mais cela me semble une excellente option : <a
href="http://github.com/everzet/capifony">http://github.com/everzet/capifony</a>. Pour <strong>Diem</strong>, j&#8217;ai vu passé quelque chose dans le Google Groups, à suivre donc.</p><p
style="text-align: justify;">Vous pouvez, si vous le voulez, utiliser <a
href="http://github.com/lg/murder"><strong>Murder</strong></a>, un projet développé par Twitter pour déployer via <strong>Bittorent </strong>leurs applications sur tous leurs serveurs. C&#8217;est pas une mauvaise idée si vous avez beaucoup de serveurs, leurs temps de déploiements sont assez phénoménales. En parlant de temps, mes temps de déploiements sont de l&#8217;ordre de 2 minutes&#8230;</p><p
style="text-align: justify;"></p><p
style="text-align: justify;">C&#8217;est tout, pour le moment <img
src='http://www.willdurand.fr/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p><h3 class='related_post_title'>Related Posts</h3><ul
class='related_post'><li><a
href='http://www.willdurand.fr/integrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin/' title='Intégrer un gestionnaire de fichiers dans dmCkEditorPlugin'>Intégrer un gestionnaire de fichiers dans dmCkEditorPlugin</a></li><li><a
href='http://www.willdurand.fr/symfony-jenkins-co/' title=' Symfony, Jenkins &amp; co'> Symfony, Jenkins &#038; co</a></li><li><a
href='http://www.willdurand.fr/symfony-live-2011/' title='Symfony live 2011'>Symfony live 2011</a></li><li><a
href='http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/' title='symfony rencontre Hudson, Mantis et les autres'>symfony rencontre Hudson, Mantis et les autres</a></li><li><a
href='http://www.willdurand.fr/creation-automatique-dun-projet-symfony-mysql-git-et-apache2/' title='Création automatique d&#8217;un projet symfony + MySQL + Git et Apache2'>Création automatique d&#8217;un projet symfony + MySQL + Git et Apache2</a></li></ul> <a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/printfriendly.png" class="sociable-img sociable-hovers" title="Print" alt="Print" /></a><a
rel="nofollow" target="_blank"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F&amp;title=D%C3%A9ploiement%20automatis%C3%A9%20avec%20Capistrano%20et%20Git%20pour%20symfony%20et%20Diem&amp;bodytext=Hier%2C%20j%27introduisais%20mes%20directives%20de%20travail.%20Aujourd%27hui%20je%20vais%20introduire%20un%20sujet%20souvent%20sensible%20%3A%20la%20mise%20en%20production.%20C%27est%20une%20t%C3%A2che%20qui%20peut%20%C3%AAtre%20critique%20mais%20si%20l%27on%20prend%20toutes%20les%20pr%C3%A9cautions%2C%20nous%20limitons%20les%20risques.%20On%20noter" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a
rel="nofollow" target="_blank"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F&amp;title=D%C3%A9ploiement%20automatis%C3%A9%20avec%20Capistrano%20et%20Git%20pour%20symfony%20et%20Diem" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a
rel="nofollow" target="_blank"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F&amp;title=D%C3%A9ploiement%20automatis%C3%A9%20avec%20Capistrano%20et%20Git%20pour%20symfony%20et%20Diem&amp;notes=Hier%2C%20j%27introduisais%20mes%20directives%20de%20travail.%20Aujourd%27hui%20je%20vais%20introduire%20un%20sujet%20souvent%20sensible%20%3A%20la%20mise%20en%20production.%20C%27est%20une%20t%C3%A2che%20qui%20peut%20%C3%AAtre%20critique%20mais%20si%20l%27on%20prend%20toutes%20les%20pr%C3%A9cautions%2C%20nous%20limitons%20les%20risques.%20On%20noter" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a
rel="nofollow" target="_blank"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F&amp;t=D%C3%A9ploiement%20automatis%C3%A9%20avec%20Capistrano%20et%20Git%20pour%20symfony%20et%20Diem" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a
rel="nofollow" target="_blank"  href="http://twitter.com/home?status=D%C3%A9ploiement%20automatis%C3%A9%20avec%20Capistrano%20et%20Git%20pour%20symfony%20et%20Diem%20-%20http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a
rel="nofollow" target="_blank"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F&amp;title=D%C3%A9ploiement%20automatis%C3%A9%20avec%20Capistrano%20et%20Git%20pour%20symfony%20et%20Diem&amp;annotation=Hier%2C%20j%27introduisais%20mes%20directives%20de%20travail.%20Aujourd%27hui%20je%20vais%20introduire%20un%20sujet%20souvent%20sensible%20%3A%20la%20mise%20en%20production.%20C%27est%20une%20t%C3%A2che%20qui%20peut%20%C3%AAtre%20critique%20mais%20si%20l%27on%20prend%20toutes%20les%20pr%C3%A9cautions%2C%20nous%20limitons%20les%20risques.%20On%20noter" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a
rel="nofollow" target="_blank"  href="http://www.friendfeed.com/share?title=D%C3%A9ploiement%20automatis%C3%A9%20avec%20Capistrano%20et%20Git%20pour%20symfony%20et%20Diem&amp;link=http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/friendfeed.png" class="sociable-img sociable-hovers" title="FriendFeed" alt="FriendFeed" /></a><a
rel="nofollow" target="_blank"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F&amp;title=D%C3%A9ploiement%20automatis%C3%A9%20avec%20Capistrano%20et%20Git%20pour%20symfony%20et%20Diem&amp;source=William%26%23039%3Bs+Blog+D%C3%A9veloppeur+web+ind%C3%A9pendant%2C+%C3%A9tudiant+et+passionn%C3%A9+%21+%23Symfony2+%23Rails+%23Diem+%23Git+%23Nginx+%23WebPerfs+%23SoftwareQuality&amp;summary=Hier%2C%20j%27introduisais%20mes%20directives%20de%20travail.%20Aujourd%27hui%20je%20vais%20introduire%20un%20sujet%20souvent%20sensible%20%3A%20la%20mise%20en%20production.%20C%27est%20une%20t%C3%A2che%20qui%20peut%20%C3%AAtre%20critique%20mais%20si%20l%27on%20prend%20toutes%20les%20pr%C3%A9cautions%2C%20nous%20limitons%20les%20risques.%20On%20noter" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a
rel="nofollow" target="_blank"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F&amp;t=D%C3%A9ploiement%20automatis%C3%A9%20avec%20Capistrano%20et%20Git%20pour%20symfony%20et%20Diem" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/myspace.png" class="sociable-img sociable-hovers" title="MySpace" alt="MySpace" /></a><a
rel="nofollow" target="_blank"  href="http://www.netvibes.com/share?title=D%C3%A9ploiement%20automatis%C3%A9%20avec%20Capistrano%20et%20Git%20pour%20symfony%20et%20Diem&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/netvibes.png" class="sociable-img sociable-hovers" title="Netvibes" alt="Netvibes" /></a><a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/pdf.png" class="sociable-img sociable-hovers" title="PDF" alt="PDF" /></a><a
rel="nofollow" target="_blank"  href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F&amp;title=D%C3%A9ploiement%20automatis%C3%A9%20avec%20Capistrano%20et%20Git%20pour%20symfony%20et%20Diem&amp;body=Hier%2C%20j%27introduisais%20mes%20directives%20de%20travail.%20Aujourd%27hui%20je%20vais%20introduire%20un%20sujet%20souvent%20sensible%20%3A%20la%20mise%20en%20production.%20C%27est%20une%20t%C3%A2che%20qui%20peut%20%C3%AAtre%20critique%20mais%20si%20l%27on%20prend%20toutes%20les%20pr%C3%A9cautions%2C%20nous%20limitons%20les%20risques.%20On%20noter" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/ping.png" class="sociable-img sociable-hovers" title="Ping.fm" alt="Ping.fm" /></a><a
rel="nofollow" target="_blank"  href="http://www.willdurand.fr/feed/" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><a
rel="nofollow" target="_blank"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/technorati.png" class="sociable-img sociable-hovers" title="Technorati" alt="Technorati" /></a><a
rel="nofollow" target="_blank"  href="http://www.viadeo.com/shareit/share/?url=http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F&title=D%C3%A9ploiement%20automatis%C3%A9%20avec%20Capistrano%20et%20Git%20pour%20symfony%20et%20Diem&urllanguage=fr" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/viadeo.png" class="sociable-img sociable-hovers" title="viadeo FR" alt="viadeo FR" /></a><a
rel="nofollow" target="_blank"  href="http://www.wikio.com/vote?url=http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/wikio.png" class="sociable-img sociable-hovers" title="Wikio" alt="Wikio" /></a><a
rel="nofollow" target="_blank"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.willdurand.fr%2Fdeploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem%2F&amp;submitHeadline=D%C3%A9ploiement%20automatis%C3%A9%20avec%20Capistrano%20et%20Git%20pour%20symfony%20et%20Diem&amp;submitSummary=Hier%2C%20j%27introduisais%20mes%20directives%20de%20travail.%20Aujourd%27hui%20je%20vais%20introduire%20un%20sujet%20souvent%20sensible%20%3A%20la%20mise%20en%20production.%20C%27est%20une%20t%C3%A2che%20qui%20peut%20%C3%AAtre%20critique%20mais%20si%20l%27on%20prend%20toutes%20les%20pr%C3%A9cautions%2C%20nous%20limitons%20les%20risques.%20On%20noter&amp;submitCategory=science&amp;submitAssetType=text" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/yahoobuzz.png" class="sociable-img sociable-hovers" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a><br
/><br
/>]]></content:encoded> <wfw:commentRss>http://www.willdurand.fr/deploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Faut-il tester&#8230; les tests ?</title><link>http://www.willdurand.fr/faut-il-tester-les-tests/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=faut-il-tester-les-tests</link> <comments>http://www.willdurand.fr/faut-il-tester-les-tests/#comments</comments> <pubDate>Tue, 10 Aug 2010 11:39:33 +0000</pubDate> <dc:creator>Will</dc:creator> <category><![CDATA[Boulot]]></category> <category><![CDATA[Ma vie]]></category> <category><![CDATA[symfony]]></category> <category><![CDATA[Hudson]]></category> <category><![CDATA[Lime]]></category> <category><![CDATA[Symfony]]></category> <category><![CDATA[TDD]]></category> <category><![CDATA[Tests fonctionnels]]></category> <category><![CDATA[Tests unitaires]]></category><guid
isPermaLink="false">http://www.willdurand.fr/?p=538</guid> <description><![CDATA[Avec ce titre très accrocheur, vous allez surement penser que je vais vous parler de tests et vous avez raison&#8230; Mais de quels tests et pourquoi d&#8217;abord ? Il y a un presque deux ans maintenant, j&#8217;apprenais à écrire des tests unitaires et fonctionnels en Java, à l&#8217;aide de JUnit, JMeter, et compagnie. J&#8217;ai appris [...]]]></description> <content:encoded><![CDATA[<p
style="text-align: justify;">Avec ce titre très accrocheur, vous allez surement penser que je vais vous parler de tests et vous avez raison&#8230; Mais de quels tests et pourquoi d&#8217;abord ?</p><p
style="text-align: justify;">Il y a un presque deux ans maintenant, j&#8217;apprenais à écrire des <strong>tests unitaires et fonctionnels</strong> en Java, à l&#8217;aide de <strong>JUnit</strong>, <strong>JMeter</strong>, et compagnie. J&#8217;ai appris à écrire des scénarios de tests avec un logiciel dont je ne me souviens plus du nom, une alternative gratuite à <strong>HP Test Director</strong>. On écrit des <strong>scénarios de tests</strong>, des gens suivent les instructions et fournissent le résultat qu&#8217;ils obtiennent. C&#8217;est bien gentil tout ça mais je n&#8217;ai pas 50 personnes sous la main pour les faire exécuter mes tests et ce n&#8217;est pas mon associé qui voudrait suivre mes procédures&#8230;</p><p
style="text-align: justify;"></p><p
style="text-align: justify;">Comme mon boulot consiste à écrire uniquement des sites web, j&#8217;ai cherché un outil qui pourrait faire ce boulot à ma place. Il ne m&#8217;a pas fallu longtemps pour trouver <a
href="http://seleniumhq.org/"><strong>Selenium</strong></a>, une suite d&#8217;outils permettant d&#8217;enregistrer un enchaînement d&#8217;actions dans le navigateur, de rejouer cet enchaînement autant qu&#8217;on le souhaite, sur plusieurs navigateurs, en parallèle (test de &laquo;&nbsp;<em>scalabilité</em>&laquo;&nbsp;), &#8230;</p><p
style="text-align: justify;">C&#8217;est donc l&#8217;outil parfait pour gérer les scénarios fonctionnels. J&#8217;enregistre mes tests et je les rejoue. Je vérifie ainsi que mon appli réponds correctement et que je n&#8217;ai rien cassé en modifiant une partie du code. Exemple avec <strong>symfony</strong>, la mise à jour du <em>schema.yml</em>.</p><p
style="text-align: justify;"></p><p
style="text-align: justify;">D&#8217;ailleurs avec <strong>symfony</strong>, on peut faire des tests fonctionnels et c&#8217;est une chose que je ne faisais pas. Pour être franc, je ne faisais pas trop de tests en PHP, enfin si mais pas formellement. Maintenant cette période est terminée. J&#8217;adopte une nouvelle approche, l&#8217;approche <strong>TDD </strong>que j&#8217;expliciterai plus tard.
En <strong>symfony</strong>, on peut donc faire des <strong>tests fonctionnels</strong> avec les classes <em>sfTestFunctional </em>et <em>sfBrowser </em>(qui simule un navigateur). Pourquoi utiliser <strong>Selenium </strong>alors ? Et bien parce que ces tests sont bons mais ne remplacent pas <strong>Selenium</strong>, par exemple, on ne peut pas tester les appels Ajax. Voici un aperçu d&#8217;un test fonctionnel écrit en symfony :</p><div
class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #009933; font-style: italic;">/**<br
/> * Functional test file<br
/> *<br
/> * @author William DURAND<br
/> */</span><br
/> <br
/> <span
style="color: #b1b100;">include</span><span
style="color: #009900;">&#40;</span><a
href="http://www.php.net/dirname"><span
style="color: #990000;">dirname</span></a><span
style="color: #009900;">&#40;</span><span
style="color: #009900; font-weight: bold;">__FILE__</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">.</span><span
style="color: #0000ff;">'/../../bootstrap/functional.php'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #b1b100;">include</span><span
style="color: #009900;">&#40;</span><a
href="http://www.php.net/dirname"><span
style="color: #990000;">dirname</span></a><span
style="color: #009900;">&#40;</span><span
style="color: #009900; font-weight: bold;">__FILE__</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">.</span><span
style="color: #0000ff;">'/../../bootstrap/doctrine.php'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <br
/> <span
style="color: #000088;">$browser</span> <span
style="color: #339933;">=</span> <span
style="color: #000000; font-weight: bold;">new</span> sfTestFunctional<span
style="color: #009900;">&#40;</span><span
style="color: #000000; font-weight: bold;">new</span> sfBrowser<span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <br
/> <span
style="color: #666666; font-style: italic;">// Auto-generated</span><br
/> <span
style="color: #000088;">$test</span> <span
style="color: #339933;">=</span> <span
style="color: #000088;">$browser</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">test</span><span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #000088;">$conn</span> <span
style="color: #339933;">=</span> Doctrine<span
style="color: #339933;">::</span><span
style="color: #004000;">getConnectionByTableName</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'Commande'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <br
/> <span
style="color: #000088;">$conn</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">beginTransaction</span><span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <br
/> <span
style="color: #666666; font-style: italic;">// Get the form</span><br
/> <span
style="color: #000088;">$browser</span><br
/> &nbsp; <span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">call</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'/commande/new'</span><span
style="color: #339933;">,</span> <span
style="color: #0000ff;">'GET'</span><span
style="color: #339933;">,</span> <a
href="http://www.php.net/array"><span
style="color: #990000;">array</span></a><span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; <span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">with</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'request'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">begin</span><span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; &nbsp; <span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">isParameter</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'module'</span><span
style="color: #339933;">,</span> <span
style="color: #0000ff;">'commande'</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; &nbsp; <span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">isParameter</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'action'</span><span
style="color: #339933;">,</span> <span
style="color: #0000ff;">'new'</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; <span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">end</span><span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; <span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">with</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'response'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">begin</span><span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; &nbsp; <span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">info</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'1.1 - Get the &quot;Commande&quot; form'</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; &nbsp; <span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">isStatusCode</span><span
style="color: #009900;">&#40;</span><span
style="color: #cc66cc;">200</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; &nbsp; <span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">checkElement</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'#content &gt; p'</span><span
style="color: #339933;">,</span> <span
style="color: #0000ff;">'#Nouvelle commande#'</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; <span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">end</span><span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; <span
style="color: #339933;">;</span></div></div><p
style="text-align: justify;">C&#8217;est très intuitif, les tests sont formés de &laquo;&nbsp;blocs&nbsp;&raquo; commençant par <em>with()</em> et terminant par <em>end()</em>. Il y a déjà beaucoup d&#8217;articles sur le sujet donc je ne m&#8217;y étendrait pas. Par contre petit tuyau, pour aller plus vite j&#8217;utilise le plugin <a
href="http://github.com/rande/swFunctionalTestGenerationPlugin"><strong>swFunctionalTestGenerationPlugin</strong></a><strong> </strong>qui permet de générer un &laquo;&nbsp;stub&nbsp;&raquo; de test fonctionnel symfony directement depuis les actions que l&#8217;on effectue dans la navigateur, pratique !</p><p
style="text-align: justify;"></p><p
style="text-align: justify;">Il n&#8217;y a pas que les tests fonctionnels dans la vie, il y a également les tests unitaires. Comme <strong>JUnit </strong>pour Java, on a le droit à <strong>PHPUnit </strong>pour PHP mais je ne l&#8217;ai pas encore essayé. J&#8217;utilise <a
href="http://www.symfony-project.org/book/1_2/15-Unit-and-Functional-Testing#The%20Lime%20Testing%20Framework"><strong>Lime</strong></a>, un framework de tests embarqué dans <strong>symfony</strong>, écrit par Maître <a
href="http://www.twitter.com/fabpot">@fapbot</a>. Au lieu des classiques <em>assertTrue()</em>, <em>assertFalse()</em>, on dispose des méthodes <em>is()</em>, <em>isnt()</em>, &#8230; Comme pour les tests fonctionnels, l&#8217;écriture de tests unitaires est très intuitive.</p><p
style="text-align: justify;">Grâce à ces tests unitaires, mon code est contrôlé et je n&#8217;ai plus à me soucier d&#8217;éventuels effets de bord. Je sais exactement comment se comportent mes méthodes et mes objets. Je blinde ainsi mon modèle, ce qui fait une chose de moins à me soucier. Je passe 50% de mon temps à écrire du code dans mes actions et vues, 20% de mon temps à écrire du code dans mon modèle, 20% à écrire mes tests et le reste à boire du café&#8230; Je ne me soucis pas du reste, mon environnement de <em>test </em>est complètement découplé de mon environnement de <em>dev </em>et l&#8217;environnement de <em>prod </em>est distant.</p><p
style="text-align: justify;"></p><p
style="text-align: justify;">Sauf que&#8230; lancer les tests c&#8217;est long et j&#8217;aime pas trop attendre. Je me suis tourné vers des outils qui font le boulot à ma place. C&#8217;est ce que l&#8217;on appelle des <strong>serveurs d&#8217;intégration continue</strong>. Je regrette de ne pas avoir pu tester <strong>Sismo</strong>, le serveur d&#8217;intégration continue (CI) de Sensio Labs (vous savez, le même que plus haut, décidément !).</p><p
style="text-align: justify;">J&#8217;ai testé <strong>Hudson </strong>et <strong>phpUnderControl </strong>(<strong>cruiseControl</strong>). Pour ce dernier, je n&#8217;en suis pas très satisfait avec <strong>symfony </strong>et <strong>Lime</strong>. Il fonctionne bien, l&#8217;utilisation de <strong>Ant </strong>fait plaisir mais je n&#8217;ai pas pu profiter de toutes les possibilités de ce serveur. Je l&#8217;ai donc laissé tombé au profit d&#8217;<strong>Hudson</strong>. C&#8217;est un serveur plaisant, rapide à prendre en main, très lisible et parfaitement customisable avec le nombre incommensurable de plugins dont il dispose. Pour savoir comment le faire fonctionner avec symfony, on lit <a
href="http://prendreuncafe.com/blog/post/2009/10/06/Simple-Continuous-Integration-of-a-Symfony-Project-using-Hudson">cet article</a> de Nicolas Perriault. Pour ma part, je n&#8217;utilise pas SVN mais <strong>Git</strong>, il suffit d&#8217;installer le plugin qui va bien.</p><p
style="text-align: justify;"></p><p
style="text-align: justify;">Voilà, sachant que mon Gmail est tout le temps ouvert et que j&#8217;ai le checker qui va bien dans Chrome, je suis alerté assez rapidement par mail si je casse tout. Encore quelque chose de moins à me soucier. C&#8217;est ce qu&#8217;on appelle, je crois, l&#8217;efficience et la productivité s&#8217;en porte beaucoup mieux.</p><p
style="text-align: justify;"></p><p
style="text-align: justify;">Il me reste cependant quelque chose à éclaircir : <strong>TDD</strong>. <a
href="http://fr.wikipedia.org/wiki/Test_Driven_Development"><strong>Test Driven Development</strong></a> ou <strong>Développement piloté par les tests</strong>. Pour faire simple, avant de développer une fonctionnalité, je réfléchis. Oui mais je réfléchis deux fois puis trois fois même. C&#8217;est-à-dire que je cherche comment l&#8217;écrire, comment elle pourrait mal se comporter et comment la tester. Ensuite, je prends le chemin inverse. J&#8217;écris mes tests, je veille à son comportement lors de son écriture. Et voilà, ma fonctionnalité est écrite, les tests passent, je continue mon travail. Je ne passe pas 30 minutes à chercher ce qui ne va pas&#8230;</p><p
style="text-align: justify;"></p><p
style="text-align: justify;">Au fait, pourquoi cet intitulé d&#8217;article ? C&#8217;est une interrogation qui vient des cours de qualité logiciel que j&#8217;ai pu avoir auparavant. J&#8217;ai toujours gardé cette phrase à l&#8217;esprit lorsqu&#8217;on me parle de tests. La question n&#8217;est pas si simple qu&#8217;elle en a l&#8217;air. Si vous avez une idée, les commentaires sont fait pour cela. Moi, je garde mon idée <img
src='http://www.willdurand.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><p
style="text-align: justify;"></p><p
style="text-align: justify;">En résumé, j&#8217;ai passé de bonnes vacances <img
src='http://www.willdurand.fr/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /></p><h3 class='related_post_title'>Related Posts</h3><ul
class='related_post'><li><a
href='http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/' title='symfony rencontre Hudson, Mantis et les autres'>symfony rencontre Hudson, Mantis et les autres</a></li><li><a
href='http://www.willdurand.fr/tests-unitaires-et-fonctionnels-sur-un-bundle-en-symfony2/' title='Tests unitaires et fonctionnels sur un Bundle en Symfony2'>Tests unitaires et fonctionnels sur un Bundle en Symfony2</a></li><li><a
href='http://www.willdurand.fr/symfony-jenkins-co/' title=' Symfony, Jenkins &amp; co'> Symfony, Jenkins &#038; co</a></li><li><a
href='http://www.willdurand.fr/symfony-live-2011/' title='Symfony live 2011'>Symfony live 2011</a></li><li><a
href='http://www.willdurand.fr/creation-automatique-dun-projet-symfony-mysql-git-et-apache2/' title='Création automatique d&#8217;un projet symfony + MySQL + Git et Apache2'>Création automatique d&#8217;un projet symfony + MySQL + Git et Apache2</a></li></ul> <a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/printfriendly.png" class="sociable-img sociable-hovers" title="Print" alt="Print" /></a><a
rel="nofollow" target="_blank"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F&amp;title=Faut-il%20tester...%20les%20tests%20%3F&amp;bodytext=Avec%20ce%20titre%20tr%C3%A8s%20accrocheur%2C%20vous%20allez%20surement%20penser%20que%20je%20vais%20vous%20parler%20de%20tests%20et%20vous%20avez%20raison...%20Mais%20de%20quels%20tests%20et%20pourquoi%20d%27abord%20%3F%0D%0AIl%20y%20a%20un%20presque%20deux%20ans%20maintenant%2C%20j%27apprenais%20%C3%A0%20%C3%A9crire%20des%20tests%20unitaires%20et%20fonctio" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a
rel="nofollow" target="_blank"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F&amp;title=Faut-il%20tester...%20les%20tests%20%3F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a
rel="nofollow" target="_blank"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F&amp;title=Faut-il%20tester...%20les%20tests%20%3F&amp;notes=Avec%20ce%20titre%20tr%C3%A8s%20accrocheur%2C%20vous%20allez%20surement%20penser%20que%20je%20vais%20vous%20parler%20de%20tests%20et%20vous%20avez%20raison...%20Mais%20de%20quels%20tests%20et%20pourquoi%20d%27abord%20%3F%0D%0AIl%20y%20a%20un%20presque%20deux%20ans%20maintenant%2C%20j%27apprenais%20%C3%A0%20%C3%A9crire%20des%20tests%20unitaires%20et%20fonctio" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a
rel="nofollow" target="_blank"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F&amp;t=Faut-il%20tester...%20les%20tests%20%3F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a
rel="nofollow" target="_blank"  href="http://twitter.com/home?status=Faut-il%20tester...%20les%20tests%20%3F%20-%20http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a
rel="nofollow" target="_blank"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F&amp;title=Faut-il%20tester...%20les%20tests%20%3F&amp;annotation=Avec%20ce%20titre%20tr%C3%A8s%20accrocheur%2C%20vous%20allez%20surement%20penser%20que%20je%20vais%20vous%20parler%20de%20tests%20et%20vous%20avez%20raison...%20Mais%20de%20quels%20tests%20et%20pourquoi%20d%27abord%20%3F%0D%0AIl%20y%20a%20un%20presque%20deux%20ans%20maintenant%2C%20j%27apprenais%20%C3%A0%20%C3%A9crire%20des%20tests%20unitaires%20et%20fonctio" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a
rel="nofollow" target="_blank"  href="http://www.friendfeed.com/share?title=Faut-il%20tester...%20les%20tests%20%3F&amp;link=http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/friendfeed.png" class="sociable-img sociable-hovers" title="FriendFeed" alt="FriendFeed" /></a><a
rel="nofollow" target="_blank"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F&amp;title=Faut-il%20tester...%20les%20tests%20%3F&amp;source=William%26%23039%3Bs+Blog+D%C3%A9veloppeur+web+ind%C3%A9pendant%2C+%C3%A9tudiant+et+passionn%C3%A9+%21+%23Symfony2+%23Rails+%23Diem+%23Git+%23Nginx+%23WebPerfs+%23SoftwareQuality&amp;summary=Avec%20ce%20titre%20tr%C3%A8s%20accrocheur%2C%20vous%20allez%20surement%20penser%20que%20je%20vais%20vous%20parler%20de%20tests%20et%20vous%20avez%20raison...%20Mais%20de%20quels%20tests%20et%20pourquoi%20d%27abord%20%3F%0D%0AIl%20y%20a%20un%20presque%20deux%20ans%20maintenant%2C%20j%27apprenais%20%C3%A0%20%C3%A9crire%20des%20tests%20unitaires%20et%20fonctio" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a
rel="nofollow" target="_blank"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F&amp;t=Faut-il%20tester...%20les%20tests%20%3F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/myspace.png" class="sociable-img sociable-hovers" title="MySpace" alt="MySpace" /></a><a
rel="nofollow" target="_blank"  href="http://www.netvibes.com/share?title=Faut-il%20tester...%20les%20tests%20%3F&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/netvibes.png" class="sociable-img sociable-hovers" title="Netvibes" alt="Netvibes" /></a><a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/pdf.png" class="sociable-img sociable-hovers" title="PDF" alt="PDF" /></a><a
rel="nofollow" target="_blank"  href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F&amp;title=Faut-il%20tester...%20les%20tests%20%3F&amp;body=Avec%20ce%20titre%20tr%C3%A8s%20accrocheur%2C%20vous%20allez%20surement%20penser%20que%20je%20vais%20vous%20parler%20de%20tests%20et%20vous%20avez%20raison...%20Mais%20de%20quels%20tests%20et%20pourquoi%20d%27abord%20%3F%0D%0AIl%20y%20a%20un%20presque%20deux%20ans%20maintenant%2C%20j%27apprenais%20%C3%A0%20%C3%A9crire%20des%20tests%20unitaires%20et%20fonctio" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/ping.png" class="sociable-img sociable-hovers" title="Ping.fm" alt="Ping.fm" /></a><a
rel="nofollow" target="_blank"  href="http://www.willdurand.fr/feed/" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><a
rel="nofollow" target="_blank"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/technorati.png" class="sociable-img sociable-hovers" title="Technorati" alt="Technorati" /></a><a
rel="nofollow" target="_blank"  href="http://www.viadeo.com/shareit/share/?url=http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F&title=Faut-il%20tester...%20les%20tests%20%3F&urllanguage=fr" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/viadeo.png" class="sociable-img sociable-hovers" title="viadeo FR" alt="viadeo FR" /></a><a
rel="nofollow" target="_blank"  href="http://www.wikio.com/vote?url=http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/wikio.png" class="sociable-img sociable-hovers" title="Wikio" alt="Wikio" /></a><a
rel="nofollow" target="_blank"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.willdurand.fr%2Ffaut-il-tester-les-tests%2F&amp;submitHeadline=Faut-il%20tester...%20les%20tests%20%3F&amp;submitSummary=Avec%20ce%20titre%20tr%C3%A8s%20accrocheur%2C%20vous%20allez%20surement%20penser%20que%20je%20vais%20vous%20parler%20de%20tests%20et%20vous%20avez%20raison...%20Mais%20de%20quels%20tests%20et%20pourquoi%20d%27abord%20%3F%0D%0AIl%20y%20a%20un%20presque%20deux%20ans%20maintenant%2C%20j%27apprenais%20%C3%A0%20%C3%A9crire%20des%20tests%20unitaires%20et%20fonctio&amp;submitCategory=science&amp;submitAssetType=text" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/yahoobuzz.png" class="sociable-img sociable-hovers" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a><br
/><br
/>]]></content:encoded> <wfw:commentRss>http://www.willdurand.fr/faut-il-tester-les-tests/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>L&#8217;erreur &#171;&#160;suexec policy violation&#160;&#187; avec symfony (chez OVH&#8230;)</title><link>http://www.willdurand.fr/lerreur-suexec-policy-violation-avec-symfony-chez-ovh/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=lerreur-suexec-policy-violation-avec-symfony-chez-ovh</link> <comments>http://www.willdurand.fr/lerreur-suexec-policy-violation-avec-symfony-chez-ovh/#comments</comments> <pubDate>Fri, 16 Jul 2010 12:57:12 +0000</pubDate> <dc:creator>Will</dc:creator> <category><![CDATA[Serveur]]></category> <category><![CDATA[symfony]]></category> <category><![CDATA[Apache2]]></category> <category><![CDATA[Symfony]]></category><guid
isPermaLink="false">http://www.willdurand.fr/?p=533</guid> <description><![CDATA[Bonjour, je laisse ici un petit rappel pour avoir lutté quelques heures avec une erreur 500, au début incompréhensible&#8230; Il s&#8217;agit de l&#8217;erreur : suexec policy violation: see suexec log for more details Cette erreur engendre une erreur 500. C&#8217;est un peu dommage&#8230; Il s&#8217;agit simplement d&#8217;un problème de droits sur les fichiers mais aussi [...]]]></description> <content:encoded><![CDATA[<p
style="text-align: justify;">Bonjour, je laisse ici un petit rappel pour avoir lutté quelques heures avec une erreur 500, au début incompréhensible&#8230; Il s&#8217;agit de l&#8217;erreur :</p><div
class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">suexec policy violation: see suexec log for more details</div></div><p
style="text-align: justify;">Cette erreur engendre une erreur 500. C&#8217;est un peu dommage&#8230; Il s&#8217;agit simplement d&#8217;un problème de droits sur les fichiers mais aussi sur les dossiers.</p><p
style="text-align: justify;">Les fichiers doivent posséder les droits <em>644</em> (<em>-rw-r&#8211;r&#8211;</em>) et les dossiers les droits <em>705</em> (<em>drwx&#8212;r-x</em>). Pour les fichiers, ces droits sont classiques, pour les dossiers on peut surement faire mieux mais là, ça marche, c&#8217;est testé. Pour faire ça vite :</p><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #c20cb9; font-weight: bold;">find</span> <span
style="color: #000000; font-weight: bold;">*</span> <span
style="color: #660033;">-type</span> f <span
style="color: #660033;">-exec</span> <span
style="color: #c20cb9; font-weight: bold;">chmod</span> <span
style="color: #000000;">644</span> <span
style="color: #7a0874; font-weight: bold;">&#123;</span><span
style="color: #7a0874; font-weight: bold;">&#125;</span> \;</div></div><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #c20cb9; font-weight: bold;">find</span> <span
style="color: #000000; font-weight: bold;">*</span> <span
style="color: #660033;">-type</span> d <span
style="color: #660033;">-exec</span> <span
style="color: #c20cb9; font-weight: bold;">chmod</span> <span
style="color: #000000;">705</span> <span
style="color: #7a0874; font-weight: bold;">&#123;</span><span
style="color: #7a0874; font-weight: bold;">&#125;</span> \;</div></div><p
style="text-align: justify;"></p><p
style="text-align: justify;">Ensuite, on passe un coup de <em>project:permissions</em> et le tour est joué. On notera que la seule commande :</p><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">php symfony project:permissions</div></div><p
style="text-align: justify;"><strong>ne suffit pas</strong> à résoudre les problèmes de droits.</p><p
style="text-align: justify;"></p><p
style="text-align: justify;">On fixera les droits du .htaccess à <em>604</em>. Voilà <img
src='http://www.willdurand.fr/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p><h3 class='related_post_title'>Related Posts</h3><ul
class='related_post'><li><a
href='http://www.willdurand.fr/creation-automatique-dun-projet-symfony-mysql-git-et-apache2/' title='Création automatique d&#8217;un projet symfony + MySQL + Git et Apache2'>Création automatique d&#8217;un projet symfony + MySQL + Git et Apache2</a></li><li><a
href='http://www.willdurand.fr/symfony-jenkins-co/' title=' Symfony, Jenkins &amp; co'> Symfony, Jenkins &#038; co</a></li><li><a
href='http://www.willdurand.fr/symfony-live-2011/' title='Symfony live 2011'>Symfony live 2011</a></li><li><a
href='http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/' title='symfony rencontre Hudson, Mantis et les autres'>symfony rencontre Hudson, Mantis et les autres</a></li><li><a
href='http://www.willdurand.fr/deploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem/' title='Déploiement automatisé avec Capistrano et Git pour symfony et Diem'>Déploiement automatisé avec Capistrano et Git pour symfony et Diem</a></li></ul> <a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/printfriendly.png" class="sociable-img sociable-hovers" title="Print" alt="Print" /></a><a
rel="nofollow" target="_blank"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F&amp;title=L%27erreur%20%22suexec%20policy%20violation%22%20avec%20symfony%20%28chez%20OVH...%29&amp;bodytext=Bonjour%2C%20je%20laisse%20ici%20un%20petit%20rappel%20pour%20avoir%20lutt%C3%A9%20quelques%20heures%20avec%20une%20erreur%20500%2C%20au%20d%C3%A9but%20incompr%C3%A9hensible...%20Il%20s%27agit%20de%20l%27erreur%20%3A%0D%0A%5Bcc%20lang%3D%27text%27%20%5Dsuexec%20policy%20violation%3A%20see%20suexec%20log%20for%20more%20details%5B%2Fcc%5D%0D%0ACette%20erreur%20engendr" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a
rel="nofollow" target="_blank"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F&amp;title=L%27erreur%20%22suexec%20policy%20violation%22%20avec%20symfony%20%28chez%20OVH...%29" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a
rel="nofollow" target="_blank"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F&amp;title=L%27erreur%20%22suexec%20policy%20violation%22%20avec%20symfony%20%28chez%20OVH...%29&amp;notes=Bonjour%2C%20je%20laisse%20ici%20un%20petit%20rappel%20pour%20avoir%20lutt%C3%A9%20quelques%20heures%20avec%20une%20erreur%20500%2C%20au%20d%C3%A9but%20incompr%C3%A9hensible...%20Il%20s%27agit%20de%20l%27erreur%20%3A%0D%0A%5Bcc%20lang%3D%27text%27%20%5Dsuexec%20policy%20violation%3A%20see%20suexec%20log%20for%20more%20details%5B%2Fcc%5D%0D%0ACette%20erreur%20engendr" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a
rel="nofollow" target="_blank"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F&amp;t=L%27erreur%20%22suexec%20policy%20violation%22%20avec%20symfony%20%28chez%20OVH...%29" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a
rel="nofollow" target="_blank"  href="http://twitter.com/home?status=L%27erreur%20%22suexec%20policy%20violation%22%20avec%20symfony%20%28chez%20OVH...%29%20-%20http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a
rel="nofollow" target="_blank"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F&amp;title=L%27erreur%20%22suexec%20policy%20violation%22%20avec%20symfony%20%28chez%20OVH...%29&amp;annotation=Bonjour%2C%20je%20laisse%20ici%20un%20petit%20rappel%20pour%20avoir%20lutt%C3%A9%20quelques%20heures%20avec%20une%20erreur%20500%2C%20au%20d%C3%A9but%20incompr%C3%A9hensible...%20Il%20s%27agit%20de%20l%27erreur%20%3A%0D%0A%5Bcc%20lang%3D%27text%27%20%5Dsuexec%20policy%20violation%3A%20see%20suexec%20log%20for%20more%20details%5B%2Fcc%5D%0D%0ACette%20erreur%20engendr" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a
rel="nofollow" target="_blank"  href="http://www.friendfeed.com/share?title=L%27erreur%20%22suexec%20policy%20violation%22%20avec%20symfony%20%28chez%20OVH...%29&amp;link=http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/friendfeed.png" class="sociable-img sociable-hovers" title="FriendFeed" alt="FriendFeed" /></a><a
rel="nofollow" target="_blank"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F&amp;title=L%27erreur%20%22suexec%20policy%20violation%22%20avec%20symfony%20%28chez%20OVH...%29&amp;source=William%26%23039%3Bs+Blog+D%C3%A9veloppeur+web+ind%C3%A9pendant%2C+%C3%A9tudiant+et+passionn%C3%A9+%21+%23Symfony2+%23Rails+%23Diem+%23Git+%23Nginx+%23WebPerfs+%23SoftwareQuality&amp;summary=Bonjour%2C%20je%20laisse%20ici%20un%20petit%20rappel%20pour%20avoir%20lutt%C3%A9%20quelques%20heures%20avec%20une%20erreur%20500%2C%20au%20d%C3%A9but%20incompr%C3%A9hensible...%20Il%20s%27agit%20de%20l%27erreur%20%3A%0D%0A%5Bcc%20lang%3D%27text%27%20%5Dsuexec%20policy%20violation%3A%20see%20suexec%20log%20for%20more%20details%5B%2Fcc%5D%0D%0ACette%20erreur%20engendr" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a
rel="nofollow" target="_blank"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F&amp;t=L%27erreur%20%22suexec%20policy%20violation%22%20avec%20symfony%20%28chez%20OVH...%29" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/myspace.png" class="sociable-img sociable-hovers" title="MySpace" alt="MySpace" /></a><a
rel="nofollow" target="_blank"  href="http://www.netvibes.com/share?title=L%27erreur%20%22suexec%20policy%20violation%22%20avec%20symfony%20%28chez%20OVH...%29&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/netvibes.png" class="sociable-img sociable-hovers" title="Netvibes" alt="Netvibes" /></a><a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/pdf.png" class="sociable-img sociable-hovers" title="PDF" alt="PDF" /></a><a
rel="nofollow" target="_blank"  href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F&amp;title=L%27erreur%20%22suexec%20policy%20violation%22%20avec%20symfony%20%28chez%20OVH...%29&amp;body=Bonjour%2C%20je%20laisse%20ici%20un%20petit%20rappel%20pour%20avoir%20lutt%C3%A9%20quelques%20heures%20avec%20une%20erreur%20500%2C%20au%20d%C3%A9but%20incompr%C3%A9hensible...%20Il%20s%27agit%20de%20l%27erreur%20%3A%0D%0A%5Bcc%20lang%3D%27text%27%20%5Dsuexec%20policy%20violation%3A%20see%20suexec%20log%20for%20more%20details%5B%2Fcc%5D%0D%0ACette%20erreur%20engendr" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/ping.png" class="sociable-img sociable-hovers" title="Ping.fm" alt="Ping.fm" /></a><a
rel="nofollow" target="_blank"  href="http://www.willdurand.fr/feed/" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><a
rel="nofollow" target="_blank"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/technorati.png" class="sociable-img sociable-hovers" title="Technorati" alt="Technorati" /></a><a
rel="nofollow" target="_blank"  href="http://www.viadeo.com/shareit/share/?url=http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F&title=L%27erreur%20%22suexec%20policy%20violation%22%20avec%20symfony%20%28chez%20OVH...%29&urllanguage=fr" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/viadeo.png" class="sociable-img sociable-hovers" title="viadeo FR" alt="viadeo FR" /></a><a
rel="nofollow" target="_blank"  href="http://www.wikio.com/vote?url=http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/wikio.png" class="sociable-img sociable-hovers" title="Wikio" alt="Wikio" /></a><a
rel="nofollow" target="_blank"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.willdurand.fr%2Flerreur-suexec-policy-violation-avec-symfony-chez-ovh%2F&amp;submitHeadline=L%27erreur%20%22suexec%20policy%20violation%22%20avec%20symfony%20%28chez%20OVH...%29&amp;submitSummary=Bonjour%2C%20je%20laisse%20ici%20un%20petit%20rappel%20pour%20avoir%20lutt%C3%A9%20quelques%20heures%20avec%20une%20erreur%20500%2C%20au%20d%C3%A9but%20incompr%C3%A9hensible...%20Il%20s%27agit%20de%20l%27erreur%20%3A%0D%0A%5Bcc%20lang%3D%27text%27%20%5Dsuexec%20policy%20violation%3A%20see%20suexec%20log%20for%20more%20details%5B%2Fcc%5D%0D%0ACette%20erreur%20engendr&amp;submitCategory=science&amp;submitAssetType=text" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/yahoobuzz.png" class="sociable-img sociable-hovers" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a><br
/><br
/>]]></content:encoded> <wfw:commentRss>http://www.willdurand.fr/lerreur-suexec-policy-violation-avec-symfony-chez-ovh/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Intégrer un gestionnaire de fichiers dans dmCkEditorPlugin</title><link>http://www.willdurand.fr/integrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=integrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin</link> <comments>http://www.willdurand.fr/integrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin/#comments</comments> <pubDate>Tue, 06 Jul 2010 00:09:45 +0000</pubDate> <dc:creator>Will</dc:creator> <category><![CDATA[Diem Project]]></category> <category><![CDATA[Tips]]></category> <category><![CDATA[CkEditor]]></category> <category><![CDATA[Diem]]></category> <category><![CDATA[KFM]]></category> <category><![CDATA[Symfony]]></category><guid
isPermaLink="false">http://www.willdurand.fr/?p=465</guid> <description><![CDATA[Bonjour, je laisse ici une petite astuce pour intégrer KFM (http://kfm.verens.com/), un excellent gestionnaire de fichiers en AJAX, au plugin Diem nommé dmCkEditorPlugin. Ce plugin offre un nouveau widget contenant, comme son nom l&#8217;indique, l&#8217;éditeur WYSIWYG CkEditor. Pour installer KFM, on télécharge la dernière version que l&#8217;on place dans dmCkEditorPlugin/js/kfm. Ensuite on ouvre dmCkEditorPlugin/config/dm/config.yml et [...]]]></description> <content:encoded><![CDATA[<p
style="text-align: justify;">Bonjour,</p><p
style="text-align: justify;">je laisse ici une petite astuce pour intégrer KFM (<a
href="http://kfm.verens.com/">http://kfm.verens.com/</a>), un excellent gestionnaire de fichiers en AJAX, au plugin Diem nommé dmCkEditorPlugin. Ce plugin offre un nouveau widget contenant, comme son nom l&#8217;indique, l&#8217;éditeur WYSIWYG CkEditor.</p><p
style="text-align: justify;"></p><p
style="text-align: justify;">Pour installer KFM, on télécharge la dernière version que l&#8217;on place dans <em>dmCkEditorPlugin/js/kfm.</em></p><p
style="text-align: justify;">Ensuite on ouvre <em>dmCkEditorPlugin/config/dm/config.yml</em> et on ajoute cette ligne :</p><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">default:<br
/> &nbsp; ckeditor:<br
/> &nbsp; &nbsp; config:<br
/> &nbsp; &nbsp; &nbsp; ...<br
/> &nbsp; &nbsp; &nbsp; filebrowserBrowseUrl: <span
style="color: #000000; font-weight: bold;">/</span>dmCkEditorPlugin<span
style="color: #000000; font-weight: bold;">/</span>js<span
style="color: #000000; font-weight: bold;">/</span>kfm<span
style="color: #000000; font-weight: bold;">/</span>index.php</div></div><p
style="text-align: justify;">&nbsp;</p><p
style="text-align: justify;">KFM utilise une base de données, il faut donc la configurer. Le choix que j&#8217;ai fait est de parser le fichier <em>databases.yml</em> afin de récupérer les paramètres de connexion directement. Il faut donc modifier le fichier de configuration de KFM (<em>dmCkEditorPlugin/js/kfm/configuration.php</em>). J&#8217;ai placé ce code tout en haut en remplaçant les variables en rapport avec la base de données :</p><div
class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #b1b100;">require_once</span><span
style="color: #009900;">&#40;</span><a
href="http://www.php.net/dirname"><span
style="color: #990000;">dirname</span></a><span
style="color: #009900;">&#40;</span><span
style="color: #009900; font-weight: bold;">__FILE__</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">.</span><span
style="color: #0000ff;">'/../../../../lib/vendor/diem/symfony/lib/yaml/sfYaml.php'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <br
/> <span
style="color: #000088;">$config</span> <span
style="color: #339933;">=</span> sfYaml<span
style="color: #339933;">::</span><span
style="color: #004000;">load</span><span
style="color: #009900;">&#40;</span><a
href="http://www.php.net/dirname"><span
style="color: #990000;">dirname</span></a><span
style="color: #009900;">&#40;</span><span
style="color: #009900; font-weight: bold;">__FILE__</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">.</span><span
style="color: #0000ff;">'/../../../../config/databases.yml'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <br
/> <span
style="color: #000088;">$dsn</span> &nbsp;<span
style="color: #339933;">=</span> <span
style="color: #000088;">$config</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'all'</span><span
style="color: #009900;">&#93;</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'doctrine'</span><span
style="color: #009900;">&#93;</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'param'</span><span
style="color: #009900;">&#93;</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'dsn'</span><span
style="color: #009900;">&#93;</span><span
style="color: #339933;">;</span><br
/> <a
href="http://www.php.net/preg_match"><span
style="color: #990000;">preg_match</span></a><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'#(?P\w+):host=(?P\w+);dbname=(?P\w+);#'</span><span
style="color: #339933;">,</span> <span
style="color: #000088;">$dsn</span><span
style="color: #339933;">,</span> <span
style="color: #000088;">$matches</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <br
/> <span
style="color: #666666; font-style: italic;">// what type of database to use</span><br
/> <span
style="color: #666666; font-style: italic;">// values allowed: mysql, pgsql, sqlite, sqlitepdo</span><br
/> <span
style="color: #000088;">$kfm_db_type</span> <span
style="color: #339933;">=</span> <span
style="color: #000088;">$matches</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'type'</span><span
style="color: #009900;">&#93;</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #666666; font-style: italic;">// the following options should only be filled if you are not using sqlite/sqlitepdo as the database</span><br
/> <span
style="color: #000088;">$kfm_db_prefix</span> &nbsp; <span
style="color: #339933;">=</span> <span
style="color: #0000ff;">'kfm_'</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #000088;">$kfm_db_host</span> &nbsp; &nbsp; <span
style="color: #339933;">=</span> <span
style="color: #000088;">$matches</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'host'</span><span
style="color: #009900;">&#93;</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #000088;">$kfm_db_name</span> &nbsp; &nbsp; <span
style="color: #339933;">=</span> <span
style="color: #000088;">$matches</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'dbname'</span><span
style="color: #009900;">&#93;</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #000088;">$kfm_db_username</span> <span
style="color: #339933;">=</span> <span
style="color: #000088;">$config</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'all'</span><span
style="color: #009900;">&#93;</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'doctrine'</span><span
style="color: #009900;">&#93;</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'param'</span><span
style="color: #009900;">&#93;</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'username'</span><span
style="color: #009900;">&#93;</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #000088;">$kfm_db_password</span> <span
style="color: #339933;">=</span> <span
style="color: #000088;">$config</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'all'</span><span
style="color: #009900;">&#93;</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'doctrine'</span><span
style="color: #009900;">&#93;</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'param'</span><span
style="color: #009900;">&#93;</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'password'</span><span
style="color: #009900;">&#93;</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #000088;">$kfm_db_port</span> &nbsp; &nbsp; <span
style="color: #339933;">=</span> <span
style="color: #0000ff;">''</span><span
style="color: #339933;">;</span></div></div><p
style="text-align: justify;">C&#8217;est une manière simple et efficace d&#8217;intégrer ce gestionnaire de fichiers. Ce n&#8217;est pas parfait mais fonctionnel <img
src='http://www.willdurand.fr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><h3 class='related_post_title'>Related Posts</h3><ul
class='related_post'><li><a
href='http://www.willdurand.fr/deploiement-automatise-avec-capistrano-et-git-pour-symfony-et-diem/' title='Déploiement automatisé avec Capistrano et Git pour symfony et Diem'>Déploiement automatisé avec Capistrano et Git pour symfony et Diem</a></li><li><a
href='http://www.willdurand.fr/symfony-jenkins-co/' title=' Symfony, Jenkins &amp; co'> Symfony, Jenkins &#038; co</a></li><li><a
href='http://www.willdurand.fr/symfony-live-2011/' title='Symfony live 2011'>Symfony live 2011</a></li><li><a
href='http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/' title='symfony rencontre Hudson, Mantis et les autres'>symfony rencontre Hudson, Mantis et les autres</a></li><li><a
href='http://www.willdurand.fr/creation-automatique-dun-projet-symfony-mysql-git-et-apache2/' title='Création automatique d&#8217;un projet symfony + MySQL + Git et Apache2'>Création automatique d&#8217;un projet symfony + MySQL + Git et Apache2</a></li></ul> <a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/printfriendly.png" class="sociable-img sociable-hovers" title="Print" alt="Print" /></a><a
rel="nofollow" target="_blank"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F&amp;title=Int%C3%A9grer%20un%20gestionnaire%20de%20fichiers%20dans%20dmCkEditorPlugin&amp;bodytext=Bonjour%2C%0D%0Aje%20laisse%20ici%20une%20petite%20astuce%20pour%20int%C3%A9grer%20KFM%20%28http%3A%2F%2Fkfm.verens.com%2F%29%2C%20un%20excellent%20gestionnaire%20de%20fichiers%20en%20AJAX%2C%20au%20plugin%20Diem%20nomm%C3%A9%20dmCkEditorPlugin.%20Ce%20plugin%20offre%20un%20nouveau%20widget%20contenant%2C%20comme%20son%20nom%20l%27indique%2C%20l%27%C3%A9di" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a
rel="nofollow" target="_blank"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F&amp;title=Int%C3%A9grer%20un%20gestionnaire%20de%20fichiers%20dans%20dmCkEditorPlugin" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a
rel="nofollow" target="_blank"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F&amp;title=Int%C3%A9grer%20un%20gestionnaire%20de%20fichiers%20dans%20dmCkEditorPlugin&amp;notes=Bonjour%2C%0D%0Aje%20laisse%20ici%20une%20petite%20astuce%20pour%20int%C3%A9grer%20KFM%20%28http%3A%2F%2Fkfm.verens.com%2F%29%2C%20un%20excellent%20gestionnaire%20de%20fichiers%20en%20AJAX%2C%20au%20plugin%20Diem%20nomm%C3%A9%20dmCkEditorPlugin.%20Ce%20plugin%20offre%20un%20nouveau%20widget%20contenant%2C%20comme%20son%20nom%20l%27indique%2C%20l%27%C3%A9di" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a
rel="nofollow" target="_blank"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F&amp;t=Int%C3%A9grer%20un%20gestionnaire%20de%20fichiers%20dans%20dmCkEditorPlugin" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a
rel="nofollow" target="_blank"  href="http://twitter.com/home?status=Int%C3%A9grer%20un%20gestionnaire%20de%20fichiers%20dans%20dmCkEditorPlugin%20-%20http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a
rel="nofollow" target="_blank"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F&amp;title=Int%C3%A9grer%20un%20gestionnaire%20de%20fichiers%20dans%20dmCkEditorPlugin&amp;annotation=Bonjour%2C%0D%0Aje%20laisse%20ici%20une%20petite%20astuce%20pour%20int%C3%A9grer%20KFM%20%28http%3A%2F%2Fkfm.verens.com%2F%29%2C%20un%20excellent%20gestionnaire%20de%20fichiers%20en%20AJAX%2C%20au%20plugin%20Diem%20nomm%C3%A9%20dmCkEditorPlugin.%20Ce%20plugin%20offre%20un%20nouveau%20widget%20contenant%2C%20comme%20son%20nom%20l%27indique%2C%20l%27%C3%A9di" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a
rel="nofollow" target="_blank"  href="http://www.friendfeed.com/share?title=Int%C3%A9grer%20un%20gestionnaire%20de%20fichiers%20dans%20dmCkEditorPlugin&amp;link=http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/friendfeed.png" class="sociable-img sociable-hovers" title="FriendFeed" alt="FriendFeed" /></a><a
rel="nofollow" target="_blank"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F&amp;title=Int%C3%A9grer%20un%20gestionnaire%20de%20fichiers%20dans%20dmCkEditorPlugin&amp;source=William%26%23039%3Bs+Blog+D%C3%A9veloppeur+web+ind%C3%A9pendant%2C+%C3%A9tudiant+et+passionn%C3%A9+%21+%23Symfony2+%23Rails+%23Diem+%23Git+%23Nginx+%23WebPerfs+%23SoftwareQuality&amp;summary=Bonjour%2C%0D%0Aje%20laisse%20ici%20une%20petite%20astuce%20pour%20int%C3%A9grer%20KFM%20%28http%3A%2F%2Fkfm.verens.com%2F%29%2C%20un%20excellent%20gestionnaire%20de%20fichiers%20en%20AJAX%2C%20au%20plugin%20Diem%20nomm%C3%A9%20dmCkEditorPlugin.%20Ce%20plugin%20offre%20un%20nouveau%20widget%20contenant%2C%20comme%20son%20nom%20l%27indique%2C%20l%27%C3%A9di" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a
rel="nofollow" target="_blank"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F&amp;t=Int%C3%A9grer%20un%20gestionnaire%20de%20fichiers%20dans%20dmCkEditorPlugin" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/myspace.png" class="sociable-img sociable-hovers" title="MySpace" alt="MySpace" /></a><a
rel="nofollow" target="_blank"  href="http://www.netvibes.com/share?title=Int%C3%A9grer%20un%20gestionnaire%20de%20fichiers%20dans%20dmCkEditorPlugin&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/netvibes.png" class="sociable-img sociable-hovers" title="Netvibes" alt="Netvibes" /></a><a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/pdf.png" class="sociable-img sociable-hovers" title="PDF" alt="PDF" /></a><a
rel="nofollow" target="_blank"  href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F&amp;title=Int%C3%A9grer%20un%20gestionnaire%20de%20fichiers%20dans%20dmCkEditorPlugin&amp;body=Bonjour%2C%0D%0Aje%20laisse%20ici%20une%20petite%20astuce%20pour%20int%C3%A9grer%20KFM%20%28http%3A%2F%2Fkfm.verens.com%2F%29%2C%20un%20excellent%20gestionnaire%20de%20fichiers%20en%20AJAX%2C%20au%20plugin%20Diem%20nomm%C3%A9%20dmCkEditorPlugin.%20Ce%20plugin%20offre%20un%20nouveau%20widget%20contenant%2C%20comme%20son%20nom%20l%27indique%2C%20l%27%C3%A9di" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/ping.png" class="sociable-img sociable-hovers" title="Ping.fm" alt="Ping.fm" /></a><a
rel="nofollow" target="_blank"  href="http://www.willdurand.fr/feed/" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><a
rel="nofollow" target="_blank"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/technorati.png" class="sociable-img sociable-hovers" title="Technorati" alt="Technorati" /></a><a
rel="nofollow" target="_blank"  href="http://www.viadeo.com/shareit/share/?url=http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F&title=Int%C3%A9grer%20un%20gestionnaire%20de%20fichiers%20dans%20dmCkEditorPlugin&urllanguage=fr" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/viadeo.png" class="sociable-img sociable-hovers" title="viadeo FR" alt="viadeo FR" /></a><a
rel="nofollow" target="_blank"  href="http://www.wikio.com/vote?url=http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/wikio.png" class="sociable-img sociable-hovers" title="Wikio" alt="Wikio" /></a><a
rel="nofollow" target="_blank"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.willdurand.fr%2Fintegrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin%2F&amp;submitHeadline=Int%C3%A9grer%20un%20gestionnaire%20de%20fichiers%20dans%20dmCkEditorPlugin&amp;submitSummary=Bonjour%2C%0D%0Aje%20laisse%20ici%20une%20petite%20astuce%20pour%20int%C3%A9grer%20KFM%20%28http%3A%2F%2Fkfm.verens.com%2F%29%2C%20un%20excellent%20gestionnaire%20de%20fichiers%20en%20AJAX%2C%20au%20plugin%20Diem%20nomm%C3%A9%20dmCkEditorPlugin.%20Ce%20plugin%20offre%20un%20nouveau%20widget%20contenant%2C%20comme%20son%20nom%20l%27indique%2C%20l%27%C3%A9di&amp;submitCategory=science&amp;submitAssetType=text" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/yahoobuzz.png" class="sociable-img sociable-hovers" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a><br
/><br
/>]]></content:encoded> <wfw:commentRss>http://www.willdurand.fr/integrer-un-gestionnaire-de-fichiers-dans-dmckeditorplugin/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Connaissiez-vous … la commande Symfony/Doctrine qui fait le ménage ?</title><link>http://www.willdurand.fr/connaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=connaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage</link> <comments>http://www.willdurand.fr/connaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage/#comments</comments> <pubDate>Wed, 30 Jun 2010 11:35:42 +0000</pubDate> <dc:creator>Will</dc:creator> <category><![CDATA[Ancien blog]]></category> <category><![CDATA[Doctrine]]></category> <category><![CDATA[Symfony]]></category> <category><![CDATA[Tips]]></category><guid
isPermaLink="false"></guid> <description><![CDATA[En développant avec Symfony on est parfois amené à supprimer des classes dans notreschema.yml, sauf que Symfony ne supprime pas tout ce qui a été généré automatiquement avec Doctrine. Une petite commande a été introduite depuis la version 1.4 de Symfony : php symfony doctrine:clean-model-files Elle détermine les fichiers du modèle à supprimer en se basant sur le schema.yml [...]]]></description> <content:encoded><![CDATA[<p
style="text-align: justify;">En développant avec <strong>Symfony </strong>on est parfois amené à supprimer des classes dans notre<em>schema.yml</em>, sauf que Symfony ne supprime pas tout ce qui a été généré automatiquement avec <strong>Doctrine</strong>.</p><p
style="text-align: justify;">Une petite commande a été introduite depuis la version 1.4 de <strong>Symfony </strong>:</p><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">php symfony doctrine:clean-model-files</div></div><p
style="text-align: justify;">Elle détermine les fichiers du modèle à supprimer en se basant sur le <em>schema.yml</em> courant.</p><p
style="text-align: justify;"><a
href="http://www.symfony-project.org/reference/1_4/fr/16-Tasks#chapter_16_sub_doctrine_clean_model_files">http://www.symfony-project.org/reference/1_4/fr/16-Tasks#chapter_16_sub_doctrine_clean_model_files</a></p><h3 class='related_post_title'>Related Posts</h3><ul
class='related_post'><li><a
href='http://www.willdurand.fr/definir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony/' title='Définir un nouveau comportement pour le modèle Doctrine et représenter intelligemment des objets en Symfony'>Définir un nouveau comportement pour le modèle Doctrine et représenter intelligemment des objets en Symfony</a></li><li><a
href='http://www.willdurand.fr/desactiver-son-application-symfony-et-prevenir-les-utilisateurs/' title='Désactiver son application Symfony et prévenir les utilisateurs'>Désactiver son application Symfony et prévenir les utilisateurs</a></li><li><a
href='http://www.willdurand.fr/symfony-jenkins-co/' title=' Symfony, Jenkins &amp; co'> Symfony, Jenkins &#038; co</a></li><li><a
href='http://www.willdurand.fr/symfony-live-2011/' title='Symfony live 2011'>Symfony live 2011</a></li><li><a
href='http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/' title='symfony rencontre Hudson, Mantis et les autres'>symfony rencontre Hudson, Mantis et les autres</a></li></ul> <a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/printfriendly.png" class="sociable-img sociable-hovers" title="Print" alt="Print" /></a><a
rel="nofollow" target="_blank"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F&amp;title=Connaissiez-vous%20%E2%80%A6%20la%20commande%20Symfony%2FDoctrine%20qui%20fait%20le%20m%C3%A9nage%20%3F&amp;bodytext=En%20d%C3%A9veloppant%20avec%C2%A0Symfony%20on%20est%20parfois%20amen%C3%A9%20%C3%A0%20supprimer%20des%20classes%20dans%20notreschema.yml%2C%20sauf%20que%20Symfony%20ne%20supprime%20pas%20tout%20ce%20qui%20a%20%C3%A9t%C3%A9%20g%C3%A9n%C3%A9r%C3%A9%20automatiquement%20avec%C2%A0Doctrine.%0D%0AUne%20petite%20commande%20a%20%C3%A9t%C3%A9%20introduite%20depuis%20la%20versio" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a
rel="nofollow" target="_blank"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F&amp;title=Connaissiez-vous%20%E2%80%A6%20la%20commande%20Symfony%2FDoctrine%20qui%20fait%20le%20m%C3%A9nage%20%3F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a
rel="nofollow" target="_blank"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F&amp;title=Connaissiez-vous%20%E2%80%A6%20la%20commande%20Symfony%2FDoctrine%20qui%20fait%20le%20m%C3%A9nage%20%3F&amp;notes=En%20d%C3%A9veloppant%20avec%C2%A0Symfony%20on%20est%20parfois%20amen%C3%A9%20%C3%A0%20supprimer%20des%20classes%20dans%20notreschema.yml%2C%20sauf%20que%20Symfony%20ne%20supprime%20pas%20tout%20ce%20qui%20a%20%C3%A9t%C3%A9%20g%C3%A9n%C3%A9r%C3%A9%20automatiquement%20avec%C2%A0Doctrine.%0D%0AUne%20petite%20commande%20a%20%C3%A9t%C3%A9%20introduite%20depuis%20la%20versio" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a
rel="nofollow" target="_blank"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F&amp;t=Connaissiez-vous%20%E2%80%A6%20la%20commande%20Symfony%2FDoctrine%20qui%20fait%20le%20m%C3%A9nage%20%3F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a
rel="nofollow" target="_blank"  href="http://twitter.com/home?status=Connaissiez-vous%20%E2%80%A6%20la%20commande%20Symfony%2FDoctrine%20qui%20fait%20le%20m%C3%A9nage%20%3F%20-%20http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a
rel="nofollow" target="_blank"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F&amp;title=Connaissiez-vous%20%E2%80%A6%20la%20commande%20Symfony%2FDoctrine%20qui%20fait%20le%20m%C3%A9nage%20%3F&amp;annotation=En%20d%C3%A9veloppant%20avec%C2%A0Symfony%20on%20est%20parfois%20amen%C3%A9%20%C3%A0%20supprimer%20des%20classes%20dans%20notreschema.yml%2C%20sauf%20que%20Symfony%20ne%20supprime%20pas%20tout%20ce%20qui%20a%20%C3%A9t%C3%A9%20g%C3%A9n%C3%A9r%C3%A9%20automatiquement%20avec%C2%A0Doctrine.%0D%0AUne%20petite%20commande%20a%20%C3%A9t%C3%A9%20introduite%20depuis%20la%20versio" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a
rel="nofollow" target="_blank"  href="http://www.friendfeed.com/share?title=Connaissiez-vous%20%E2%80%A6%20la%20commande%20Symfony%2FDoctrine%20qui%20fait%20le%20m%C3%A9nage%20%3F&amp;link=http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/friendfeed.png" class="sociable-img sociable-hovers" title="FriendFeed" alt="FriendFeed" /></a><a
rel="nofollow" target="_blank"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F&amp;title=Connaissiez-vous%20%E2%80%A6%20la%20commande%20Symfony%2FDoctrine%20qui%20fait%20le%20m%C3%A9nage%20%3F&amp;source=William%26%23039%3Bs+Blog+D%C3%A9veloppeur+web+ind%C3%A9pendant%2C+%C3%A9tudiant+et+passionn%C3%A9+%21+%23Symfony2+%23Rails+%23Diem+%23Git+%23Nginx+%23WebPerfs+%23SoftwareQuality&amp;summary=En%20d%C3%A9veloppant%20avec%C2%A0Symfony%20on%20est%20parfois%20amen%C3%A9%20%C3%A0%20supprimer%20des%20classes%20dans%20notreschema.yml%2C%20sauf%20que%20Symfony%20ne%20supprime%20pas%20tout%20ce%20qui%20a%20%C3%A9t%C3%A9%20g%C3%A9n%C3%A9r%C3%A9%20automatiquement%20avec%C2%A0Doctrine.%0D%0AUne%20petite%20commande%20a%20%C3%A9t%C3%A9%20introduite%20depuis%20la%20versio" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a
rel="nofollow" target="_blank"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F&amp;t=Connaissiez-vous%20%E2%80%A6%20la%20commande%20Symfony%2FDoctrine%20qui%20fait%20le%20m%C3%A9nage%20%3F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/myspace.png" class="sociable-img sociable-hovers" title="MySpace" alt="MySpace" /></a><a
rel="nofollow" target="_blank"  href="http://www.netvibes.com/share?title=Connaissiez-vous%20%E2%80%A6%20la%20commande%20Symfony%2FDoctrine%20qui%20fait%20le%20m%C3%A9nage%20%3F&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/netvibes.png" class="sociable-img sociable-hovers" title="Netvibes" alt="Netvibes" /></a><a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/pdf.png" class="sociable-img sociable-hovers" title="PDF" alt="PDF" /></a><a
rel="nofollow" target="_blank"  href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F&amp;title=Connaissiez-vous%20%E2%80%A6%20la%20commande%20Symfony%2FDoctrine%20qui%20fait%20le%20m%C3%A9nage%20%3F&amp;body=En%20d%C3%A9veloppant%20avec%C2%A0Symfony%20on%20est%20parfois%20amen%C3%A9%20%C3%A0%20supprimer%20des%20classes%20dans%20notreschema.yml%2C%20sauf%20que%20Symfony%20ne%20supprime%20pas%20tout%20ce%20qui%20a%20%C3%A9t%C3%A9%20g%C3%A9n%C3%A9r%C3%A9%20automatiquement%20avec%C2%A0Doctrine.%0D%0AUne%20petite%20commande%20a%20%C3%A9t%C3%A9%20introduite%20depuis%20la%20versio" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/ping.png" class="sociable-img sociable-hovers" title="Ping.fm" alt="Ping.fm" /></a><a
rel="nofollow" target="_blank"  href="http://www.willdurand.fr/feed/" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><a
rel="nofollow" target="_blank"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/technorati.png" class="sociable-img sociable-hovers" title="Technorati" alt="Technorati" /></a><a
rel="nofollow" target="_blank"  href="http://www.viadeo.com/shareit/share/?url=http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F&title=Connaissiez-vous%20%E2%80%A6%20la%20commande%20Symfony%2FDoctrine%20qui%20fait%20le%20m%C3%A9nage%20%3F&urllanguage=fr" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/viadeo.png" class="sociable-img sociable-hovers" title="viadeo FR" alt="viadeo FR" /></a><a
rel="nofollow" target="_blank"  href="http://www.wikio.com/vote?url=http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/wikio.png" class="sociable-img sociable-hovers" title="Wikio" alt="Wikio" /></a><a
rel="nofollow" target="_blank"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.willdurand.fr%2Fconnaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage%2F&amp;submitHeadline=Connaissiez-vous%20%E2%80%A6%20la%20commande%20Symfony%2FDoctrine%20qui%20fait%20le%20m%C3%A9nage%20%3F&amp;submitSummary=En%20d%C3%A9veloppant%20avec%C2%A0Symfony%20on%20est%20parfois%20amen%C3%A9%20%C3%A0%20supprimer%20des%20classes%20dans%20notreschema.yml%2C%20sauf%20que%20Symfony%20ne%20supprime%20pas%20tout%20ce%20qui%20a%20%C3%A9t%C3%A9%20g%C3%A9n%C3%A9r%C3%A9%20automatiquement%20avec%C2%A0Doctrine.%0D%0AUne%20petite%20commande%20a%20%C3%A9t%C3%A9%20introduite%20depuis%20la%20versio&amp;submitCategory=science&amp;submitAssetType=text" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/yahoobuzz.png" class="sociable-img sociable-hovers" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a><br
/><br
/>]]></content:encoded> <wfw:commentRss>http://www.willdurand.fr/connaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Définir un nouveau comportement pour le modèle Doctrine et représenter intelligemment des objets en Symfony</title><link>http://www.willdurand.fr/definir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=definir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony</link> <comments>http://www.willdurand.fr/definir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony/#comments</comments> <pubDate>Thu, 06 May 2010 13:26:44 +0000</pubDate> <dc:creator>Will</dc:creator> <category><![CDATA[Ancien blog]]></category> <category><![CDATA[Doctrine]]></category> <category><![CDATA[Symfony]]></category> <category><![CDATA[Tips]]></category><guid
isPermaLink="false"></guid> <description><![CDATA[Lors d&#8217;une utilisation poussée de Doctrine on peut être amené à vouloir redéfinir le comportement par défaut de notre modèle. Pour cela, on peut intercaler notre propre couche entre le code de base de Doctrine et le code généré. La première chose à faire est d&#8217;indiquer à Doctrine notre sur-couche en éditant le fichier config/ProjectConfiguration.class.php [...]]]></description> <content:encoded><![CDATA[<p
style="text-align: justify;">Lors d&#8217;une utilisation poussée de <strong>Doctrine</strong> on peut être amené à vouloir redéfinir le comportement par défaut de notre modèle. Pour cela, on peut intercaler notre propre couche entre le code de base de <strong>Doctrine</strong> et le code généré.</p><p
style="text-align: justify;">La première chose à faire est d&#8217;indiquer à <strong>Doctrine</strong> notre sur-couche en éditant le fichier <em>config/ProjectConfiguration.class.php</em> :</p><div
class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #000000; font-weight: bold;">class</span> ProjectConfiguration <span
style="color: #000000; font-weight: bold;">extends</span> sfProjectConfiguration<br
/> <span
style="color: #009900;">&#123;</span><br
/> &nbsp; <span
style="color: #000000; font-weight: bold;">public</span> <span
style="color: #000000; font-weight: bold;">function</span> setup<span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; <span
style="color: #666666; font-style: italic;">// ...</span><br
/> <br
/> &nbsp; &nbsp; <span
style="color: #666666; font-style: italic;">// custom config Doctrine</span><br
/> &nbsp; &nbsp; sfConfig<span
style="color: #339933;">::</span><span
style="color: #004000;">set</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'doctrine_model_builder_options'</span><span
style="color: #339933;">,</span> <a
href="http://www.php.net/array"><span
style="color: #990000;">array</span></a><span
style="color: #009900;">&#40;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #0000ff;">'baseTableClassName'</span> <span
style="color: #339933;">=&gt;</span> <span
style="color: #0000ff;">'MyDoctrineTable'</span><span
style="color: #339933;">,</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #0000ff;">'baseClassName'</span> <span
style="color: #339933;">=&gt;</span> <span
style="color: #0000ff;">'MyDoctrineRecord'</span><span
style="color: #009900;">&#41;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> &nbsp; <span
style="color: #009900;">&#125;</span><br
/> <span
style="color: #009900;">&#125;</span></div></div><p
style="text-align: justify;"></p><p
style="text-align: justify;">Ensuite, on va créé nos deux classes personnalisées. Bien évidemment les deux classes héritent des classes de base de <strong>Doctrine</strong> :</p><div
class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #000000; font-weight: bold;">class</span> MyDoctrineTable <span
style="color: #000000; font-weight: bold;">extends</span> Doctrine_Table<br
/> <span
style="color: #009900;">&#123;</span><br
/> &nbsp; <span
style="color: #666666; font-style: italic;">// ...</span><br
/> <span
style="color: #009900;">&#125;</span><br
/> <br
/> <span
style="color: #000000; font-weight: bold;">class</span> MyDoctrineRecord <span
style="color: #000000; font-weight: bold;">extends</span> sfDoctrineRecord<br
/> <span
style="color: #009900;">&#123;</span><br
/> &nbsp; <span
style="color: #666666; font-style: italic;">// ...</span><br
/> <span
style="color: #009900;">&#125;</span></div></div><p
style="text-align: justify;"></p><p
style="text-align: justify;">Une fois les nouveaux comportements écrits, il suffit de générer  à nouveau le modèle :</p><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">symfony doctrine:build-model</div></div><p
style="text-align: justify;"></p><p
style="text-align: justify;">Les classes qui étendent <strong>MyDoctrineRecord </strong>seront instantanément modifiées (puisqu&#8217;on va redéfinir le <strong>extends </strong>des classes <strong>Base</strong><strong>*</strong>). Pour les classes <strong>*T</strong><strong>able</strong>, les existantes devront être modifiées à la main, les nouvelles classes seront par contre définies correctement.</p><p
style="text-align: justify;"></p><p
style="text-align: justify;">Si vous ne l&#8217;avez pas encore remarqué, <strong>Doctrine </strong>est capable de deviner un meilleur attribut à afficher lorsqu&#8217;on affiche un objet. Par exemple :</p><div
class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #000000; font-weight: bold;">public</span> <span
style="color: #000000; font-weight: bold;">function</span> executeIndex<span
style="color: #009900;">&#40;</span>sfWebRequest <span
style="color: #000088;">$request</span><span
style="color: #009900;">&#41;</span><br
/> <span
style="color: #009900;">&#123;</span><br
/> &nbsp; <span
style="color: #000088;">$this</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">admin</span> <span
style="color: #339933;">=</span> Doctrine<span
style="color: #339933;">::</span><span
style="color: #004000;">getTable</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'Administrateur'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">findOneByIdentifiant</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'admin'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #009900;">&#125;</span></div></div><div
class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;!-- indexSuccess.php --&gt;<br
/> &lt;p&gt;<span
style="color: #000000; font-weight: bold;">&lt;?php</span> <span
style="color: #b1b100;">echo</span> <span
style="color: #000088;">$admin</span> <span
style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;<br
/> // Affichera &quot;1&quot;, l'id de l'administrateur</div></div><p
style="text-align: justify;">Mais si nous avions à faire à un article avec un <em>title</em>, alors le titre serait affiché. En fait, des champs sont prédéfinis dans <strong>Doctrine</strong>.</p><p
style="text-align: justify;"></p><p
style="text-align: justify;">Ce qui peut être intéressant, c&#8217;est de pouvoir <span
style="text-decoration: underline;">gérer ces champs</span> parce que par défaut ils sont <span
style="text-decoration: underline;">hardcodés</span> : <em>name</em>, <em>title</em>, <em>description</em>, <em>subject</em>, <em>keywords </em>et bien sûr <em>id</em>.</p><p
style="text-align: justify;">Pour cela, ce qui précède va nous être utile. Créons le fichier de configuration <em>config/settings.yml</em> :</p><div
class="codecolorer-container yaml vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="yaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># config/settings.yml<br
/> <span
style="">all</span>:<br
/> <span
style=""> &nbsp;doctrine</span>:<br
/> <span
style=""> &nbsp; &nbsp;identifier_fields</span>: <span
class="br0">&#91;</span>identifiant, foo, bar, id<span
class="br0">&#93;</span> # Preference order</div></div><p
style="text-align: justify;"></p><p
style="text-align: justify;">Nous pourrons ainsi définir nos propres <strong>identifiers</strong>. Ensuite, redéfinissons le comportement d&#8217;un enregistrement <strong>Doctrine </strong>:</p><div
class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #000000; font-weight: bold;">class</span> MyDoctrineRecord <span
style="color: #000000; font-weight: bold;">extends</span> sfDoctrineRecord<br
/> <span
style="color: #009900;">&#123;</span><br
/> &nbsp; <span
style="color: #000000; font-weight: bold;">public</span> <span
style="color: #000000; font-weight: bold;">function</span> __toString<span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; try<br
/> &nbsp; &nbsp; <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #b1b100;">return</span> <span
style="color: #009900;">&#40;</span>string<span
style="color: #009900;">&#41;</span> <span
style="color: #000088;">$this</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">get</span><span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$this</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">table</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">getIdentifierColumnName</span><span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; <span
style="color: #009900;">&#125;</span><br
/> &nbsp; &nbsp; catch<span
style="color: #009900;">&#40;</span>Exception <span
style="color: #000088;">$e</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; &nbsp; <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #000088;">$guesses</span> <span
style="color: #339933;">=</span> <a
href="http://www.php.net/array"><span
style="color: #990000;">array</span></a><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'name'</span><span
style="color: #339933;">,</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #0000ff;">'title'</span><span
style="color: #339933;">,</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #0000ff;">'description'</span><span
style="color: #339933;">,</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #0000ff;">'subject'</span><span
style="color: #339933;">,</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #0000ff;">'keywords'</span><span
style="color: #339933;">,</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #0000ff;">'id'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #666666; font-style: italic;">// we try to guess a column which would give a good description of the object</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #b1b100;">foreach</span> <span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$guesses</span> <span
style="color: #b1b100;">as</span> <span
style="color: #000088;">$descriptionColumn</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; try<br
/> &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #b1b100;">return</span> <span
style="color: #009900;">&#40;</span>string<span
style="color: #009900;">&#41;</span> <span
style="color: #000088;">$this</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">get</span><span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$descriptionColumn</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #009900;">&#125;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; catch <span
style="color: #009900;">&#40;</span>Exception <span
style="color: #000088;">$e1</span><span
style="color: #009900;">&#41;</span> <span
style="color: #009900;">&#123;</span><span
style="color: #009900;">&#125;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;">&#125;</span><br
/> &nbsp; &nbsp; <span
style="color: #009900;">&#125;</span><br
/> <br
/> &nbsp; &nbsp; <span
style="color: #b1b100;">return</span> <a
href="http://www.php.net/sprintf"><span
style="color: #990000;">sprintf</span></a><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'No description for object of class &quot;%s&quot;'</span><span
style="color: #339933;">,</span> <span
style="color: #000088;">$this</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">getTable</span><span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">getComponentName</span><span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> &nbsp; <span
style="color: #009900;">&#125;</span><br
/> <span
style="color: #009900;">&#125;</span></div></div><p
style="text-align: justify;">C&#8217;est une simple adaptation de la méthode <em>__toString()</em> par défaut. On ajoute juste un appel à la méthode <em>getIdentifierColumnName()</em> que nous allons définir ci-après.</p><p
style="text-align: justify;"></p><div
class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #000000; font-weight: bold;">class</span> MyDoctrineTable <span
style="color: #000000; font-weight: bold;">extends</span> Doctrine_Table<br
/> <span
style="color: #009900;">&#123;</span><br
/> <span
style="color: #009933; font-style: italic;">/**<br
/> * Find a column name that represents a record<br
/> */</span><br
/> <span
style="color: #000000; font-weight: bold;">public</span> <span
style="color: #000000; font-weight: bold;">function</span> getIdentifierColumnName<span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><br
/> <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; <span
style="color: #666666; font-style: italic;">/* config/settings.yml */</span><br
/> &nbsp; &nbsp; <span
style="color: #000088;">$columns</span> <span
style="color: #339933;">=</span> <a
href="http://www.php.net/array_intersect"><span
style="color: #990000;">array_intersect</span></a><span
style="color: #009900;">&#40;</span>sfConfig<span
style="color: #339933;">::</span><span
style="color: #004000;">get</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'sf_doctrine_identifier_fields'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">,</span> <span
style="color: #000088;">$this</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">getColumnNames</span><span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <br
/> &nbsp; &nbsp; <span
style="color: #b1b100;">if</span><span
style="color: #009900;">&#40;</span><span
style="color: #339933;">!</span><span
style="color: #000088;">$columns</span><span
style="color: #009900;">&#91;</span><span
style="color: #cc66cc;">0</span><span
style="color: #009900;">&#93;</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; &nbsp; <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #666666; font-style: italic;">/* identifier column names */</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #000088;">$columns</span> <span
style="color: #339933;">=</span> <span
style="color: #000088;">$this</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">getIdentifierColumnNames</span><span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #b1b100;">if</span><span
style="color: #009900;">&#40;</span><span
style="color: #339933;">!</span><span
style="color: #000088;">$columns</span><span
style="color: #009900;">&#91;</span><span
style="color: #cc66cc;">0</span><span
style="color: #009900;">&#93;</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #666666; font-style: italic;">/* Default: the first column */</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #000088;">$columns</span> <span
style="color: #339933;">=</span> <span
style="color: #000088;">$this</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">getColumnNames</span><span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #009900;">&#125;</span><br
/> &nbsp; &nbsp; <span
style="color: #009900;">&#125;</span><br
/> <br
/> &nbsp; &nbsp; <span
style="color: #b1b100;">return</span> <span
style="color: #000088;">$columns</span><span
style="color: #009900;">&#91;</span><span
style="color: #cc66cc;">0</span><span
style="color: #009900;">&#93;</span><span
style="color: #339933;">;</span><br
/> &nbsp; <span
style="color: #009900;">&#125;</span><br
/> <span
style="color: #009900;">&#125;</span></div></div><p
style="text-align: justify;">Cette redéfinition permet d&#8217;utiliser notre configuration d&#8217;écrite dans le fichier <em>config/settings.yml</em>. On tente de trouver un meilleur attribut, si ce n&#8217;est pas le cas on fait appel à la méthode <em>getIdentifierColumnNames()</em> qui retourne un tableau d&#8217;identifiers créés à l&#8217;initialisation. Si cela ne fonctionne toujours pas, on retourne la première colonne de la table.</p><p
style="text-align: justify;"></p><p
style="text-align: justify;">En reprenant notre exemple, nous obtenons :</p><div
class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #000000; font-weight: bold;">public</span> <span
style="color: #000000; font-weight: bold;">function</span> executeIndex<span
style="color: #009900;">&#40;</span>sfWebRequest <span
style="color: #000088;">$request</span><span
style="color: #009900;">&#41;</span><br
/> <span
style="color: #009900;">&#123;</span><br
/> <span
style="color: #000088;">$this</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">test</span> <span
style="color: #339933;">=</span> Doctrine<span
style="color: #339933;">::</span><span
style="color: #004000;">getTable</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'Administrateur'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">findOneByIdentifiant</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'admin'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #009900;">&#125;</span></div></div><div
class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;!-- indexSuccess.php --&gt;<br
/> &lt;p&gt;<span
style="color: #000000; font-weight: bold;">&lt;?php</span> <span
style="color: #b1b100;">echo</span> <span
style="color: #000088;">$admin</span> <span
style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;<br
/> // Affichera &quot;admin&quot;, l'identifiant de l'administrateur</div></div><p
style="text-align: justify;"></p><p
style="text-align: justify;">Ceci peut, à mon sens, être utile.</p><h3 class='related_post_title'>Related Posts</h3><ul
class='related_post'><li><a
href='http://www.willdurand.fr/connaissiez-vous-la-commande-symfony-doctrine-qui-fait-le-menage/' title='Connaissiez-vous … la commande Symfony/Doctrine qui fait le ménage ?'>Connaissiez-vous … la commande Symfony/Doctrine qui fait le ménage ?</a></li><li><a
href='http://www.willdurand.fr/desactiver-son-application-symfony-et-prevenir-les-utilisateurs/' title='Désactiver son application Symfony et prévenir les utilisateurs'>Désactiver son application Symfony et prévenir les utilisateurs</a></li><li><a
href='http://www.willdurand.fr/symfony-jenkins-co/' title=' Symfony, Jenkins &amp; co'> Symfony, Jenkins &#038; co</a></li><li><a
href='http://www.willdurand.fr/symfony-live-2011/' title='Symfony live 2011'>Symfony live 2011</a></li><li><a
href='http://www.willdurand.fr/symfony-rencontre-hudson-mantis-et-les-autres/' title='symfony rencontre Hudson, Mantis et les autres'>symfony rencontre Hudson, Mantis et les autres</a></li></ul> <a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/printfriendly.png" class="sociable-img sociable-hovers" title="Print" alt="Print" /></a><a
rel="nofollow" target="_blank"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F&amp;title=D%C3%A9finir%20un%20nouveau%20comportement%20pour%20le%20mod%C3%A8le%20Doctrine%20et%20repr%C3%A9senter%20intelligemment%20des%20objets%20en%20Symfony&amp;bodytext=Lors%20d%27une%20utilisation%20pouss%C3%A9e%20de%20Doctrine%20on%20peut%20%C3%AAtre%20amen%C3%A9%20%C3%A0%20vouloir%20red%C3%A9finir%20le%20comportement%20par%20d%C3%A9faut%20de%20notre%20mod%C3%A8le.%20Pour%20cela%2C%20on%20peut%20intercaler%20notre%20propre%20couche%20entre%20le%20code%20de%20base%20de%20Doctrine%20et%20le%20code%20g%C3%A9n%C3%A9r%C3%A9.%0D%0ALa%20premi%C3%A8" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a
rel="nofollow" target="_blank"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F&amp;title=D%C3%A9finir%20un%20nouveau%20comportement%20pour%20le%20mod%C3%A8le%20Doctrine%20et%20repr%C3%A9senter%20intelligemment%20des%20objets%20en%20Symfony" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a
rel="nofollow" target="_blank"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F&amp;title=D%C3%A9finir%20un%20nouveau%20comportement%20pour%20le%20mod%C3%A8le%20Doctrine%20et%20repr%C3%A9senter%20intelligemment%20des%20objets%20en%20Symfony&amp;notes=Lors%20d%27une%20utilisation%20pouss%C3%A9e%20de%20Doctrine%20on%20peut%20%C3%AAtre%20amen%C3%A9%20%C3%A0%20vouloir%20red%C3%A9finir%20le%20comportement%20par%20d%C3%A9faut%20de%20notre%20mod%C3%A8le.%20Pour%20cela%2C%20on%20peut%20intercaler%20notre%20propre%20couche%20entre%20le%20code%20de%20base%20de%20Doctrine%20et%20le%20code%20g%C3%A9n%C3%A9r%C3%A9.%0D%0ALa%20premi%C3%A8" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a
rel="nofollow" target="_blank"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F&amp;t=D%C3%A9finir%20un%20nouveau%20comportement%20pour%20le%20mod%C3%A8le%20Doctrine%20et%20repr%C3%A9senter%20intelligemment%20des%20objets%20en%20Symfony" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a
rel="nofollow" target="_blank"  href="http://twitter.com/home?status=D%C3%A9finir%20un%20nouveau%20comportement%20pour%20le%20mod%C3%A8le%20Doctrine%20et%20repr%C3%A9senter%20intelligemment%20des%20objets%20en%20Symfony%20-%20http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a
rel="nofollow" target="_blank"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F&amp;title=D%C3%A9finir%20un%20nouveau%20comportement%20pour%20le%20mod%C3%A8le%20Doctrine%20et%20repr%C3%A9senter%20intelligemment%20des%20objets%20en%20Symfony&amp;annotation=Lors%20d%27une%20utilisation%20pouss%C3%A9e%20de%20Doctrine%20on%20peut%20%C3%AAtre%20amen%C3%A9%20%C3%A0%20vouloir%20red%C3%A9finir%20le%20comportement%20par%20d%C3%A9faut%20de%20notre%20mod%C3%A8le.%20Pour%20cela%2C%20on%20peut%20intercaler%20notre%20propre%20couche%20entre%20le%20code%20de%20base%20de%20Doctrine%20et%20le%20code%20g%C3%A9n%C3%A9r%C3%A9.%0D%0ALa%20premi%C3%A8" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a
rel="nofollow" target="_blank"  href="http://www.friendfeed.com/share?title=D%C3%A9finir%20un%20nouveau%20comportement%20pour%20le%20mod%C3%A8le%20Doctrine%20et%20repr%C3%A9senter%20intelligemment%20des%20objets%20en%20Symfony&amp;link=http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/friendfeed.png" class="sociable-img sociable-hovers" title="FriendFeed" alt="FriendFeed" /></a><a
rel="nofollow" target="_blank"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F&amp;title=D%C3%A9finir%20un%20nouveau%20comportement%20pour%20le%20mod%C3%A8le%20Doctrine%20et%20repr%C3%A9senter%20intelligemment%20des%20objets%20en%20Symfony&amp;source=William%26%23039%3Bs+Blog+D%C3%A9veloppeur+web+ind%C3%A9pendant%2C+%C3%A9tudiant+et+passionn%C3%A9+%21+%23Symfony2+%23Rails+%23Diem+%23Git+%23Nginx+%23WebPerfs+%23SoftwareQuality&amp;summary=Lors%20d%27une%20utilisation%20pouss%C3%A9e%20de%20Doctrine%20on%20peut%20%C3%AAtre%20amen%C3%A9%20%C3%A0%20vouloir%20red%C3%A9finir%20le%20comportement%20par%20d%C3%A9faut%20de%20notre%20mod%C3%A8le.%20Pour%20cela%2C%20on%20peut%20intercaler%20notre%20propre%20couche%20entre%20le%20code%20de%20base%20de%20Doctrine%20et%20le%20code%20g%C3%A9n%C3%A9r%C3%A9.%0D%0ALa%20premi%C3%A8" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a
rel="nofollow" target="_blank"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F&amp;t=D%C3%A9finir%20un%20nouveau%20comportement%20pour%20le%20mod%C3%A8le%20Doctrine%20et%20repr%C3%A9senter%20intelligemment%20des%20objets%20en%20Symfony" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/myspace.png" class="sociable-img sociable-hovers" title="MySpace" alt="MySpace" /></a><a
rel="nofollow" target="_blank"  href="http://www.netvibes.com/share?title=D%C3%A9finir%20un%20nouveau%20comportement%20pour%20le%20mod%C3%A8le%20Doctrine%20et%20repr%C3%A9senter%20intelligemment%20des%20objets%20en%20Symfony&amp;url=http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/netvibes.png" class="sociable-img sociable-hovers" title="Netvibes" alt="Netvibes" /></a><a
rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/pdf.png" class="sociable-img sociable-hovers" title="PDF" alt="PDF" /></a><a
rel="nofollow" target="_blank"  href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F&amp;title=D%C3%A9finir%20un%20nouveau%20comportement%20pour%20le%20mod%C3%A8le%20Doctrine%20et%20repr%C3%A9senter%20intelligemment%20des%20objets%20en%20Symfony&amp;body=Lors%20d%27une%20utilisation%20pouss%C3%A9e%20de%20Doctrine%20on%20peut%20%C3%AAtre%20amen%C3%A9%20%C3%A0%20vouloir%20red%C3%A9finir%20le%20comportement%20par%20d%C3%A9faut%20de%20notre%20mod%C3%A8le.%20Pour%20cela%2C%20on%20peut%20intercaler%20notre%20propre%20couche%20entre%20le%20code%20de%20base%20de%20Doctrine%20et%20le%20code%20g%C3%A9n%C3%A9r%C3%A9.%0D%0ALa%20premi%C3%A8" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/ping.png" class="sociable-img sociable-hovers" title="Ping.fm" alt="Ping.fm" /></a><a
rel="nofollow" target="_blank"  href="http://www.willdurand.fr/feed/" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><a
rel="nofollow" target="_blank"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/technorati.png" class="sociable-img sociable-hovers" title="Technorati" alt="Technorati" /></a><a
rel="nofollow" target="_blank"  href="http://www.viadeo.com/shareit/share/?url=http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F&title=D%C3%A9finir%20un%20nouveau%20comportement%20pour%20le%20mod%C3%A8le%20Doctrine%20et%20repr%C3%A9senter%20intelligemment%20des%20objets%20en%20Symfony&urllanguage=fr" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/viadeo.png" class="sociable-img sociable-hovers" title="viadeo FR" alt="viadeo FR" /></a><a
rel="nofollow" target="_blank"  href="http://www.wikio.com/vote?url=http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/wikio.png" class="sociable-img sociable-hovers" title="Wikio" alt="Wikio" /></a><a
rel="nofollow" target="_blank"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.willdurand.fr%2Fdefinir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony%2F&amp;submitHeadline=D%C3%A9finir%20un%20nouveau%20comportement%20pour%20le%20mod%C3%A8le%20Doctrine%20et%20repr%C3%A9senter%20intelligemment%20des%20objets%20en%20Symfony&amp;submitSummary=Lors%20d%27une%20utilisation%20pouss%C3%A9e%20de%20Doctrine%20on%20peut%20%C3%AAtre%20amen%C3%A9%20%C3%A0%20vouloir%20red%C3%A9finir%20le%20comportement%20par%20d%C3%A9faut%20de%20notre%20mod%C3%A8le.%20Pour%20cela%2C%20on%20peut%20intercaler%20notre%20propre%20couche%20entre%20le%20code%20de%20base%20de%20Doctrine%20et%20le%20code%20g%C3%A9n%C3%A9r%C3%A9.%0D%0ALa%20premi%C3%A8&amp;submitCategory=science&amp;submitAssetType=text" ><img
src="http://www.willdurand.fr/wp-content/plugins/sociable-30/images/default/16/yahoobuzz.png" class="sociable-img sociable-hovers" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a><br
/><br
/>]]></content:encoded> <wfw:commentRss>http://www.willdurand.fr/definir-un-nouveau-comportement-pour-le-modele-doctrine-et-representer-intelligemment-des-objets-en-symfony/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 2/37 queries in 0.017 seconds using memcached
Object Caching 3756/3842 objects using memcached

Served from: www.willdurand.fr @ 2012-02-06 09:02:07 -->
