<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4967948429934587118</id><updated>2011-08-22T18:39:37.302+02:00</updated><category term='eclipse yii'/><category term='debug'/><category term='test'/><category term='outils'/><category term='yii'/><category term='extension'/><category term='validation'/><category term='form'/><title type='text'>Raoul 2000</title><subtitle type='html'>Yii Framework, PHP, tutoriel</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://raoul-2000.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4967948429934587118/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://raoul-2000.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Raoul</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4967948429934587118.post-4026633202871765664</id><published>2010-08-24T11:58:00.010+02:00</published><updated>2010-11-16T23:26:56.336+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='debug'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse yii'/><title type='text'>Eclipse + Yii : mise en place d'un environnement de développement</title><content type='html'>&lt;div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.yiiframework.com/files/logo/yii.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="86" src="http://www.yiiframework.com/files/logo/yii.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;1. Eclipse IDE&lt;/span&gt;&lt;/div&gt;&lt;hr /&gt;Télécharger la dernière version d'Eclipse - Choisir la distribution &lt;a href="http://www.eclipse.org/downloads/packages/eclipse-php-developers/heliosr"&gt;Eclipse for PHP Developers&lt;/a&gt;. Dans mon cas il s'agira donc de la version windows 32 bits (&lt;a href="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/helios/R/eclipse-php-helios-win32.zip"&gt;eclipse-php-helios-win32.zip&lt;/a&gt; - 143.5 Mo - version 3.6).&lt;br /&gt;&lt;div&gt;Une fois le téléchargement terminé, l'installation d'Eclipse consiste simplement à décompression du fichier Zip. Nous allons donc &lt;b&gt;créer &lt;/b&gt;le répertoire &lt;b&gt;c:\ide&lt;/b&gt; et y décompresser l'archive.&lt;/div&gt;&lt;div&gt;Voilà, Eclipse est installé, il se trouve dans le répertoire &lt;b&gt;c:\ide\eclipse&lt;/b&gt; Pour le lancer, il suffit d'éxécuter :&lt;br /&gt;&lt;b&gt;&amp;gt; c:\ide\eclipse\eclipse.exe&lt;/b&gt;&lt;br /&gt;Lors du premier lancement d'Eclipse, vous devez choisir un répertoire qui sera utilisé comme 'espace de travail' (en anglais, &lt;i&gt;workspace&lt;/i&gt;). Dans cet exemple j'ai choisi de créer un répertoire &lt;b&gt;c:\project&lt;/b&gt; pour cela. Tous les projets qui seront ensuite créés depuis Eclipse dans cet espace de travail, le seront donc dans ce répertoire.&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;i&gt;L'objet de cet article n'étant pas l'apprentissage de l'utilisation d'Eclipse, je vous laisse découvrir les fonctions disponibles par vous même, pour me concentrer sur le développement PHP.&lt;/i&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;2. Les Plugins Eclipse&lt;/span&gt;&lt;/div&gt;&lt;hr /&gt;&lt;div&gt;Cette version comporte déjà un certain nombre de fonctionnalités qu'il va nous falloir configurer. Par ailleurs, vous pouvez installer vos plugins favoris pour palier aux manques que vous constaterez. Personnellement, je me suis contenté de rajouter les plugins suivants :&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://subclipse.tigris.org/"&gt;Subclipse &lt;/a&gt;: la version compatible avec Eclipse 3.6 est la 1.6.x (&lt;a href="http://subclipse.tigris.org/servlets/ProjectProcess;jsessionid=881C79F4554A24C2E940D5899F2CCE7A?pageID=p4wYuA"&gt;installation&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.eclipse.org/dsdp/tm/tutorial/index.php"&gt;RSE (Remote System Explorer)&lt;/a&gt; : cette fonction permet d'accèder à des sytèmes externes par FTP, sftp/ssh etc ... En gros, sans quitter Eclipse vous pourrez naviguer sur votre serveur Web par FTP. RSE fait partie de la version d'Eclipse que nous venons d'installer, mais il ne prend pas en charge les protocoles qui nous intéressent (FTP, sftp/ssh), on va donc télécharger ce plugin et l'installer (cette fois à la main, pas de lien direct depuis Eclipse).&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Concernant l'installation des plugins Eclipse, je suis tombé par hasard sur une méthode qui m'a semblé bien astucieuse et pratique : les fichiers &lt;b&gt;link&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Le principe est simple :&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;créer le répetoire &lt;b&gt;c:\ide\eclipse-plugins&lt;/b&gt; où tous les plugins seront stockés&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.eclipse.org/dsdp/tm/downloads/"&gt;télécharger le plugin&lt;/a&gt; a installer (par exemple RSE - fichier  : RSE-runtime-3.2.zip)&lt;/li&gt;&lt;li&gt;créer le répertoire &lt;b&gt;c:\ide\eclipse-plugin\RSE-3.2&lt;/b&gt; et y décompresser&lt;b&gt; RSE-runtime-3.2.zip&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;créer le répertoire&lt;b&gt; c:\ide\eclipse\links&lt;/b&gt;&lt;/li&gt;&lt;li&gt;créer le fichier &lt;b&gt;c:\ide\eclipse\links\mes_plugins.link&lt;/b&gt; (le nom importe peu, mais l'extension doit être .link)&lt;/li&gt;&lt;li&gt;ouvrir le fichier link et y ajouter la ligne suivante : &lt;b&gt;path=C:/ide/eclipse-plugins/RSE-3.2&lt;/b&gt;&lt;/li&gt;&lt;li&gt;sauver et fermer&lt;/li&gt;&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_6ORsAWkyfAo/THO_bftGX8I/AAAAAAAAA0w/ugKGwXTehkE/s1600/2010-08-24_144551.png" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5508957248292282306" src="http://1.bp.blogspot.com/_6ORsAWkyfAo/THO_bftGX8I/AAAAAAAAA0w/ugKGwXTehkE/s320/2010-08-24_144551.png" style="float: left; height: 189px; margin-bottom: 10px; margin-left: 0px; margin-right: 10px; margin-top: 0px; width: 162px;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Ensuite on relance Eclipse et Ô magie ! .. le R&lt;i&gt;emote System Explorer&lt;/i&gt; nous propose les protocoles FTP, sftp/ssh etc ... Cette façon d'installer des plugins est décrite en détail dans &lt;a href="http://www.venukb.com/2006/08/20/install-eclipse-plugins-the-easy-way/"&gt;cet article&lt;/a&gt; (en anglais). Les avantages de cette méthode sont multiples :&lt;br /&gt;&lt;ol&gt;&lt;li&gt;la désinstallation d'un plugin est simple : supprimez le fichier link, ou la référence au plugin dans un fichier link comportant plusieurs références. (amusez-vous à enlever un plugin installé directement dans Eclipse, vous comprendrez)&lt;/li&gt;&lt;li&gt;Plusieurs version d'Eclipse peuvent utiliser les mêmes plugins immédiatement&lt;/li&gt;&lt;li&gt;la gestion de version de plugins est simplifiée.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Bon, revenons à nos moutons. Nous avons donc Eclipse prêt à l'emploi et l'arborescence ci-dessus.Il est temps d'installer Yii.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;3. Yii Framework&lt;/span&gt;&lt;/div&gt;&lt;hr /&gt;&lt;div&gt;J'ai choisi de placer Yii dans le répertoire &lt;b&gt;c:\project\lib&lt;/b&gt;, mais vous faites comme vous voulez. Après avoir téléchargé la &lt;a href="http://www.yiiframework.com/download/"&gt;dernière version de Yii&lt;/a&gt; (à ce jour, il s'agit de la yii-1.1.3), décompressez-la dans le répertoire &lt;b&gt;c:\project\lib&lt;/b&gt;. Vous obtenez alors les répertoires suivants :&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; color: #0000ee; margin-left: 1em; margin-right: 1em;"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5508953363614306530" src="http://3.bp.blogspot.com/_6ORsAWkyfAo/THO75YJskOI/AAAAAAAAA0g/EoNA4xCQK5A/s320/2010-08-24_142918.png" style="display: block; height: 137px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: left; width: 205px;" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; color: #0000ee;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;C:\project\lib\php\yii-1.1.3.r2247&lt;/b&gt; : racine de l'installation &lt;/li&gt;&lt;li&gt;&lt;b&gt;C:\project\lib\php\yii-1.1.3.r2247\demos&lt;/b&gt; : sites de démonstration (blog, hangman - jeu du pendu-, helloworld, phonebook -demo SOAP -)&lt;/li&gt;&lt;li&gt;&lt;b&gt;C:\project\lib\php\yii-1.1.3.r2247\framework&lt;/b&gt; : classes composant le noyau (core) de Yii&lt;/li&gt;&lt;li&gt;&lt;b&gt;C:\project\lib\php\yii-1.1.3.r2247\requirements &lt;/b&gt;: vérifications des pré-requis &lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Lorsqu'une nouvelle version de Yii sera disponible, il suffira de la copier elle aussi dans le répertoire &lt;b&gt;c:\project\lib\php&lt;/b&gt;, ce qui nous permettra facilement de passer d'une version à l'autre.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;4. Apache&lt;/span&gt;&lt;/div&gt;&lt;hr /&gt;&lt;div&gt;L'installation d'Apache (&lt;a href="http://www.wampserver.com/"&gt;WampServer&lt;/a&gt;) et d'un environnement complet de tests est détaillée dans &lt;a href="http://raoul-2000.blogspot.com/2010/03/test-yii-creation-dun-environnement.html"&gt;cet article&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;Notre espace de travail se trouve dans &lt;b&gt;C:\project&lt;/b&gt;,  c'est là que nos projets Yii seront créés. C'est donc là que se trouveront nos fichiers PHP et par conséquent, notre serveur Web (&lt;b&gt;Apache&lt;/b&gt;) doit pouvoir servir des fichiers placés dans ce répertoire. Pour cela, il est pratique de&lt;b&gt; créer un alias&lt;/b&gt; qui va pointer vers le répertoire&lt;b&gt; c:\projects&lt;/b&gt;. WampServer permet cela très facilement directement depuis le menu utilisateur (&lt;b&gt;Apache &amp;gt; Alias Directories &amp;gt; + Add an alias &lt;/b&gt;). Notre alias va s'appeler '&lt;b&gt;project&lt;/b&gt;' et il pointera vers le répertoire &lt;b&gt;c:\project&lt;/b&gt;.&lt;/div&gt;&lt;div&gt;Une fois l'opération terminée (WampServer se relance automatiquement une fois l'Alias créé), allons faire un tour à l'adresse suivante :&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;b&gt;&lt;a href="http://localhost/project/lib/php/yii-1.1.3.r2247/requirements/"&gt;http://localhost/project/lib/php/yii-1.1.3.r2247/requirements/&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;La page qui s'affiche est générée par Yii. Elle résume l'état de l'installation en terme d'extensions PHP disponibles ainsi que de la version du language (PHP 5.1 ou supérieur). &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;5. Intégration Yii - Eclipse &lt;/span&gt;&lt;/div&gt;&lt;hr /&gt;&lt;div&gt;Avant de pouvoir créer notre premier projet Yii dans Eclipse et bénéficier d'un environnement de développement complet, il reste quelques petites configurations à faire.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Création d'un serveur PHP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Par défaut, Eclipse utilise l'adresse&lt;b&gt; http://localhost&lt;/b&gt; pour éxécuter les fichiers PHP que nous allons créer dans nos projets,  mais cela ne correspond pas à notre environnement. En effet, dans l'étape précédente, nous avons créé un alias qui pointe directement sur notre répertoire de projet. Eclipse devrait donc plutôt  utiliser l'adresse &lt;b&gt;http://localhost/project&lt;/b&gt;. Ajoutons donc un serveur PHP :&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;&lt;b&gt;Windows &amp;gt; Preferences  &amp;gt; PHP &amp;gt; PHP Servers + [New]&lt;/b&gt;&lt;/span&gt;&lt;b&gt; &lt;/b&gt;- on va l'appeler '&lt;b&gt;Project PHP Web Server&lt;/b&gt;' et lui donner l'URL  &lt;b&gt;http://localhost/project&lt;/b&gt;. Après l'avoir rajouté, nous le définirons comme serveur par défaut.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Client PHP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Nous allons maintenant indiquer à Eclipse où se trouve l'interpréteur PHP qu'il devra utiliser pour par exemple, la détection à la volée des erreurs de syntaxes. Nous utiliserons&amp;nbsp;PHP 5.2.11 que nous avions installé lors d'un &lt;a href="http://raoul-2000.blogspot.com/2010/03/test-yii-creation-dun-environnement.html"&gt;précédent article&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;Windows &amp;gt; Preferences &amp;gt; PHP &amp;gt; PHP Executables + [Add...] &lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Name : PHP 5.2.11&lt;/li&gt;&lt;li&gt;Executable Path : &lt;b&gt;C:\wamp\bin\php\php5.2.11\php.exe&lt;/b&gt;&lt;/li&gt;&lt;li&gt;PHP ini file (optional) : (laisser vide. On utilisera le php.ini par défaut)&lt;/li&gt;&lt;li&gt;SAPI Type : CLI&lt;/li&gt;&lt;li&gt;PHP Debugger : XDebug (cela seulement si XDebug a été installé - encore une fois, cette partie a été détaillée dans un &lt;a href="http://raoul-2000.blogspot.com/2010/03/test-yii-creation-dun-environnement.html"&gt;article précédent&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;[Finish]&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Librairies Yii&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Pour terminer, nous allons informer Eclipse que le framework Yii doit être accessible en tant que librairie utilisateur lors de la création d'un nouveau projet.&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;Windows &amp;gt; Preferences &amp;gt; PHP &amp;gt; PHP Libraries + [New...] &lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;User library name : Yii 1.1.3 &lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;[OK]&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;sélectionnez ensuite 'Yii 1.1.3' dans la liste 'defined user libraries' et cliquez sur&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt; [Add External Folder...]&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Séelctionnez ensuite le répertoire &lt;b&gt;C:\project\lib\php\yii-1.1.3.r2247\framework&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;[OK]&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;[&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;OK]&lt;/span&gt;&lt;/b&gt; (ferme la fenêtre de préférences&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Debug&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Pour être complet, notre environnement doit également permettre le débugage de nos applications PHP  (notre environnement de test est celui qui a été installé lors d'un&lt;a href="http://raoul-2000.blogspot.com/2010/03/test-yii-creation-dun-environnement.html"&gt; article précédent&lt;/a&gt;). La seule petite chose que nous devons modifier est l&lt;b&gt;e numéro de port utilisé par XDebug&lt;/b&gt;. Par défaut, XDebug s'installe sur le port 10000, mais Eclipse utilise le port 9000 ... si on ne fait rien, c'est pas demain que ces deux là vont pouvoir communiquer !&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;Windows &amp;gt; Preferences &amp;gt; PHP &amp;gt; Debug &amp;gt; Installed Debuggers&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Sélectionnez XDebug &lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;[Configure]&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Debug Port : 10000&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;[OK]&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Par sécurité vous pouvez également modifier le port de &lt;i&gt;Zend Debugger&lt;/i&gt; en le mettant à 10001 par exemple. En résumé, le port de &lt;b&gt;XDebug &lt;/b&gt;configuré ici doit être le même que celui configuré dans le fichier &lt;b&gt;C:\wamp\bin\apache\Apache2.2.11\bin\php.ini&lt;/b&gt; par le paramètre &lt;b&gt;xdebug.remote_port&lt;/b&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;5. HelloWorld&lt;/span&gt;&lt;/div&gt;&lt;hr /&gt;&lt;div&gt;Ca y est, c'est l'heure de créer notre premier projet Eclipse !! ... quel suspens ! Allé, c'est parti :&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;File &amp;gt; New ... &amp;gt; PHP Project&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Project Name : helloWorld&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;[Next &amp;gt; ]&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Sélectionnez l'onglet Libraries puis cliquez sur&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt; [Add Library ...]&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Sélectionnez 'User Library' puis cliquez sur&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt; [Next &amp;gt;]&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;.. et là, on retrouve la librairie que nous avions rajouté à Eclipse. Cochez donc Yii 1.1.3&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;[Finish]&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;[Finish] &lt;/span&gt;&lt;/b&gt;pour ferme l'assistant de création de projet&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Si ce n'est pas déjà fait, passez en perspective PHP pour voir apparaître votre projet &lt;b&gt;helloWorld&lt;/b&gt; dans le panneau '&lt;b&gt;PHP Explorer&lt;/b&gt;'.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Le projet helloWorld sélectionné, cliquez sur le bouton droit de la souris pour obtenir le menu contextuel, puis choisissez &lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;'New ... &amp;gt; PHP File'&lt;/span&gt;&lt;/b&gt;. Notre premier fichier s'appellera index.php (c'est original). &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_6ORsAWkyfAo/THUrCN98L6I/AAAAAAAAA04/mHk3obMdBlU/s1600/2010-08-25_163639.png"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5509357036266860450" src="http://4.bp.blogspot.com/_6ORsAWkyfAo/THUrCN98L6I/AAAAAAAAA04/mHk3obMdBlU/s320/2010-08-25_163639.png" style="cursor: pointer; display: block; height: 129px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Ok, c'est tout pourri comme programme, mais le but étant de tester un peu l'installation que l'on vient de terminer, ça fera l'affaire. Exécutons ce superbe bout de code:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Sélectionnez le fichier index.php + bouton droit de la souris&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;Run as &amp;gt; PHP Web Page&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Le navigateur Interne d'Eclipse apparaît et affiche le résultat de notre script. Tentons le débugage maintenant.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Sélectionnez le fichier index.php + bouton droit de la souris&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;Debug as &amp;gt; PHP Web Page&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;La Perspective dédié au debugage PHP apparaît (si vous l'autorisez) et le script est bloqué sur la première ligne du script : tout fonctionne correctement !! &lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;6. Conclusion&lt;/span&gt;&lt;/div&gt;&lt;hr /&gt;&lt;div&gt;Voilà, nous venons d'installer tout un environnement de développement pour PHP et Yii. Je vous laisse explorer par vous même les nombreuses fonctionnalités offertes par Eclipse (la saisie assistée vous permettra notamment d'accéder rapidement aux Méthode fournies par les classes Yii). Bien sûr cet environnement peut être amélioré par des plugins Eclipses, des raccourcis claviers, des modèles tout prêt, des outils extenres, etc ... mais cela est une autre histoire... et peut être un autre article.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4967948429934587118-4026633202871765664?l=raoul-2000.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://raoul-2000.blogspot.com/feeds/4026633202871765664/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://raoul-2000.blogspot.com/2010/08/eclipse-yii-mise-en-place-dun.html#comment-form' title='1 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4967948429934587118/posts/default/4026633202871765664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4967948429934587118/posts/default/4026633202871765664'/><link rel='alternate' type='text/html' href='http://raoul-2000.blogspot.com/2010/08/eclipse-yii-mise-en-place-dun.html' title='Eclipse + Yii : mise en place d&apos;un environnement de développement'/><author><name>Raoul</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_6ORsAWkyfAo/THO_bftGX8I/AAAAAAAAA0w/ugKGwXTehkE/s72-c/2010-08-24_144551.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4967948429934587118.post-8087787504655579321</id><published>2010-03-27T16:10:00.005+01:00</published><updated>2011-08-21T18:48:01.591+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='yii'/><category scheme='http://www.blogger.com/atom/ns#' term='test'/><title type='text'>Yii : création d'un environnement de test</title><content type='html'>&lt;a href="http://www.yiiframework.com/files/logo/yii.png"&gt;&lt;img alt="" border="0" src="http://www.yiiframework.com/files/logo/yii.png" style="cursor: hand; cursor: pointer; float: right; height: 86px; margin: 0 0 10px 10px; width: 400px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://bits.ohloh.net/attachments/2264/logo_pear_med.gif"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.xdebug.org/images/xdebug.gif"&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;Bon, on va essayer de mettre en place un petit environnement de test autour de la dernière version du framework Yii. Comme l'indique la documentation, des tests unitaires et fonctionnels peuvent s'intégrer facilement à Yii. Voyons voir si c'est vrai ! Est-il facile d'installer &lt;b&gt;PHPUnit &lt;/b&gt;et &lt;b&gt;Selenium &lt;/b&gt;sur &lt;b&gt;Wamp &lt;/b&gt;? A vrai dire j'ai déjà vu plus simple, et le temps passé à faire fonctionner les différents modules m'a incité à écrire ce post afin de me souvenir de la marche à suivre, et éventuellement d'éviter au lecteur les heures de galères que peut rencontrer un novice qui se lance dans l'aventure du test.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;1. Environnement&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;hr /&gt;&lt;div&gt;Avant de commencer, un petit aperçu de l'existant :&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.wampserver.com/"&gt;wampServer &lt;/a&gt;: pour le server HTTP ( WampServer 2.0i [11/07/09]) - il est installé dans le répertoire &lt;b&gt;c:\wamp&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.yiiframework.com/download/"&gt;Yii Framework 1.1.3&lt;/a&gt; : dernière version (Juillet 2010) du framework&lt;/li&gt;&lt;li&gt;windows XSP sp3&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Avant d'aller plus loin, j'ai mis à jour la version de php livrée avec WampServer 2.0i, la 5.3.0. En effet, mon hébergeur utilisant la version 5.2.13 je vais donc télécharger cette version et l'installer dans WampServer. Hélas, pas de 5.2.13 disponible chez WampServer ! Tant pis, je prendrais la &lt;a href="http://www.wampserver.com/addons_php.php"&gt;5.2.11&lt;/a&gt;. L'installation est automatique, il suffit d'exécuter le programme téléchargé.&lt;br /&gt;&lt;br /&gt;Ensuite, rajoutons dans la variable d'environnement PATH de Windows, le chemin vers php.exe.... Pour cela il est possible d'utiliser un éditeur de variable d'environnement comme &lt;a href="http://www.rapidee.com/en/download"&gt;Rapid Environment Editor&lt;/a&gt;, qui rendra la tâche plus agréable (mais il n'y a rien d'obligatoire).&lt;/div&gt;&lt;div&gt;Pour cet exemple on aura donc &lt;b&gt;PATH=C:\wamp\bin\php\php5.2.11&lt;/b&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Pour vérifier que tout est bien, ouvrez une ligne de commande (&lt;b&gt;cmd.ex&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;e&lt;/span&gt;&lt;/b&gt;) tapez &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;b&gt;&amp;gt; php -version &lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;C'est bon ? la version de PHP s'affiche ? Moi j'obtiens ceci :&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;PHP 5.2.11 (cli) (built: Sep 16 2009 19:39:46)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;Copyright (c) 1997-2009 The PHP Group&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;...ce qui correspond bien à mon environnement. Ok, passons aux choses sérieuses. L'objectif est d'installer et de configurer :&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.phpunit.de/"&gt;PHPunit &lt;/a&gt;: pour les tests unitaires&lt;/li&gt;&lt;li&gt;&lt;a href="http://seleniumhq.org/"&gt;Selenium &lt;/a&gt;: pour les tests fonctionnels&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Ce n'est pas au hasard que ces outils ont été choisis, mais bien parce qu'ils sont référencé dans la &lt;a href="http://www.yiiframework.com/doc/guide/fr/test.overview"&gt;documentation de Yii concernant les tests&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;2. Installer PEAR&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;hr /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; color: #0000ee; font-weight: normal;"&gt;&lt;img alt="" border="0" src="http://bits.ohloh.net/attachments/2264/logo_pear_med.gif" style="cursor: pointer; float: right; height: 64px; margin-bottom: 10px; margin-left: 10px; margin-right: 0px; margin-top: 0px; width: 64px;" /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Pour pouvoir installer &lt;b&gt;PHPUnit&lt;/b&gt;, il faut avant tout avoir installé PEAR.&lt;br /&gt;L'installation de PEAR se fait depuis la ligne de commande. Placez vous dans le répertoire PEAR (&lt;b&gt;C:\wamp\bin\php\php5.2.11\PEAR&lt;/b&gt;) puis entrez la commande suivante :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&amp;gt; php -d phar.require_hash=0 go-pear.phar&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;La programme d'installation de PEAR vous propose alors les répertoires par défaut dans lesquels seront copiés ses différents composants. Par défaut, tout ce qui va être installé, le sera dans le répertoire courant, et c'est bien comme ça.&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;Si vous souhaitez changer de répertoire, sachez que l'installateur de PEAR n'aime pas du tout les noms de dossier contenant des espaces.&lt;/span&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;/i&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;i&gt;&lt;b&gt;ATTENTION&lt;/b&gt; : si vous aviez déjà installé PEAR sur cette machine, mais dans un autre répertoire, vous devres prendre bien soin de supprimer les variables d'environnement PEAR, et de relancer la machine.&lt;/i&gt;&lt;/blockquote&gt;Lorsque les téléchargements sont terminés, j'autorise la modification automatique du &lt;b&gt;php.ini&lt;/b&gt; (modification du &lt;b&gt;include_path&lt;/b&gt;) : l'installation se termine. A la racine du répertoire d'installation, le fichier &lt;b&gt;PEAR_ENV.reg&lt;/b&gt; a été créé. Il contient des clefs de registres définissant les différents répertoires de PEAR. Double-cliquer sur ce fichier afin d'ajouter ces valeurs à la base de registre.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Dernier point : rajouter le nom du répertoire d'installation (&lt;b&gt;C:\wamp\bin\php\php5.2.11\PEAR&lt;/b&gt;) dans le PATH Windows. Le script &lt;b&gt;PEAR.bat&lt;/b&gt; est désormais accessible depuis n'importe où. Pour vérifier que tout est en ordre tapez :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;b&gt;&amp;gt; pear -help&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;...et normalement, l'aide en ligne de PEAR s'affiche.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;ouf, première étape terminée ! ... enfin presque. Pour être complétement sûr que la toute dernière version de PEAR est installée, on peut demander de mettre à jour PEAR. Cela peut être nécessaire si par la suite, lors de l'installation de PHPUnit, un message d'erreur vous informe que le PEAR Installer que vous utilisez, n'est pas la dernière version.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&amp;gt;  pear upgrade pear&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;Cette fois c'est bon, on peut passer à la suite.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;3. PHPUnit&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;hr /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; color: #0000ee;"&gt;&lt;img alt="" border="0" src="http://www.phpunit.de/manual/phpunit-logo.gif" style="cursor: pointer; float: right; height: 80px; margin-bottom: 10px; margin-left: 10px; margin-right: 0px; margin-top: 0px; width: 94px;" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;A partir d'une installation PEAR à jour, et d'un environnement correctement configuré (en particulier concernant les PATH), l'installation de PHPUnit est hyper simple. Depuis la ligne de commande, tapez :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&amp;gt; pear channel-discover pear.phpunit.de&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Adding Channel "pear.phpunit.de" succeeded&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Discovery of channel "pear.phpunit.de" succeeded&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;b&gt;&amp;gt; pear install phpunit/PHPUnit&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;Unknown remote channel: pear.symfony-project.com&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;Did not download optional dependencies: pear/Image_GraphViz,pear/Log, channel://pear.symfony-project.com/YAML, use --alldeps to download automatically&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;phpunit/PHPUnit can optionally use package "pear/Image_GraphViz" (version &amp;gt;= 1.2.1)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;phpunit/PHPUnit can optionally use package "pear/Log"&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;phpunit/PHPUnit can optionally use package "channel://pear.symfony-project.com/YAML" (version &amp;gt;= 1.0.2)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;phpunit/PHPUnit can optionally use PHP extension "soap"&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;phpunit/PHPUnit can optionally use PHP extension "xdebug" (version &amp;gt;= 2.0.5)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;downloading PHPUnit-3.4.15.tgz ...&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;Starting to download PHPUnit-3.4.15.tgz (255,036 bytes)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;.....................................................done: 255,036 bytes&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;install ok: channel://pear.phpunit.de/PHPUnit-3.4.15&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Là c'est bon. Vous devriez trouver un répertoire &lt;i&gt;PHPunit &lt;/i&gt;dans le répertoire &lt;b&gt;C:\wamp\bin\php\php5.2.11\PEAR\pear&lt;/b&gt;. Si vous tapez phpunit depuis la ligne de commande, l'aide de phpunit s'affiche! C'est pas super ?&lt;br /&gt;En cas d'erreur, lisez bien les messages qui&amp;nbsp;apparaissent&amp;nbsp;durant l'installation de PHPUnit. En particulier il se peut que certaines extension PHP indispensables (comme &lt;b&gt;curl&lt;/b&gt; par exemple) soient manquantes, ou plus précisément, ne soit pas activées. Dans ce cas, rendez-vous dans le fichier php.ini correspondant, pour activation. Relancez ensuite l'installation.&lt;br /&gt;Une autre cause possible d'erreur concerne la version de PHP qui doit correspondre à la version de PHPUnit que vous installez. Sur &lt;a href="http://pear.phpunit.de/"&gt;cette page&lt;/a&gt;, vous trouverez toutes les versions de php unit disponible. Pour installer la version PHPUnit 3.4.15 vous taperez :&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #b45f06; font-family: 'Courier New', Courier, monospace;"&gt;pear install --alldeps phpunit/PHPUnit-3.4.15&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;L'option -&lt;b&gt;alldeps &lt;/b&gt;permet d'installer également les dépendances...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;4. XDEBUG&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;hr /&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; color: #0000ee;"&gt;&lt;img alt="" border="0" src="http://www.xdebug.org/images/xdebug.gif" style="cursor: pointer; float: right; height: 64px; margin-bottom: 10px; margin-left: 10px; margin-right: 0px; margin-top: 0px; width: 95px;" /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;L'installation de cette extension PHP n'est pas obligatoire, mais elle est bien utile si vous voulez que PHPUnit soit capable de générer des rapports de couverture de code, lors de vos tests unitaires. Ces rapports de couverture de code (code coverage) existent en différent format, dont le HTML, et permet de voir facilement quelles sont les portions de code qui ont été testées, et celles qui ont été oubliées.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.xdebug.org/download.php"&gt;Téléchargez &lt;/a&gt;la DLL correspondant à votre version de PHP. Dans notre cas, avec PHP &lt;b&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;5.2&lt;/span&gt;&lt;/b&gt;.11 nous avons le choix entre plusieurs version. On va choisir &lt;b&gt;XDebug 2.1.0 - &lt;span class="Apple-style-span" style="color: red;"&gt;5.2&lt;/span&gt; VC6 (32 bit)&lt;/b&gt;. Pourquoi ? ... parce que ! Si vous utilisez PHP &lt;b&gt;5.3&lt;/b&gt;.x, vous choisirez un fichier dont le nom commence par &lt;b&gt;5.3&lt;/b&gt;. C'est astucieux, mais pas évident au début.&lt;/li&gt;&lt;li&gt;copiez la DLL dans le répertoire ext de PHP (avec les autres extensions)&lt;/li&gt;&lt;li&gt;modifier le fichier &lt;b&gt;php.ini&lt;/b&gt; présent dans &lt;b&gt;C:\wamp\bin\php\php5.2.11&lt;/b&gt; (et pas celui utilisé par apache)&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;A la fin du fichier &lt;b&gt;C:\wamp\bin\php\php5.2.11\php.ini&lt;/b&gt;, rajoutez  :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;&lt;b&gt;[XDebug]&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;&lt;b&gt;zend_extension_ts=C:/wamp/bin/php/php5.2.11/ext/php_xdebug-2.1.0-5.2-vc6.dll&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;&lt;b&gt;xdebug.remote_enable=true&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;&lt;b&gt;xdebug.remote_host=localhost&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;&lt;b&gt;xdebug.remote_port=10000&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;&lt;b&gt;xdebug.remote_handler=dbgp&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;&lt;b&gt;xdebug.profiler_enable=1&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;&lt;b&gt;xdebug.profiler_output_dir=C:/temp/xdebug&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;ATTENTION &lt;/b&gt;: si vous utilisez un version de PHP 5.3.x la syntaxe n'est pas la même.  Remplacez &lt;b&gt;zend_extension_ts &lt;/b&gt;par &lt;b&gt;zend_extension &lt;/b&gt;(plus de 'ts'). En cas de problème, allez jeter un oeil à la &lt;a href="http://www.xdebug.org/docs/install"&gt;documentation &lt;/a&gt;... si vous êtes anglophone !&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;XDebug sera disponible lors de l'appel à PHP depuis la ligne de commande, mais pas depuis Apache. Si vous voulez en profiter pour installer XDebug pour qu'il soit accessible depuis Apache, il suffit de rajouter les lignes ci-dessus dans le fichier &lt;b&gt;php.ini&lt;/b&gt; utilisé par Apache. Dans notre exemple il s'agit du fichier &lt;b&gt;C:\wamp\bin\apache\Apache2.2.11\bin\php.ini&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Pour vérifier que XDebug est bien installé dans le serveur Apache relancer-le et affichez un &lt;i&gt;phpinfo&lt;/i&gt;(). Vous devriez y trouver un section décrivant la configuration actuelle de XDebug.&lt;/div&gt;&lt;div&gt;Pour vérifier que XDebug est correctement installé dans PHP en ligne de commande ... ben je sais pas comment faire, là tout de suite. On verra après ok ?&lt;/div&gt;&lt;div&gt;..allez !! , c'est presque fini !&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;5. Selenium&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;hr /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; color: #551a8b;"&gt;&lt;img alt="" border="0" src="http://seleniumhq.org/images/header-logo.png" style="cursor: pointer; float: right; height: 58px; margin-bottom: 10px; margin-left: 10px; margin-right: 0px; margin-top: 0px; width: 237px;" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://seleniumhq.org/"&gt;Selenium &lt;/a&gt;permet de créer des tests fonctionnels. En gros, une fois correctement installé, la suite d'outils Selenium vous permettra :&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;d'enregistrer des actions sur vos pages web (cliquer ici, cliquer là, remplir en formulaire,etc ...)&lt;/li&gt;&lt;li&gt;de rejouer automatiquement ces actions afin de les valider sur différents navigateurs&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Rendez-vous à &lt;a href="http://seleniumhq.org/download/"&gt;la page de téléchargement&lt;/a&gt;, et récupérez &lt;b&gt;Selenium RC &lt;/b&gt;ainsi que &lt;b&gt;Selenium IDE&lt;/b&gt; , une extensions Firefox bien utile pour enregistrer des tests d'interface Web.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Installer Selenium RC&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Selenium RC est fourni sous la forme d'un fichier ZIP contenant tout plein de répertoires et de fichiers. Nous allons tout décompresser dans le répertoire &lt;b&gt;C:\selenium-remote-control-1.0.3&lt;/b&gt;. Comme nous sommes en présence d'une application Java, j'espère que vous avez mis à jour votre environnement Java, &lt;a href="http://www.java.com/fr/download/chrome.jsp?locale=fr&amp;amp;host=www.java.com"&gt;sinon c'est le momen&lt;/a&gt;t.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Pour vérifier que Java est disponible dans votre environnement, tapez la commande suivante :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;gt; java -version&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;java version "1.6.0_20"&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;Java(TM) SE Runtime Environment (build 1.6.0_20-b02)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="color: #ff6600;"&gt;Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Comme vous le voyez, chez moi c'est la version 1.6.0_20 qui est installé. Le minimum requis pour Selenium est la 1.5 .. donc je suis à l'aise sur le coup ! Pour lancer le serveur Selenium tapez :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;gt; java -jar C:\selenium-remote-control-1.0.3\selenium-server-1.0.3\selenium-server.jar&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Par la suite vous pourrez créer le petit fichier bat qui va bien ... Pour arrêter le serveur, c'est Ctrl+C.&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;A noter : il existe une distribution beaucoup plus conviviale de Selenium RC, c'est &lt;a href="http://saucelabs.com/ondemand"&gt;Sauce RC&lt;/a&gt;. J'ai essayé et c'est pas mal, beaucoup moins roots que l'original. SauceRC propose une belle interface depuis votre navigateur favori, pour lancer/stopper le serveur Selenium ... enfin, je vous laisse vous faire votre idée.&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Installer Selenium IDE&lt;/span&gt;&lt;/div&gt;&lt;div&gt;C'est trop simple : lancez Firefox et glissez le fichier &lt;b&gt;selenium-ide-1.0.7.xpi&lt;/b&gt; téléchargé, dans la fenêtre principale de Firefox. Ensuite, laissez vous guider. En 30 secondes le Selenium IDE est prêt (c'est juste une extension FF).&lt;/div&gt;&lt;div&gt;Ensuite, lancez l'IDE depuis le menu Outils de Firefox et enregistrez vos actions sur n'importe quelle page HTML de n'importe quel site. Vous pourrez rejouer vos actions, et les exporter dans différents format dont le plus intéressant pour nous est PHP.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;5. Conclusion&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;hr /&gt;&lt;div&gt;Tout est prêt ... ya plus qu'à !&lt;/div&gt;&lt;div&gt;La suite va consister à configurer Yii pour les &lt;a href="http://www.yiiframework.com/doc/guide/fr/test.unit"&gt;tests unitaires&lt;/a&gt; (PHPUnit) et &lt;a href="http://www.yiiframework.com/doc/guide/fr/test.functional"&gt;fonctionnels&lt;/a&gt; (Selenium) et bien sûr à les développer Alors en attendant un prochain article, vous pouvez dés à présent suivre la documentation Yii sur le sujet.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4967948429934587118-8087787504655579321?l=raoul-2000.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://raoul-2000.blogspot.com/feeds/8087787504655579321/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://raoul-2000.blogspot.com/2010/03/test-yii-creation-dun-environnement.html#comment-form' title='8 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4967948429934587118/posts/default/8087787504655579321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4967948429934587118/posts/default/8087787504655579321'/><link rel='alternate' type='text/html' href='http://raoul-2000.blogspot.com/2010/03/test-yii-creation-dun-environnement.html' title='Yii : création d&apos;un environnement de test'/><author><name>Raoul</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4967948429934587118.post-3857687569971012296</id><published>2009-10-04T11:28:00.000+02:00</published><updated>2009-10-04T11:41:44.965+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='yii'/><title type='text'>Yii Framework 1.1a</title><content type='html'>Au début du mois, la version 1.1a du framework Yii a été enfin dévoilée ! Certes, le petit '&lt;span style="font-weight:bold;"&gt;a&lt;/span&gt;' précise bien qu'il s'agit d'une &lt;span style="font-style:italic;"&gt;Alpha Release&lt;/span&gt;, et donc déconseillée dans une environnement de production, mais bon, ce n'est qu'une question de mois avant que la release officielle soit disponible (elle est prévue pour le début de l'année).&lt;br /&gt;Cette version n'est pas rétro compatible avec les versions 1.0.9, et certaines parties ont été ré écrites. Les principales modifications concernent les points suivants :&lt;br /&gt;&lt;ul&gt;&lt;li&gt;gestion des scénarios dans les modèles (CModel)&lt;/li&gt;&lt;li&gt;traitement des relations dans l'objet ActiveRecord&lt;/li&gt;&lt;li&gt;gestion des alias de table en cas d'ambigüité (AR)&lt;/li&gt;&lt;li&gt;collecte des formulaires &lt;/li&gt;&lt;/ul&gt;&lt;div&gt;(&lt;a href="http://www.yiiframework.com/doc/guide/upgrade"&gt;mise à jour 1.0.x vers 1.1a&lt;/a&gt;)&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;Et les français ?&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Il faut bien le reconnaître, la communauté française est encore bien faiblement représentée (ou alors elle reste timide) ne s'exprimant que très peu sur le forum. &lt;a href="http://www.yiiframework.com/forum/index.php?/forum/18-french/"&gt;Un sujet 'French' sur le forum&lt;/a&gt;  nous est consacré, mais vu le nombre de messages postés, on est loin du compte. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Allez hop ! tous sur Yii !!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(&lt;a href="http://www.yiiframework.com/download/"&gt;télécharger la dernière version&lt;/a&gt;)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4967948429934587118-3857687569971012296?l=raoul-2000.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://raoul-2000.blogspot.com/feeds/3857687569971012296/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://raoul-2000.blogspot.com/2009/10/yii-framework-11a.html#comment-form' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4967948429934587118/posts/default/3857687569971012296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4967948429934587118/posts/default/3857687569971012296'/><link rel='alternate' type='text/html' href='http://raoul-2000.blogspot.com/2009/10/yii-framework-11a.html' title='Yii Framework 1.1a'/><author><name>Raoul</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4967948429934587118.post-2292060725078060323</id><published>2009-04-04T19:10:00.001+02:00</published><updated>2010-11-16T23:29:58.203+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='yii'/><category scheme='http://www.blogger.com/atom/ns#' term='extension'/><category scheme='http://www.blogger.com/atom/ns#' term='form'/><category scheme='http://www.blogger.com/atom/ns#' term='validation'/><title type='text'>validation de formulaire : jformvalidate</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.yiiframework.com/files/logo/yii.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 400px; height: 86px;" src="http://www.yiiframework.com/files/logo/yii.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5320902352817001074" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;JFormValidate &lt;/span&gt;est une extension Yii qui permet facilement de valider les formulaires sur le navigateur internet, avant de les soumettre au serveur. L'avantage d'un tel mécanisme est bien évidemment un gain de temps conséquent puisque les données envoyées au serveur web, sont déjà censées être correctement renseignées par l'utilisateur. Toutefois,&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt; la validation côté serveur reste indispensable&lt;/span&gt; puisqu'il est facile (avec un peu de persévérance) de passer outre la validation côté client.&lt;div&gt;Cette extension est basée sur le plugin JQuery Validate, offrant toutes les fonctionnalités nécessaires à la validation Javascript sur le navigateur.&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Téléchargement &lt;/span&gt;: rendez-vous sur la page &lt;a href="http://www.yiiframework.com/extension/jformvalidate/"&gt;Yii dédiée aux extension (en)&lt;/a&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;La procédure d'installation est détaillée dans le fichier &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;readme.html&lt;/span&gt;, livré avec l'extension. Sa mise en oeuvre est très simple puisqu'elle n'impose que peu de modification des formulaires existantes. La force de cette extension est qu'elle utilise les régles de validation définies au niveau du modèle (&lt;span class="Apple-style-span" style="font-style: italic;"&gt;CModel&lt;/span&gt;), pour en déduire les régles à appliquer côté client. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;1. Déclaration&lt;/span&gt;&lt;br /&gt;&lt;pre class="brush: php;"&gt;&amp;lt;?php&lt;br /&gt;// déclaration de l'extension (optionnel si l'extension est&lt;br /&gt;// déclarée  et chargée (autoload) dans la fichier de&lt;br /&gt;//configuration de l'application&lt;br /&gt;$CS=Yii::app()-&amp;gt;jformvalidate;&lt;br /&gt;&lt;br /&gt;// l'appel à Chtml::form() est remplacé par :&lt;br /&gt;echo $CS-&amp;gt;form();&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;2.Mise en place&lt;/span&gt;&lt;br /&gt;&lt;pre class="brush: php;"&gt;&amp;lt;div class="simple"&amp;gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;echo CHtml::activeLabel($model,'username');&lt;br /&gt;?&amp;gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;// remplace l'appel Chtml::activeTextField par&lt;br /&gt;// $CS-&amp;gt; activeTextField ... et c'est tout&lt;br /&gt;echo $CS-&amp;gt;activeTextField($model,'username')&lt;br /&gt;?&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;a href="http://s172418307.onlinehome.fr/project/yiiSample/index.php?r=jsvform/TestForm"&gt;Voir site d'exemple&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4967948429934587118-2292060725078060323?l=raoul-2000.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4967948429934587118/posts/default/2292060725078060323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4967948429934587118/posts/default/2292060725078060323'/><link rel='alternate' type='text/html' href='http://raoul-2000.blogspot.com/2009/04/validation-de-formulaire-jformvalidate.html' title='validation de formulaire : jformvalidate'/><author><name>Raoul</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-4967948429934587118.post-1539305072466464868</id><published>2009-03-21T18:17:00.000+01:00</published><updated>2009-03-21T18:52:39.766+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='yii'/><title type='text'>Yii Framework</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_6ORsAWkyfAo/ScUikaxdWLI/AAAAAAAAAZQ/x28cxKXmHIg/s1600-h/Yii-banner.gif"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 41px;" src="http://2.bp.blogspot.com/_6ORsAWkyfAo/ScUikaxdWLI/AAAAAAAAAZQ/x28cxKXmHIg/s320/Yii-banner.gif" border="0" alt="" id="BLOGGER_PHOTO_ID_5315692944238139570" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Yii &lt;/span&gt;est un nouveau framework pour PHP, dont la version 1.0 a été publiée le 10 Novembre 2008 .. il est donc encore tout frais, tout neuf, mais regroupe déjà une communauté internationale active. Son fondateur, &lt;span class="Apple-style-span" style="font-style: italic;"&gt;Quiang Xue&lt;/span&gt; n'est pas un nouveau venu puisqu'il est également à l'origine d'un célèbre framework : &lt;a href="http://www.pradosoft.com/"&gt;PRADO&lt;/a&gt;. Avec une régularité de métronome, chaque mois, une nouvelle version est publiée (actuellement c'est la version 1.0.3 qui est disponible), de nombreuses extensions, des modules, des widgets sont aussi proposés, et leur nombre ne cesse de croître grâce à de nombreux contributeurs.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Le principe de &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Yii &lt;/span&gt;reste classique : un modèle, une vue, un contrôleur ... mais ce nouveau framework se démarque par de nombreuses nouveautés à commencer par son architecture résolument objet (PHP5 est obligatoire pour le faire fonctionner) orientée Web2.0 (&lt;a href="http://jquery.com/"&gt;JQuery&lt;/a&gt; intégré par défaut).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Yii &lt;/span&gt;est-il donc sur le chemin du succès ? marche-t-il dans les pas de son prédécesseur PRADO ? C'est à souhaiter car ses débuts sont prometteurs ... il ne lui manque plus qu'une communauté francophone pour que sa réussite soit complète.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Quelques ressources pour commencer avec &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Yii &lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.yiiframework.com/doc/guide/fr/index"&gt;site officiel&lt;/a&gt; (en)&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.yiiframework.com/demos/blog/"&gt;blog de démo&lt;/a&gt; (en) : inclus dans les release, c'est une source interressante de&lt;span class="Apple-style-span" style="font-style: italic;"&gt; best-practise&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.yiiframework.com/doc/guide/fr/index"&gt;Documentation&lt;/a&gt; (fr) : très complète, elle permettra de guider le débutant&lt;/li&gt;&lt;li&gt;&lt;a href="http://php-thoughts.cubedwater.com/"&gt;Jona's thought&lt;/a&gt; (en) : blog d'un contributeur actif (exemples, articles)&lt;/li&gt;&lt;li&gt;&lt;a href="http://programmersnotes.info/"&gt;Konstantin Mirin&lt;/a&gt; (en) : un autre utilisateur actif&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://blog.orite.com.au/tag/zend-framework/"&gt;comparaison des performances&lt;/a&gt;  (en) : yii, zend,Kohana, purePhp, oModel&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4967948429934587118-1539305072466464868?l=raoul-2000.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://raoul-2000.blogspot.com/feeds/1539305072466464868/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://raoul-2000.blogspot.com/2009/03/yii-framework.html#comment-form' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4967948429934587118/posts/default/1539305072466464868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4967948429934587118/posts/default/1539305072466464868'/><link rel='alternate' type='text/html' href='http://raoul-2000.blogspot.com/2009/03/yii-framework.html' title='Yii Framework'/><author><name>Raoul</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_6ORsAWkyfAo/ScUikaxdWLI/AAAAAAAAAZQ/x28cxKXmHIg/s72-c/Yii-banner.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4967948429934587118.post-8534671381568380408</id><published>2009-03-18T17:56:00.000+01:00</published><updated>2009-03-21T18:10:37.331+01:00</updated><title type='text'>Affichage de code source</title><content type='html'>L'affichage de code source sur un blog hébergé par blogger.com est possible avec un peu de patience et d'application, cependant il est obligatoire de disposer d'un hébergement afin d'y stocker les fichiers externes indispendables.&lt;br /&gt;Si plusieurs méthodes existent, c'est &lt;a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter"&gt;SyntaxHighlighter &lt;/a&gt;(actuellement en version 2.0) qui semble le plus abouti. Rendez-vous sur le &lt;a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter:Usage"&gt;guide d'utilisation&lt;/a&gt;(en anglais) pour la marche à suivre.&lt;br /&gt;&lt;br /&gt;...et voici le résultat final !!&lt;br /&gt;&lt;br /&gt;Quelques lignes de Javascript:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js"&gt;&lt;br /&gt;function()&lt;br /&gt;{  &lt;br /&gt;    alert("Hello world");&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Quelques lignes de PHP :&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: php; collapse: true"&gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Login&amp;lt;/h1&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;div class="yiiForm"&amp;gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;    echo CHtml::form();&lt;br /&gt;    // commentaire&lt;br /&gt;    if(isset($a)) {&lt;br /&gt;       $b = array($a);&lt;br /&gt;       var_dump($b);&lt;br /&gt;    }&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?php echo CHtml::errorSummary($user); ?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;div class="simple"&amp;gt;&lt;br /&gt;&amp;lt;?php echo CHtml::activeLabel($user,'username'); ?&amp;gt;&lt;br /&gt;&amp;lt;?php echo CHtml::activeTextField($user,'username') ?&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Quelques lignes de XML:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;doc&amp;gt;&lt;br /&gt; &amp;lt;item attr="value"&amp;gt;&lt;br /&gt;  &amp;lt;li&amp;gt;item1&amp;lt;/li&amp;gt;&lt;br /&gt;  &amp;lt;li&amp;gt;item2&amp;lt;/li&amp;gt;&lt;br /&gt;  &amp;lt;li&amp;gt;item3&amp;lt;/li&amp;gt;&lt;br /&gt; &amp;lt;/item&amp;gt;&lt;br /&gt; &amp;lt;config context="sample" id="11254"/&amp;gt;&lt;br /&gt;&amp;lt;/doc&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4967948429934587118-8534671381568380408?l=raoul-2000.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://raoul-2000.blogspot.com/feeds/8534671381568380408/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://raoul-2000.blogspot.com/2009/03/quelques-lignes-de-xml.html#comment-form' title='1 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4967948429934587118/posts/default/8534671381568380408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4967948429934587118/posts/default/8534671381568380408'/><link rel='alternate' type='text/html' href='http://raoul-2000.blogspot.com/2009/03/quelques-lignes-de-xml.html' title='Affichage de code source'/><author><name>Raoul</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4967948429934587118.post-4632036434522198257</id><published>2009-03-14T18:52:00.000+01:00</published><updated>2009-03-14T19:05:59.910+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='outils'/><title type='text'>Boîte à outils</title><content type='html'>Pour ce premier post, voici une sélection de quelques outils bien pratiques et/ou indispensables :&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://dev.mysql.com/downloads/gui-tools/5.0.html"&gt;MySQL GUI Tools&lt;/a&gt; : suite d'applications pour le développement, la maintenance, les tests sur MySQL. Le MySQL Workbench en particulier permet un design complet de base de données&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.wampserver.com/"&gt;WampServer &lt;/a&gt;: PHP+Apache+MySQL&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.eclipse.org/"&gt;Eclipse &lt;/a&gt;: l'éditeur de référence. Avec le plugin &lt;a href="http://www.aptana.com/studio/download"&gt;Aptana&lt;/a&gt;, c'est la plateforme idéale !&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.colorschemer.com/colorpix_info.php"&gt;colorPix &lt;/a&gt;: palette permettant de récupérer les couleurs affichées à l'écran&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.lipsum.com/"&gt;lorem Ipsum&lt;/a&gt; : generation rapide de faux texte&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Bon, c'est pas beaucoup, mais l'essentiel est là.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4967948429934587118-4632036434522198257?l=raoul-2000.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4967948429934587118/posts/default/4632036434522198257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4967948429934587118/posts/default/4632036434522198257'/><link rel='alternate' type='text/html' href='http://raoul-2000.blogspot.com/2009/03/premier-post.html' title='Boîte à outils'/><author><name>Raoul</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>
