<?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>iTx Technologies</title>
	<atom:link href="http://itx-technologies.com/feed" rel="self" type="application/rss+xml" />
	<link>http://itx-technologies.com</link>
	<description>Programmation et intégration Web à Montréal</description>
	<lastBuildDate>Thu, 17 May 2012 15:19:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Externalisation du développement web: un levier de croissance économique</title>
		<link>http://itx-technologies.com/blog/3399-externalisation-du-developpement-web-un-outil-de-croissance-economique</link>
		<comments>http://itx-technologies.com/blog/3399-externalisation-du-developpement-web-un-outil-de-croissance-economique#comments</comments>
		<pubDate>Thu, 17 May 2012 13:09:37 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Opinions]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[crise économique]]></category>
		<category><![CDATA[développement Web]]></category>
		<category><![CDATA[externalisation]]></category>
		<category><![CDATA[impartition]]></category>

		<guid isPermaLink="false">http://itx-technologies.com/?p=3399</guid>
		<description><![CDATA[Dans les temps de ralentissement économique, les entreprises ont tendance à se recroqueviller sur elles-mêmes et inculquer un protectionnisme à tous leurs services internes. Toutefois, les PME du Québec et du monde entier doivent se recentrer sur leur plan d&#8217;affaires afin de continuer à rester compétitives. L&#8217;agence marketing et son développement Web L&#8217;externalisation, ou si [...]]]></description>
			<content:encoded><![CDATA[<p>Dans les temps de ralentissement économique, les entreprises ont tendance à se recroqueviller sur elles-mêmes et inculquer un protectionnisme à tous leurs services internes. Toutefois, les PME du Québec et du monde entier doivent se recentrer sur leur plan d&#8217;affaires afin de continuer à rester compétitives.</p>
<p><strong>L&#8217;agence marketing et son développement Web</strong><br />
L&#8217;externalisation, ou si l&#8217;on préfère l&#8217;impartition, de certains services d&#8217;une agence marketing peut s&#8217;avérer être un choix judicieux pour nombre d&#8217;entre elles désireuses de se recentrer sur leur modèle d&#8217;affaires. De plus, une agence amincie de ses services superflus devient plus agile et apte à répondre à la demande en dents de scie.</p>
<p>Il devient donc évident de se demander si votre agence marketing a le budget pour investir dans une équipe interne d&#8217;experts dans différentes technologies Web afin de répondre à l&#8217;éventail des demandes de ses clients.</p>
<p>Finalement, une fragilité économique nécessite de passer plus de temps dans le développement des affaires et moins de temps à gérer ses ressources à l&#8217;interne. Avez-vous déjà dû refuser un contrat par faute de temps ou de connaissances techniques ? Votre équipe de développeurs ne devrait pas être un frein à l&#8217;obtention de nouveaux mandats Web. L&#8217;externalisation de votre développement Web vous donnerait ainsi toute la liberté de répondre aux fruits de votre développement d&#8217;affaires.</p>
]]></content:encoded>
			<wfw:commentRss>http://itx-technologies.com/blog/3399-externalisation-du-developpement-web-un-outil-de-croissance-economique/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sugar CRM : faire un appel SOAP</title>
		<link>http://itx-technologies.com/blog/3360-sugar-crm-faire-un-appel-soap-php-avance</link>
		<comments>http://itx-technologies.com/blog/3360-sugar-crm-faire-un-appel-soap-php-avance#comments</comments>
		<pubDate>Tue, 24 Apr 2012 20:02:58 +0000</pubDate>
		<dc:creator>Jean-Vivien</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SugarCRM]]></category>
		<category><![CDATA[php orienté objet]]></category>
		<category><![CDATA[soap]]></category>

		<guid isPermaLink="false">http://itx-technologies.com/?p=3360</guid>
		<description><![CDATA[Lors de vos échanges entre applications il est utile de charger l&#8217;environnement de Sugar CRM pour utiliser son API et gagner du temps de développement. Voici quelques étapes pour créer une instance de Sugar CRM depuis n&#8217;importe quel script php et vérifier l&#8217;existence d&#8217;un contact dans la base de données par exemple. Pré-requis : Avoir [...]]]></description>
			<content:encoded><![CDATA[<p>Lors de vos échanges entre applications il est utile de charger l&#8217;environnement de Sugar CRM pour utiliser son API et gagner du temps de développement.<br />
Voici quelques étapes pour créer une instance de Sugar CRM depuis n&#8217;importe quel script php et vérifier l&#8217;existence d&#8217;un contact dans la base de données par exemple.</p>
<h3>Pré-requis :</h3>
<ul>
<li>Avoir une application Sugar CRM déployée et paramétrée sur le serveur</li>
<li>Connaître les notions de base de la programmation PHP orientée objet</li>
</ul>
<h3>Etape 1 : Créer une instance PHP de Sugar CRM</h3>
<p>La première étape est de rendre disponible les fonctionnalités de Sugar. Nous allons stocker les objets Sugar de base (Client, Proxy, Session) dans des variables php.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'./Sugar/include/nusoap/nusoap.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//librairie SOAP de sugar crm</span>
<span style="color: #000088;">$soapclient</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> nusoapclient<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://www.monserveur.com/Sugar/soap.php?wsdl'</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//création d'une instance Sugar</span>
<span style="color: #000088;">$soapproxy</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$soapclient</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getProxy</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$soapsession</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$soapclient</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">call</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'login'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'user_auth'</span><span style="color: #339933;">=&gt;</span>array<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'user_name'</span><span style="color: #339933;">=</span> <span style="color: #0000ff;">'monidentifiant'</span><span style="color: #339933;">,</span>
   <span style="color: #0000ff;">'password'</span><span style="color: #339933;">=&gt;</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'monmotdepasse'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'version'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'.01'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'application_name'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'SoapSugar'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$soapsessionid</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$soapsession</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Dans ce script j&#8217;attire surtout votre attention sur deux points :</p>
<ul>
<li>l&#8217;instance &#8216;soapclient&#8217; utilise l&#8217;url du site plutôt que le chemin d&#8217;accès au script sur le serveur</li>
<li>le mot de passe indiqué pour créer la session Sugar CRM doit être converti en <strong>MD5</strong></li>
</ul>
<h3>Etape 2 : Vérifier l&#8217;existence d&#8217;un contact Sugar CRM à partir de son adresse email</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$email</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'sos@itx-technologies.com'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Contacts.id in (SELECT eabr.bean_id FROM email_addr_bean_rel eabr JOIN email_addresses ea ON
   (ea.id = eabr.email_address_id) WHERE eabr.deleted=0 and ea.email_address = &quot;'</span><span style="color: #339933;">.</span> <span style="color: #000088;">$email</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;)'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$orderby</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Contacts.id DESC'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$soapproxy</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_entry_list</span><span style="color: #009900;">&#40;</span>
<span style="color: #000088;">$soapsessionid</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Contacts'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$query</span><span style="color: #339933;">,</span> <span style="color: #000088;">$orderby</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">//offset</span>
   <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">//champs retournés dans la réponse</span>
   <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">//nombre maximum de résultat retournés</span>
   <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #666666; font-style: italic;">//deleted</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$account_id</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'entry_list'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Dans cette deuxième étape, nous utilisons directement une des fonctions de l&#8217;API Sugar, <strong>get_entry_list</strong>. Vous remarquerez que nous lui passons en paramètre l&#8217;identifiant de la session en cours pour confirmer que nous sommes autorisés à utiliser l&#8217;application Sugar ainsi qu&#8217;une partie de la requête SQL qui permet de faire la jointure entre le module Contacts et les adresses mail stockées dans la table &laquo;&nbsp;<em>email_adresses</em>&laquo;&nbsp;.</p>
<p>Finalement, la variable <strong>$account_id</strong> a une valeur à NULL ou bien une clé id si au moins un contact a été trouvé.</p>
<p>Ce premier exemple de SOAP vous permettra de confirmer que tout fonctionne correctement et que votre environnement Sugar CRM est bien rappatrié dans l&#8217;objet. Vous pourrez alors construire une classe dédiée au SOAP avec une initialisation des objets Client, Proxy et Session dans le constructeur et des fonctions dédiées de manipulation des données de Sugar. Faites nous part de vos essais !</p>
]]></content:encoded>
			<wfw:commentRss>http://itx-technologies.com/blog/3360-sugar-crm-faire-un-appel-soap-php-avance/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Créer une pagination sous WordPress</title>
		<link>http://itx-technologies.com/blog/3345-creer-une-pagination-sous-wordpress</link>
		<comments>http://itx-technologies.com/blog/3345-creer-une-pagination-sous-wordpress#comments</comments>
		<pubDate>Fri, 17 Feb 2012 13:51:41 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[thème]]></category>
		<category><![CDATA[trucs et astuces]]></category>

		<guid isPermaLink="false">http://itx-technologies.com/?p=3345</guid>
		<description><![CDATA[Rien de plus simple que ça ! Toutefois, il existe encore plusieurs plugins qui font la même chose même si WordPress possède une fonction juste pour ça : &#60;?php // Tiré de codex.wordpress.org global $wp_query; &#160; $big = 999999999; // need an unlikely integer &#160; echo paginate_links&#40; array&#40; 'base' =&#62; str_replace&#40; $big, '%#%', get_pagenum_link&#40; $big [...]]]></description>
			<content:encoded><![CDATA[<p>Rien de plus simple que ça ! Toutefois, il existe encore plusieurs plugins qui font la même chose même si WordPress possède une fonction juste pour ça :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// Tiré de codex.wordpress.org</span>
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$big</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">999999999</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// need an unlikely integer</span>
&nbsp;
<span style="color: #b1b100;">echo</span> paginate_links<span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'base'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$big</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'%#%'</span><span style="color: #339933;">,</span> get_pagenum_link<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$big</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'format'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'?paged=%#%'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'current'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">max</span><span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> get_query_var<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'paged'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'total'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">max_num_pages</span>
<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Copiez ce code dans le fichier index.php, archives.php, search.php ou peu importe là où vous voulez avoir une pagination !</p>
]]></content:encoded>
			<wfw:commentRss>http://itx-technologies.com/blog/3345-creer-une-pagination-sous-wordpress/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Désactiver les rétroliens vers son propre site WordPress</title>
		<link>http://itx-technologies.com/blog/3282-desactiver-les-retroliens-vers-son-propre-site-wordpress</link>
		<comments>http://itx-technologies.com/blog/3282-desactiver-les-retroliens-vers-son-propre-site-wordpress#comments</comments>
		<pubDate>Fri, 10 Feb 2012 19:38:12 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[didacticiel]]></category>
		<category><![CDATA[functions.php]]></category>
		<category><![CDATA[rétroliens]]></category>

		<guid isPermaLink="false">http://itx-technologies.com/?p=3282</guid>
		<description><![CDATA[Un rétrolien, c&#8217;est une façon d&#8217;envoyer un ping à un autre blogue pour lui faire signe que vous parlez du même sujet ou que vous l&#8217;avez cité dans votre article. Le ping se fait automatiquement sous WordPress : vous n&#8217;avez qu&#8217;à faire un lien vers un autre site, et celui-ci recevra un ping sous forme [...]]]></description>
			<content:encoded><![CDATA[<p>Un rétrolien, c&#8217;est une façon d&#8217;envoyer un <em>ping</em> à un autre blogue pour lui faire signe que vous parlez du même sujet ou que vous l&#8217;avez cité dans votre article.  Le ping se fait automatiquement sous WordPress : vous n&#8217;avez qu&#8217;à faire un lien vers un autre site, et celui-ci recevra un <em>ping</em> sous forme de commentaire automatisé.</p>
<p>Mais à quoi bon s&#8217;<em>auto-pinger</em> ?  Lorsque vous faites un lien vers un article de votre propre blogue, WordPress ne fait pas la distinction entre votre site ou un autre, alors il créera un commentaire sous l&#8217;article vers lequel vous avez fait un lien, comme si c&#8217;était un autre site qui venait de vous envoyer un rétrolien.</p>
<h3>Comment désactiver les <em>auto-rétroliens</em></h3>
<p>Il suffit d&#8217;écrire une fonction dans votre fichier functions.php et de <em>hooker</em> cette fonction à l&#8217;action <em>pre_ping</em> qui est exécutée juste avant que WordPress ne génère les pings.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Désactiver les rétroliens vers son propre site</span>
<span style="color: #000000; font-weight: bold;">function</span> mes_retroliens<span style="color: #009900;">&#40;</span> <span style="color: #339933;">&amp;</span><span style="color: #000088;">$liens</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$home</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'home'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$liens</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$l</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$lien</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">===</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$lien</span><span style="color: #339933;">,</span> <span style="color: #000088;">$home</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
            <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$liens</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$l</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'pre_ping'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mes_retroliens'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>La fonction, <a href="http://wordpress.org/support/topic/feature-removal-request-self-pingbacks">écrite par un membre des forums de WordPress</a>, va <em>parser</em> le ou les liens de votre articles, et si elle découvre qu&#8217;un de ces liens possède l&#8217;URL de votre site, elle ne la comptera pas dans les rétroliens à faire.</p>
]]></content:encoded>
			<wfw:commentRss>http://itx-technologies.com/blog/3282-desactiver-les-retroliens-vers-son-propre-site-wordpress/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Afficher seulement les noms des fichiers avec la commande grep</title>
		<link>http://itx-technologies.com/blog/3276-afficher-seulement-les-noms-des-fichiers-avec-la-commande-grep</link>
		<comments>http://itx-technologies.com/blog/3276-afficher-seulement-les-noms-des-fichiers-avec-la-commande-grep#comments</comments>
		<pubDate>Thu, 09 Feb 2012 19:15:53 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[commande]]></category>
		<category><![CDATA[grep]]></category>

		<guid isPermaLink="false">http://itx-technologies.com/?p=3276</guid>
		<description><![CDATA[Je vous ai souvent parlé de la commande grep, cette commande qui m&#8217;a sauvé la vie Ô combien de fois ! Pour les non-initiés, la commande grep, exécutée dans un terminal Linux, sert à rechercher une expression donnée à l&#8217;intérieur d&#8217;un ou de plusieurs fichiers. Exemple Cela dit, lorsque vous exécutez une commande, par exemple [...]]]></description>
			<content:encoded><![CDATA[<p>Je vous ai <a href="http://itx-technologies.com/blog/1521-5-exemples-avec-la-commande-grep-sur-linux" title="5 exemples avec la commande grep sur Linux">souvent parlé</a> de la <a href="http://itx-technologies.com/man-linux/grep-egrep-fgrep-afficher-les-lignes-correspondant-a-un-motif-donne" title="grep, egrep, fgrep – Afficher les lignes correspondant à un motif donné">commande grep</a>, cette  commande qui m&#8217;a sauvé la vie Ô combien de fois !</p>
<p>Pour les non-initiés, la commande grep, exécutée dans un terminal Linux, sert à rechercher une expression donnée à l&#8217;intérieur d&#8217;un ou de plusieurs fichiers.</p>
<h3>Exemple</h3>
<p>Cela dit, lorsque vous exécutez une commande, par exemple :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-R</span> include wp-content<span style="color: #000000; font-weight: bold;">/*</span></pre></div></div>

<p>le résultat de la commande, qui cherche l&#8217;expression &laquo;&nbsp;include&nbsp;&raquo; dans tous les fichiers du dossier, et sous-dossiers, de <em>wp-content</em>, donnera quelque chose du genre :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-R</span> include wp-content<span style="color: #000000; font-weight: bold;">/*</span>
plugins<span style="color: #000000; font-weight: bold;">/</span>akismet:    <span style="color: #007800;">odeValue</span>=trimAndGetNodeText<span style="color: #7a0874; font-weight: bold;">&#40;</span>table.config,node<span style="color: #7a0874; font-weight: bold;">&#41;</span>;<span style="color: #000000; font-weight: bold;">if</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>table.config.debug<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>log<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'Checking if value was empty on row:'</span>+rowIndex<span style="color: #7a0874; font-weight: bold;">&#41;</span>;<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">else</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #007800;">keepLooking</span>=<span style="color: #c20cb9; font-weight: bold;">false</span>;<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">for</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>var <span style="color: #007800;">i</span>=<span style="color: #000000;">1</span>;i<span style="color: #000000; font-weight: bold;">&lt;</span>l;i++<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000; font-weight: bold;">if</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>parsers<span style="color: #7a0874; font-weight: bold;">&#91;</span>i<span style="color: #7a0874; font-weight: bold;">&#93;</span>.is<span style="color: #7a0874; font-weight: bold;">&#40;</span>nodeValue,table,node<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">return</span> parsers<span style="color: #7a0874; font-weight: bold;">&#91;</span>i<span style="color: #7a0874; font-weight: bold;">&#93;</span>;<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">return</span> include<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>;<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">function</span> getNodeFromRowAndCellIndex<span style="color: #7a0874; font-weight: bold;">&#40;</span>rows,rowIndex,cellIndex<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">return</span> rows<span style="color: #7a0874; font-weight: bold;">&#91;</span>rowIndex<span style="color: #7a0874; font-weight: bold;">&#93;</span>.cells<span style="color: #7a0874; font-weight: bold;">&#91;</span>cellIndex<span style="color: #7a0874; font-weight: bold;">&#93;</span>;<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">function</span> trimAndGetNodeText<span style="color: #7a0874; font-weight: bold;">&#40;</span>config,node<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">return</span> $.trim<span style="color: #7a0874; font-weight: bold;">&#40;</span>getElementText<span style="color: #7a0874; font-weight: bold;">&#40;</span>config,node<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">function</span> getParserById<span style="color: #7a0874; font-weight: bold;">&#40;</span>name<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>var <span style="color: #007800;">l</span>=parsers.length;<span style="color: #000000; font-weight: bold;">for</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>var <span style="color: #007800;">i</span>=<span style="color: #000000;">0</span>;i<span style="color: #000000; font-weight: bold;">&lt;</span>l;i++<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000; font-weight: bold;">if</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>parsers<span style="color: #7a0874; font-weight: bold;">&#91;</span>i<span style="color: #7a0874; font-weight: bold;">&#93;</span>.id.toLowerCase<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>==name.toLowe
themes<span style="color: #000000; font-weight: bold;">/</span>twentyten:   :<span style="color: #000000; font-weight: bold;">function</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>var <span style="color: #007800;">parsers</span>=<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,<span style="color: #007800;">widgets</span>=<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>;this.include=<span style="color: #7a0874; font-weight: bold;">&#123;</span>cssHeader:<span style="color: #ff0000;">&quot;header&quot;</span>,cssAsc:<span style="color: #ff0000;">&quot;headerSortUp&quot;</span>,cssDesc:<span style="color: #ff0000;">&quot;headerSortDown&quot;</span>,cssChildRow:<span style="color: #ff0000;">&quot;expand-child&quot;</span>,sortInitialOrder:<span style="color: #ff0000;">&quot;asc&quot;</span>,sortMultiSortKey:<span style="color: #ff0000;">&quot;shiftKey&quot;</span>,sortForce:null,sortAppend:null,sortLocaleCompare:<span style="color: #c20cb9; font-weight: bold;">true</span>,textExtraction:<span style="color: #ff0000;">&quot;simple&quot;</span>,parse</pre></div></div>

<p>En fait, c&#8217;est que la commande renvoit la ligne de code, dans le fichier, où l&#8217;expression (en l&#8217;occurrence <em>include</em>) a été trouvée.  Le gros désavantage c&#8217;est que votre terminal est rempli de lignes de code et cela devient très difficile à lire lorsque vous avez des centaines de résultats à votre requête.</p>
<h3>La commande qui vous faut</h3>
<p>C&#8217;est simple : il vous suffit simplement d&#8217;ajouter l&#8217;option -l (grep -l) pour que seulement le nom du fichier sera affiché.  Dans notre exemple, cela deviendrait :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-lR</span> include wp-content<span style="color: #000000; font-weight: bold;">/*</span></pre></div></div>

<p>Ah, que c&#8217;est beau Linux !</p>
]]></content:encoded>
			<wfw:commentRss>http://itx-technologies.com/blog/3276-afficher-seulement-les-noms-des-fichiers-avec-la-commande-grep/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

