<?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>Grummfy&#039;s project &#187; script</title>
	<atom:link href="http://grummfy.be/blog/key/script/feed" rel="self" type="application/rss+xml" />
	<link>http://grummfy.be/blog</link>
	<description>Mes projets, mes rêves, mes envies, ...</description>
	<lastBuildDate>Mon, 02 Jan 2012 00:03:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WebHook Google Code &#8211; recevoir un mail à chaque commit</title>
		<link>http://grummfy.be/blog/310#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/310#comments</comments>
		<pubDate>Fri, 18 Jun 2010 23:58:59 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[découverte]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[trucs et astuces]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=310</guid>
		<description><![CDATA[Google code et webhook : envoyer un email a chaque commit]]></description>
			<content:encoded><![CDATA[<p>Dans Google code il y a la possibilité d&#8217;utiliser un gestionnaire de version tel que subversion (svn) ou mercurial (hg). C&#8217;est bien pratique, mais malheureusement, de base, rien n&#8217;est prévu pour prévenir (excepté par flux RSS) les gens de ces mises à jour. Cependant, Google code permet d&#8217;utiliser un webhook en post commit.</p>
<h2>Qu&#8217;est-ce qu&#8217;un webhook?</h2>
<p>Un webhook c&#8217;est un &laquo;&nbsp;crochet web&nbsp;&raquo;, c&#8217;est-à-dire une URL a appelée après (avant ou pendant) une action X. Dans notre cas, après chaque commit une URL est appelée.</p>
<h2>Utilisation</h2>
<p>Voici un exemple de code que j&#8217;utilise pour plusieurs de mes projets :</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;">// project name</span>
<span style="color: #000088;">$projects</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mon-super-projet'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// google code webhook key</span>
<span style="color: #000088;">$keys</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'b-box'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Top-Secret_key_fourni_par_google-dans-l-adminsitration'</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//user agent from google code</span>
<span style="color: #000088;">$useragent</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Google Code Project Hosting (+http://code.google.com/p/support/wiki/PostCommitWebHooks)'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//email of all owner (eg. project chief)</span>
<span style="color: #000088;">$owners</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'vous@example.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//email of all team members except owners</span>
<span style="color: #000088;">$users</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'toi@example.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//sender of email</span>
<span style="color: #000088;">$sender</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'WebHook mailer&lt;webmaster@exemple.com&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//----------------------------------------------------------------------</span>
<span style="color: #000088;">$project</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'p'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'p'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$revision</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'r'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>?<span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'r'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:-</span><span style="color: #cc66cc;">99</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'php://input'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$digest</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_GOOGLE_CODE_PROJECT_HOSTING_HOOK_HMAC'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_GOOGLE_CODE_PROJECT_HOSTING_HOOK_HMAC'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//----------------------------------------------------------------------</span>
<span style="color: #009933; font-style: italic;">/**
 * Send a mail
 * @param string $from email of the sender : sample@example.com or &quot;name&quot;&lt;sample@example.com&gt;;
 * @param array $to [a] =&gt; list of email [cc], [bcc] (hidden), ...
 * @param string $subject
 * @param string $body
 * @return bool true if success
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> mailer<span style="color: #009900;">&#40;</span><span style="color: #000088;">$from</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span> <span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'From: '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$from</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'a'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'a'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'a'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'bcc'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'bcc'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Bcc: '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'bcc'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cc'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cc'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Cc: '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #000088;">$to</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cc'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'MIME-Version: 1.0'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Content-Type: text/plain; charset=&quot;UTF-8&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Content-Transfer-Encoding: 8bit'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'X-Mailer: PHP/'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">phpversion</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'[webhook]'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> failed<span style="color: #009900;">&#40;</span><span style="color: #000088;">$test_id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$msg</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$sender</span><span style="color: #339933;">,</span> <span style="color: #000088;">$owners</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$msg</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>--<span style="color: #000099; font-weight: bold;">\n</span>WebHook mail from the Google code project&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	mailer<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sender</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'bcc'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$owners</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'failed test #'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$test_id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$msg</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'KO'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> get_ip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span> 
	<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_X_FORWARDED_FOR'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_X_FORWARDED_FOR'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_CLIENT_IP'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_CLIENT_IP'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REMOTE_ADDR'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//----------------------------------------------------------------------</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$useragent</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// failed 1</span>
	failed<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'User agent is bad : '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>From : &quot;</span> <span style="color: #339933;">.</span> get_ip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$project</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$project</span><span style="color: #339933;">,</span> <span style="color: #000088;">$projects</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// failed 2</span>
	failed<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'No project set : '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$project</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>From : &quot;</span> <span style="color: #339933;">.</span> get_ip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$hmac</span> <span style="color: #339933;">=</span> <span style="color: #990000;">hash_hmac</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'md5'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$data</span><span style="color: #339933;">,</span> <span style="color: #000088;">$keys</span><span style="color: #009900;">&#91;</span> <span style="color: #000088;">$project</span> <span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</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>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$digest</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$digest</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$hmac</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// failed 3</span>
		failed<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Bad digest : '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$digest</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' vs '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$hmac</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>From : &quot;</span> <span style="color: #339933;">.</span> get_ip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'revision_count'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'revisions'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// failed 4</span>
		failed<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Bad count : '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'revisions'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' vs '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'revision_count'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>From : &quot;</span> <span style="color: #339933;">.</span> get_ip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">else</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$mail_body</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'revisions'</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$_revision</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$mail_body</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Revision : '</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_revision</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'revision'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' from '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_revision</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'author'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' at '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y-m-d H:i'</span><span style="color: #339933;">,</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_revision</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'timestamp'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$mail_body</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Added : '</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_revision</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'added'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$mail_body</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Modified : '</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_revision</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'modified'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$mail_body</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Removed : '</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_revision</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'removed'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//			$mail_body .= 'URL : ' . &quot;\t\t&quot; . htmlentities($_revision['url']) . &quot;\n\n&quot;;</span>
			<span style="color: #000088;">$mail_body</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Message : '</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_revision</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'message'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//			$_revision['path_count'];</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000088;">$mail_body</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>--<span style="color: #000099; font-weight: bold;">\n</span>WebHook mail from the Google code project : &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$project</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>http://code.google.com/p/&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$project</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		mailer<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sender</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'bcc'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$owners</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$users</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'['</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$project</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">']New revision #'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$revision</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mail_body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'OK'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># EOF</span></pre></div></div>

</p>
<p>Plus d&#8217;info : <a href="http://code.google.com/p/support/wiki/PostCommitWebHooks">PostCommitWebHooks</a></p>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/310/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wampserver : quick switch xdebug menu</title>
		<link>http://grummfy.be/blog/250#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/250#comments</comments>
		<pubDate>Wed, 24 Mar 2010 22:22:42 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[deboguage]]></category>
		<category><![CDATA[découverte]]></category>
		<category><![CDATA[jouons]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[trucs et astuces]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[XDebug]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=250</guid>
		<description><![CDATA[Activer et désactiver XDebug sur Wampserver à souhait! Ceci via un menu supplémentaire.]]></description>
			<content:encoded><![CDATA[<p>Pour une fois, un article sous Ms Windows. Stage oblige, je passe du temps sous celui-ci (XP <img src='http://grummfy.be/blog/wp/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  ). Afin d&#8217;optimiser son travail, il y a parfois des petites choses bien pratiques, telles que ce que je vais vous présenter.</p>
<p>XDebug est un outil merveilleux, parfois capricieux, certes, mais très utile. Il permet, notamment<sup class='footnote'><a href='#fn-250-1' id='fnref-250-1'>1</a></sup> :</p>
<ul>
<li>Affichage de tracé d&#8217;erreur</li>
<li>Meilleures lectures des exceptions</li>
<li>Débogage pas-à-pas</li>
<li>Profiling d&#8217;application</li>
<li>&#8230;</li>
</ul>
<p>Bref, des choses essentielles en développement. Et, contrairement à ce que certains IDE<sup class='footnote'><a href='#fn-250-2' id='fnref-250-2'>2</a></sup> font, il permet surtout de le faire sur un serveur &laquo;&nbsp;réel&nbsp;&raquo;, donc avec une utilisation &laquo;&nbsp;réel&nbsp;&raquo;.</p>
<p>Le but de ce billet n&#8217;est pas de présenter XDebug, d&#8217;autres le font mieux que moi <sup class='footnote'><a href='#fn-250-3' id='fnref-250-3'>3</a></sup>, mais bien de vous présenter un petit script vous permettant d&#8217;activer et désactiver XDebug sur wampserver.</p>
<h2>Installation</h2>
<ol>
<li>Téléchargez le fichier <sup class='footnote'><a href='#fn-250-4' id='fnref-250-4'>4</a></sup> et décompressez-le.</li>
<li>Suivez les instructions d&#8217;installation décrite dans le fichier installe. Il y a seulement 1 fichier à modifier + 1 fichier par version de PHP installée.</li>
<li>Relancer wampserver et tester!</li>
</ol>
<p>Si vous avez des questions, n&#8217;hésitez pas.</p>
<h2>Plus d&#8217;informations</h2>
<ul>
<li><a href="http://blog.pascal-martin.fr/post/xdebug-installation-premiers-pas" target="_blank">Xdebug : Installation et premier pas</a></li>
<li><a href="http://blog.wampserver.com/index.php/2009/08/28/debugger-avec-wampserver-xdebug-et-pdt/" target="_self" class="broken_link">Débugger avec WampServer, Xdebug et PDT</a></li>
<li><a href="http://evoilliot.u7n.org/2010/02/installer-xdebug-avec-xampp/" target="_blank" class="broken_link">Installer Xdebug avec XAMPP</a></li>
<li><a href="http://www.wampserver.com" target="_blank">Wampserver</a></li>
<li><a href="http://xdebug.com/" target="_blank">XDebug</a></li>
<li>Pièce jointe : <a href="http://grummfy.be/blog/250/xdebug-tar">XDebug quick switch menu for wampserver</a></li>
</ul>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-250-1'>On parle de serveur web avec PHP &#8230; <span class='footnotereverse'><a href='#fnref-250-1'>&#8617;</a></span></li>
<li id='fn-250-2'>Par exemple, Zend Studio permet un débogage pas à pas mais en interne donc réduit &#8230;  <span class='footnotereverse'><a href='#fnref-250-2'>&#8617;</a></span></li>
<li id='fn-250-3'>cf. plus d&#8217;informations <span class='footnotereverse'><a href='#fnref-250-3'>&#8617;</a></span></li>
<li id='fn-250-4'><a href="http://grummfy.be/blog/250/xdebug-tar">XDebug quick switch menu for wampserver</a> <span class='footnotereverse'><a href='#fnref-250-4'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/250/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Activation, désactivation du wifi sur un D-Link DSL-2640B via PHP</title>
		<link>http://grummfy.be/blog/233#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/233#comments</comments>
		<pubDate>Wed, 17 Mar 2010 23:06:52 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[Logiciel]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Réflexion du jour]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[réseaux]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=233</guid>
		<description><![CDATA[Un script PHP en ligne de commande pour activer // désactiver le wifi sur un modem D-Link DSL-2640B. Cela permet d&#8217;illustrer un peu l&#8217;intérêt de faire du scripting &#8230; Je ne ferais pas de commentaires, mais n&#8217;hésitez pas à poser des questions &#8230; #!/usr/bin/php &#60;?php &#160; //Variable definition // //router $login = 'admin'; $password = [...]]]></description>
			<content:encoded><![CDATA[<p>Un script PHP en ligne de commande pour activer // désactiver le wifi sur un modem D-Link DSL-2640B. Cela permet d&#8217;illustrer un peu l&#8217;intérêt de faire du scripting &#8230;</p>
<p>Je ne ferais pas de commentaires, mais n&#8217;hésitez pas à poser des questions &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">#!/usr/bin/php
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Variable definition</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">//router</span>
<span style="color: #000088;">$login</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'admin'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'admin'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$ip</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'192.168.1.1'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">//wifi</span>
<span style="color: #000088;">$wifi</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #666666; font-style: italic;">// /!\ don't touch this /!\</span>
	<span style="color: #0000ff;">'wlSsidIdx'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'wlEnbl'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'wlCountry'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'GB'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'wlBasicRate'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//ssid name</span>
	<span style="color: #0000ff;">'wlSsid'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'monSuperRéseauxWifi'</span><span style="color: #339933;">,</span>
	<span style="color: #666666; font-style: italic;">//0 = visible, 1 = hide</span>
	<span style="color: #0000ff;">'wlHide'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>
	<span style="color: #666666; font-style: italic;">//number of chanel or 0 for auto selection</span>
	<span style="color: #0000ff;">'wlChannel'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
	<span style="color: #666666; font-style: italic;">//Transmission Speed</span>
	<span style="color: #0000ff;">'wlRate'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>
	<span style="color: #666666; font-style: italic;">//wifi mode 0=802.11b only, 1=Mixed 802.11g and 802.11b, 4=802.11g only</span>
	<span style="color: #0000ff;">'wlgMode'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span>
&nbsp;
	<span style="color: #0000ff;">'wlWpaGTKRekey'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">750</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'wlWpa'</span>			<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'aes'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'wlAuthMode'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'psk2'</span><span style="color: #339933;">,</span>
	<span style="color: #666666; font-style: italic;">//authentification mode : 0 = none, 1 = wep, 2 = auto (wpa or wpa2), 3 = wpa2 only, 4 = wpa only</span>
	<span style="color: #0000ff;">'wlAuth'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'wlWpaPsk'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'masuperclefdelamortquitue'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'wlWep'</span>		<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'disabled'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'wlPreauth'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/////////////////////</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> cli
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">const</span> LINE_BREAK <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">const</span> LINE_NO_BREAK <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">const</span> LINE_RETURN <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">const</span> LINE_NOTHING <span style="color: #339933;">=</span> <span style="color: #0000ff;">' '</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$_TEMP</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">250000</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//1/4 of seconds</span>
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$_MULTIPLICATOR</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//1/4 -&gt; 4</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$_LENGTH</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _write_empty_space<span style="color: #009900;">&#40;</span><span style="color: #000088;">$lng</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$lng</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_LENGTH<span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">' '</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$lng</span><span style="color: #339933;">++;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _echo<span style="color: #009900;">&#40;</span><span style="color: #000088;">$message</span><span style="color: #339933;">,</span> <span style="color: #000088;">$break</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$message</span><span style="color: #339933;">,</span> <span style="color: #000088;">$break</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$break</span> <span style="color: #339933;">==</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">LINE_NO_BREAK</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_write_empty_space<span style="color: #009900;">&#40;</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _sleep<span style="color: #009900;">&#40;</span><span style="color: #000088;">$second</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$second</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$second</span> <span style="color: #339933;">*</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_MULTIPLICATOR<span style="color: #339933;">;</span>
		<span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$j</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$second</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #990000;">usleep</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_TEMP<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_echo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'.'</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">LINE_NOTHING</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$i</span><span style="color: #339933;">++;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #b1b100;">else</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$j</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span>
				<span style="color: #009900;">&#123;</span>
					<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_echo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">LINE_RETURN</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_write_empty_space<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_echo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">LINE_RETURN</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
				<span style="color: #b1b100;">else</span>
				<span style="color: #009900;">&#123;</span>
					<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_echo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Please wait'</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">LINE_NOTHING</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #000088;">$i</span><span style="color: #339933;">++;</span>
				<span style="color: #009900;">&#125;</span>
				<span style="color: #000088;">$j</span><span style="color: #339933;">++;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_echo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">LINE_RETURN</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> wifi <span style="color: #000000; font-weight: bold;">extends</span> cli
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$_ch</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$_baseUrl</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$wifi</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ip</span><span style="color: #339933;">,</span> <span style="color: #000088;">$login</span><span style="color: #339933;">,</span> <span style="color: #000088;">$password</span><span style="color: #339933;">,</span> <span style="color: #000088;">$activation</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_baseUrl <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$ip</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_ch <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_ch<span style="color: #339933;">,</span> CURLOPT_HEADER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_ch<span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<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>
&nbsp;
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_auth<span style="color: #009900;">&#40;</span><span style="color: #000088;">$login</span><span style="color: #339933;">,</span> <span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$activation</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$activation</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$activation</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_activation<span style="color: #009900;">&#40;</span><span style="color: #000088;">$wifi</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_disactivation<span style="color: #009900;">&#40;</span><span style="color: #000088;">$wifi</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __destruct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_ch<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _activation<span style="color: #009900;">&#40;</span><span style="color: #000088;">$wifi</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_echo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Activation ...'</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">LINE_NO_BREAK</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$wifi</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'wlBasicRate'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$wifi</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'wlgMode'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">'wifi2'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">'default'</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_doQuery<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_baseUrl <span style="color: #339933;">.</span> <span style="color: #0000ff;">'wirelesssetting.wl?'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">http_build_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wifi</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&amp;'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_sleep<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _disactivation<span style="color: #009900;">&#40;</span><span style="color: #000088;">$wifi</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_echo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Disactivation ...'</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">LINE_NO_BREAK</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$wifiDown</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
			<span style="color: #0000ff;">'wlEnbl'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'wlSsidIdx'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$wifi</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'wlSsidIdx'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'wlCountry'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$wifi</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'wlCountry'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
		<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_doQuery<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_baseUrl <span style="color: #339933;">.</span> <span style="color: #0000ff;">'wirelesssetting.wl?'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">http_build_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wifiDown</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&amp;'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_sleep<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _doQuery<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_ch<span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_ch<span style="color: #339933;">,</span> CURLOPT_POST<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: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_ch<span style="color: #339933;">,</span> CURLOPT_POSTFIELDS<span style="color: #339933;">,</span> <span style="color: #000088;">$post</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_ch<span style="color: #339933;">,</span> CURLOPT_HTTPGET<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: #009900;">&#125;</span>
&nbsp;
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_ch<span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_echo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">LINE_BREAK</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_echo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Error Curl : '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">curl_error</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">LINE_BREAK</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_echo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DONE'</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">LINE_BREAK</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _auth<span style="color: #009900;">&#40;</span><span style="color: #000088;">$login</span><span style="color: #339933;">,</span> <span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_echo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Authentification ...'</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">LINE_NO_BREAK</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$post</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
			<span style="color: #0000ff;">'username'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$login</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'password'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$password</span>
		<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_doQuery<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_baseUrl <span style="color: #339933;">.</span> <span style="color: #0000ff;">'index.html'</span><span style="color: #339933;">,</span> <span style="color: #990000;">http_build_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&amp;'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$argc</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">' synthaxe : scriptname.php 1 for activation or 0 for desactivation '</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">new</span> wifi<span style="color: #009900;">&#40;</span><span style="color: #000088;">$wifi</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ip</span><span style="color: #339933;">,</span> <span style="color: #000088;">$login</span><span style="color: #339933;">,</span> <span style="color: #000088;">$password</span><span style="color: #339933;">,</span> <span style="color: #000088;">$argv</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># EOF</span></pre></div></div>

<p>Certes, le script ne gère pas tout, mais le but était de jouer avec la ligne de commande tout en n’allant pas dans les extensions exotiques de gestion de celle-ci &#8230;.</p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F233&amp;linkname=Activation%2C%20d%C3%A9sactivation%20du%20wifi%20sur%20un%20D-Link%20DSL-2640B%20via%20PHP" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F233&amp;linkname=Activation%2C%20d%C3%A9sactivation%20du%20wifi%20sur%20un%20D-Link%20DSL-2640B%20via%20PHP" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F233&amp;linkname=Activation%2C%20d%C3%A9sactivation%20du%20wifi%20sur%20un%20D-Link%20DSL-2640B%20via%20PHP" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F233&amp;linkname=Activation%2C%20d%C3%A9sactivation%20du%20wifi%20sur%20un%20D-Link%20DSL-2640B%20via%20PHP" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F233&amp;linkname=Activation%2C%20d%C3%A9sactivation%20du%20wifi%20sur%20un%20D-Link%20DSL-2640B%20via%20PHP" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F233&amp;linkname=Activation%2C%20d%C3%A9sactivation%20du%20wifi%20sur%20un%20D-Link%20DSL-2640B%20via%20PHP" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F233&amp;title=Activation%2C%20d%C3%A9sactivation%20du%20wifi%20sur%20un%20D-Link%20DSL-2640B%20via%20PHP" id="wpa2a_2"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/233/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>java : Drag &amp; Drop sur un JTable</title>
		<link>http://grummfy.be/blog/141#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/141#comments</comments>
		<pubDate>Mon, 07 Sep 2009 23:26:32 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[découverte]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[libre]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[trucs et astuces]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=141</guid>
		<description><![CDATA[Drag &#38; Drop sur un JTable Dans nos application moderne il semble logique de pouvoir faire du DND à gogo, pourtant ce n&#8217;est pas des plus simple, avec certain langage de le faire,  d&#8217;où cette exemple qui m&#8217;a fait un peu travaillez et arrachez un ou deux cheveux de ma longue chevelure de geek&#8230; Bref, [...]]]></description>
			<content:encoded><![CDATA[<h1>Drag &amp; Drop sur un JTable</h1>
<p style="text-align: justify;">Dans nos application moderne il semble logique de pouvoir faire du <acronym title="Drag&amp;Drop">DND</acronym> à gogo, pourtant ce n&#8217;est pas des plus simple, avec certain langage de le faire,  d&#8217;où cette exemple qui m&#8217;a fait un peu travaillez et arrachez un ou deux cheveux de ma longue chevelure de geek&#8230;</p>
<p style="text-align: justify;">Bref, voici l&#8217;essentiel :</p>
<ol>
<li>Il faut que le composant puisse être pris (drag) et/ou déposé (drop)</li>
<li>Il faut convertir le composant en donnée exportable et transportable (Transferable)</li>
<li>Il faut pouvoir restaurer les donnée correctement et suivant le type les restaurer de tel ou tel manière &#8230;</li>
</ol>
<p><span id="more-141"></span>Par défaut, java implémente tout une série de composant déjà &laquo;&nbsp;drag&amp;drop ready&nbsp;&raquo; :</p>
<p><img src="file:///tmp/moz-screenshot.jpg" alt="" /><img class="alignnone size-full wp-image-159" title="Tableau DND java" src="http://grummfy.be/blog/wp/wp-content/uploads/2009/09/Sans-titre.png" alt="Tableau DND java" width="340" height="338" /></p>
<p>Dans notre cas le JTable peut-être pris par copie mais on ne peux droper dedans&#8230;</p>
<p>Donc nous devons géré :</p>
<ul>
<li>Transport des données : ici nos lignes → Class JTableRowTransferable</li>
<li>Faire en sorte que le gestionnaire de DND accepte le drop et surtout l&#8217;accepte de notre transport de donnée → Class MyTransferHandler (class interne)</li>
<li>Et bien entendu faire comprendre à notre Jtable → il suffit de faire myJtable.setDragEnable(true); <img src='http://grummfy.be/blog/wp/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
</ul>
<p style="text-align: justify;">Une fois tout cela fait je me suis vite rendu compte que pour l&#8217;utilisateur ce n&#8217;était pas simple!!! En fait, l&#8217;utilisateur devait sélectionner la ligne (et pas plusieurs) et ensuite légèrement décalé sur le coté (pour ne pas partir vers la sélection d&#8217;autre ligne) et puis seulement bouger le tout &#8230; INGÉRABLE ! Bref, je me suis dit &laquo;&nbsp;let&#8217;s go pour un bouton de <span style="text-decoration: line-through;">drague</span> drag!&nbsp;&raquo; J&#8217;ai donc chercher avec un JButton.  Mais<sup class='footnote'><a href='#fn-141-1' id='fnref-141-1'>1</a></sup> malheureusement pour utiliser un JButton il faudrait implémenter un render (une class qui dit comment doit s&#8217;afficher un objet dans une JTable) pour la JTable. Donc on oublie!</p>
<p style="text-align: justify;">Pour finir, je me suis rabattu vers une ImageIcon <img class="size-full wp-image-143" title="Appuyez sur le &quot;bouton&quot; vert et glissez la ligne vers le haut ou le bas ..." src="http://grummfy.be/blog/wp/wp-content/uploads/2009/09/drag_me_green.png" alt="Appuyez sur le &quot;bouton&quot; vert et glissez la ligne vers le haut ou le bas ..." width="47" height="14" /> (ou rien du tout cela aurait été pareil&#8230;) et un MouseListener sur mon JTable.</p>
<p style="text-align: justify;">Bref, je ne vais pas vous faire un cours, pour cela je vous renvoi plus bas! Donc, je vous propose de télécharger l&#8217;exemple : <a title="Télécharger l'exemple" rel="attachment wp-att-148" href="http://grummfy.be/blog/?attachment_id=148">DragTableExample.tar</a></p>
<h2>Plus d&#8217;info sur le DND en java ?</h2>
<ul>
<li>Excellent article sur le fonctionnement du DND : <a href="http://mbaron.developpez.com/javase/dnddt/" target="_blank">Introduction au Drag and Drop : transfert de données</a>[fr]</li>
<li><a href="http://gfx.developpez.com/tutoriel/java/swing/drag/" target="_blank">Drag &amp; Drop avec Style et l&#8217;API Swing</a>[fr]</li>
<li>Larticle de sun : <a href="http://java.sun.com/docs/books/tutorial/uiswing/dnd/index.html">Lesson: Drag and Drop and Data Transfer</a>[en]</li>
<li>Encore un autre très bon article : <a href="http://www.javaworld.com/javaworld/jw-03-1999/jw-03-dragndrop.html">How to drag and drop with Java 2</a>[en]</li>
</ul>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-141-1'>puisque mais il y a sinon cela ne serait pas marrant <span class='footnotereverse'><a href='#fnref-141-1'>&#8617;</a></span></li>
</ol>
</div>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F141&amp;linkname=java%20%3A%20Drag%20%26%23038%3B%20Drop%20sur%20un%20JTable" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F141&amp;linkname=java%20%3A%20Drag%20%26%23038%3B%20Drop%20sur%20un%20JTable" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F141&amp;linkname=java%20%3A%20Drag%20%26%23038%3B%20Drop%20sur%20un%20JTable" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F141&amp;linkname=java%20%3A%20Drag%20%26%23038%3B%20Drop%20sur%20un%20JTable" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F141&amp;linkname=java%20%3A%20Drag%20%26%23038%3B%20Drop%20sur%20un%20JTable" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F141&amp;linkname=java%20%3A%20Drag%20%26%23038%3B%20Drop%20sur%20un%20JTable" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F141&amp;title=java%20%3A%20Drag%20%26%23038%3B%20Drop%20sur%20un%20JTable" id="wpa2a_4"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/141/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Questionnaire &#8211; sondage en ligne</title>
		<link>http://grummfy.be/blog/125#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/125#comments</comments>
		<pubDate>Wed, 26 Aug 2009 22:13:35 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Grummfy grrrrumf, ou comment raller]]></category>
		<category><![CDATA[Logiciel]]></category>
		<category><![CDATA[découverte]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=125</guid>
		<description><![CDATA[J'en ai vu passé des questionnaires de fin de thèse ou des sondage pour tel ou tel société mais jamais je n'avais songé prendre note des références des logiciel ou des sociétés utilisé pour créer ces sondages-enquêtes! Du coup, en ayant eu besoin j'ai du chercher...]]></description>
			<content:encoded><![CDATA[<p>J&#8217;en ai vu passé des questionnaires de fin de thèse ou des sondage pour tel ou tel société mais jamais je n&#8217;avais songé prendre note des références des logiciel ou des sociétés utilisé pour créer ces sondages-enquêtes! Du coup, en ayant eu besoin j&#8217;ai du chercher&#8230;</p>
<p>Et là cela se complique, on se rend vite compte que beaucoup de société propose des service payant et là ou pour n&#8217;importe quel script on trouve facilement des réponses à droite et à gauche, ici rien! Bien embêté me voila sur le chemin de la recherche.</p>
<p>Bref après quelques recherche et élimination je trouve deux sites proposant des services gratuits et qui semble correcte :<br />
<a href="http://www.paxonta.com">http://www.paxonta.com</a> et <a href="http://www.sondageonline.com">http://www.sondageonline.com</a></p>
<p>Cependant, je me dit qu&#8217;il y avait certainement un projet open-source qui se devait d&#8217;exister et que si ce n&#8217;est pas le cas, alors le moment de hurler et de se lancer dans la bataille en faisant son William Walace devait arriver. Mais heureusement, pas besoin de tête tranchée le script fut trouvé :  <a href="http://www.limesurvey.org">LimeSurvey</a></p>
<p>Je ne suis pas déçu et ils propose même un service en ligne : <a href="http://www.limeservice.com">http://www.limeservice.com</a><br />
Par contre, il m&#8217;a fallu un peu de temps pour comprendre &#8230;. En gros, toujours cliquer sur l&#8217;icône à droite (l&#8217;espèce de feuille &#8230;.) et voila!</p>
<p>Perso je trouve que c&#8217;est encore fort compliqué &#8230; mais bon on peux pas tout avoir &#8230;.</p>
<p>J&#8217;en profite pour vous le faire tester en répondant a ce magnifique <a href="http://forum.limequery.net/index.php?sid=24955&amp;lang=fr" target="_blank">questionnaire sur les forums</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/125/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Des scripts perso pour se facilité la vie</title>
		<link>http://grummfy.be/blog/96#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/96#comments</comments>
		<pubDate>Wed, 07 Nov 2007 19:26:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[GNU|Linux]]></category>
		<category><![CDATA[libre]]></category>
		<category><![CDATA[Posteet]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[trucs et astuces]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=96</guid>
		<description><![CDATA[Sous GNU/Linux un petit script peux souvent facilité la vie, et allégé mais surtout accéléré certaine tâche. Qu&#8217;est-ce qu&#8217;un script? Un script est une suite d&#8217;instruction enregistré dans un fichier, qui peuvent être exécuté en lançant ce fichier, dans l&#8217;interpréteur de script. Souvent nommé script bash, shell, &#8230; Stocker et accèder facilement à ces scripts [...]]]></description>
			<content:encoded><![CDATA[<p>Sous GNU/Linux un petit script peux souvent facilité la vie, et allégé mais surtout accéléré certaine tâche.</p>
<h2>Qu&#8217;est-ce qu&#8217;un script?</h2>
<p>Un script est une suite d&#8217;instruction enregistré dans un fichier, qui peuvent être exécuté en lançant ce fichier, dans l&#8217;interpréteur de script. Souvent nommé script bash, shell, &#8230;</p>
<h2>Stocker et accèder facilement à ces scripts</h2>
<p>U!ne fois votre script fait, vous pouvez l&#8217;enregistrer dans un simple fichier texte, soit avec l&#8217;extension .sh, soit sans extension (après tout on est sous Linux!). Personnellement, j&#8217;ai un dossier nommé <q>.myScript,</q> dans mon répertoire home (donc <q>/home/grummfy/.myScript/</q>). Afin d&#8217;accédé à mes script je doit tapé<br />
<code>~/.myScript/nomduscript.sh</code>.</p>
<p>Ce n&#8217;est pas pratique du tout!</p>
<p>Afin de ce facilité la tâche, je désire que le PATH inclut mon dossier de script. Le PATH est une variable système qui défini le chemin (<q>path</q> = chemin en français) vers les différent répertoire contenant, notamment, des exécutables.<br />
Je pourrais très bien tapé <br />
<code>set PATH=.....}}</code> <br />
mais je n&#8217;en voix pas l&#8217;utilité et surtout je trouve cela lourd.</p>
<p>Reprenons donc à la base. En principe, lorsque vous lancer la <a href="http://doc.ubuntu-fr.org/console">console</a> ou interpréteur de commande, vous lancer un programme qui va aller chercher toute une série de préférence utilisateur, notamment dans le fichier script <q>~/.bashrc</q></p>
<p>Modifions donc ce fichier, en y ajoutant ceci&nbsp;:</p>
<pre> # set my batch dir PATH=~/.myScript/:&quot;${PATH}&quot; </pre>
<p>La première ligne étant un commentaires, et la deuxième l&#8217;instruction qui ajoute le chemin vers mon dossier de script.</p>
<p>Pour rappel, le <q>~</q> est un raccourci pour <q>/home/vous/</q>, dans mon cas <q>/home/grummfy/</q></p>
<h2>Aller plus loin</h2>
<p>En effectuant divers recherche sur votre moteur de recherche préféré (<a href="http://www.google.com">Google</a>, live search, Yahoo, &#8230;), vous devriez pouvoir trouvez énormément de tuto pour des scripts, que se soit linux, windows, bsd, mac ou autre.</p>
<p>Néanmoins, voici quelques pistes&nbsp;:</p>
<ul>
<li><a href="http://www.tuteurs.ens.fr/unix/shell/script.html">Programmation de scripts en shell</a></li>
<li>Scripting shell sous Linux</li>
<li> Programmation de scripts&nbsp;: intro</li>
<li><a href="http://lea-linux.org/cached/index/Shell.html" class="broken_link">Les bases du shell</a>, de plsu la page comporte des liens vers des sites de références!</li>
<li><a href="http://www.pcinpact.com/forum/sujet_45608.htm" class="broken_link">Les script bash sur pcinpact</a></li>
</ul>
<p>ps&nbsp;: Non GNU/Linux n&#8217;est pas le seul à possédé des scripts, mais ici je m&#8217;y réfère car je parle de ce que j&#8217;ai sous la main&#8230;.</p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F96&amp;linkname=Des%20scripts%20perso%20pour%20se%20facilit%C3%A9%20la%20vie" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F96&amp;linkname=Des%20scripts%20perso%20pour%20se%20facilit%C3%A9%20la%20vie" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F96&amp;linkname=Des%20scripts%20perso%20pour%20se%20facilit%C3%A9%20la%20vie" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F96&amp;linkname=Des%20scripts%20perso%20pour%20se%20facilit%C3%A9%20la%20vie" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F96&amp;linkname=Des%20scripts%20perso%20pour%20se%20facilit%C3%A9%20la%20vie" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F96&amp;linkname=Des%20scripts%20perso%20pour%20se%20facilit%C3%A9%20la%20vie" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F96&amp;title=Des%20scripts%20perso%20pour%20se%20facilit%C3%A9%20la%20vie" id="wpa2a_6"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/96/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FSB RC est sortie!</title>
		<link>http://grummfy.be/blog/92#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/92#comments</comments>
		<pubDate>Mon, 29 Oct 2007 23:07:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Logiciel]]></category>
		<category><![CDATA[forum]]></category>
		<category><![CDATA[FSB]]></category>
		<category><![CDATA[libre]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[Projet]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sortie]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=92</guid>
		<description><![CDATA[Je vous le disait il y a peu, la nouvelle RC de FSB 2 allait sortir. C&#8217;est chose faites&#160;! Les principales nouveauté sont les suivantes&#160;: Chiffrement RSA pour les identifiant FSBCard (idée dont je suis fier) qui permet l&#8217;export de son profil ainsi que de ses préférences Un mode bas débit du forum L&#8217;option d&#8217;installation [...]]]></description>
			<content:encoded><![CDATA[<p>Je vous le disait il y <a href="/blog/index.php?post/2007/10/22/sortie-interessante#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">a peu</a>, la nouvelle RC de FSB 2 allait sortir.</p>
<p>C&#8217;est chose faites&nbsp;!</p>
<p>Les principales nouveauté sont les suivantes&nbsp;:</p>
<ul>
<li>Chiffrement RSA pour les identifiant</li>
<li>FSBCard (idée dont je suis fier) qui permet l&#8217;export de son profil ainsi que de ses préférences</li>
<li>Un mode bas débit du forum</li>
<li>L&#8217;option d&#8217;installation rapide, génial pour les développeurs!</li>
<li>Plein de fix</li>
<li>Possibilité de mettre des sondage dans les map des message, pour rappel les maps des messages étant une présentation d&#8217;un nouveau sujet||message à posté</li>
<li>Refonte complète du système de procédure modératives</li>
</ul>
<p>Bref on sent que la version final approche et surtout que FSB2 à un grand avenir devant lui!</p>
<p>Mon seul regret&nbsp;: le thème que je trouve bof bof</p>
<p><a href="http://www.fire-soft-board.com/fsb/sujet-7528-1.html">L&#8217;annonce officiel</a></p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F92&amp;linkname=FSB%20RC%20est%20sortie%21" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F92&amp;linkname=FSB%20RC%20est%20sortie%21" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F92&amp;linkname=FSB%20RC%20est%20sortie%21" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F92&amp;linkname=FSB%20RC%20est%20sortie%21" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F92&amp;linkname=FSB%20RC%20est%20sortie%21" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F92&amp;linkname=FSB%20RC%20est%20sortie%21" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F92&amp;title=FSB%20RC%20est%20sortie%21" id="wpa2a_8"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/92/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ExperienceLibre : Fire Soft Board</title>
		<link>http://grummfy.be/blog/76#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/76#comments</comments>
		<pubDate>Wed, 22 Aug 2007 17:06:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Présentation]]></category>
		<category><![CDATA[forum]]></category>
		<category><![CDATA[FSB]]></category>
		<category><![CDATA[jeux]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[postgreql]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=76</guid>
		<description><![CDATA[Suite à mon billet précédent je vous présente le logiciel libre fire soft board ou simplement FSB. Késako? FSB, est un forum programmée en PHP et disponible en deux version. De plsu, il est possible d&#8217;ajouter une multitude de mods et de thèmes. La version 1 est un forum basique et léger, fonctionnant, pur ainsi [...]]]></description>
			<content:encoded><![CDATA[<p>Suite à mon <a href="/blog/index.php?post/2007/08/22/Racontez-votre-utilisation-des-logiciels-libres#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">billet précédent</a> je vous présente le logiciel libre fire soft board ou simplement FSB.</p>
<h2>Késako?</h2>
<p>FSB, est un forum programmée en PHP et disponible en deux version. De plsu, il est possible d&#8217;ajouter une multitude de mods et de thèmes.</p>
<p>La version 1 est un forum basique et léger, fonctionnant, pur ainsi dire, que avec mysql.<br />
La version 2 est assez léger mais comporte énormément d&#8217;options, multi-langue, multi base de données.</p>
<h2>Ma découverte</h2>
<p>Mon histoire avec FSB, commence à ces débuts, lorsque il était encore en cours d&#8217;élaboration. En fait, à l&#8217;époque j&#8217;utilisai <a href="http://www.phpbb.biz">PHPBB</a> que je trouvait intéressant et empli de mods. Avec d&#8217;autre j&#8217;ai participé à la création d&#8217;une communauté belge phpbb-be, disparue aujourd&#8217;hui et je voulait créer d&#8217;autre projet afin d&#8217;aider les gens à programmer des mods et autres via phpbb.</p>
<p>Cependant, plus je m&#8217;intéressait, plus je trouvait que phpbb était brouillon et peu modifiable. Je me suis dit il doit bien exister autre chose! Et puis l&#8217;idée faisant son chemin, et trainant sur le forum portail-maker (aujourd&#8217;hui disparu) que dirigeait le créateur de FSB, j&#8217;ai très rapidement accroché à l&#8217;idée du nouveau forum qu&#8217;était FSB. Certes, la version 1 n&#8217;était pas l&#8217;idéal que je m&#8217;était fixé, cependant elle permettait d&#8217;être facilement modifié (vu le peu d&#8217;option dispo) et disposait de commentaire en français (ce qui à l&#8217;époque, était un problème pour moi).</p>
<h2>Ma participation</h2>
<p>Depuis la première beta, j&#8217;ai participer à la découverte de bug  et à leur correction. J&#8217;ai donnée pas mal d&#8217;idée que se soit de mods ou de fonctionnalité. Mais j&#8217;en ai surtout fait la promotion. Pour moi, ce forum était génial dans le sens où il était nettement plus sûr que PHPBB (de part le peu de présence de FSB sur la toile et de part sa conception).</p>
<p>Depuis quelque temps, je suis aussi modérateurs et responsables validations des mods et rédacteurs du wiki (wiki, qui après insistance fut enfin installé!) de FSB.</p>
<p>J&#8217;ai aussi créer diverse prémods, mods et <a href="http://modeur.grummfy.com/">aide au modeurs</a> pour FSB 1.*.*. Bref j&#8217;ai participé et participe encore a ce projet.</p>
<h2>Mon utilisation</h2>
<p>Pour ce qui est de l&#8217;utilisation du logiciel, je doit dire que j&#8217;ai quatre site sur lequel je l&#8217;utilise, 2 en version 1 et 2 en version 2! Je ne suis que peu déçus par FSB, même si je regrette l&#8217;absence d&#8217;une api de programmation!</p>
<h2>Statut actuelle du logiciel</h2>
<p>Actuellement, FSB va bientôt sortir sa version 2 qui apporte au moins deux nouveautés unique (à ma connaissance):</p>
<ul>
<li>Des procédures modératives</li>
<li>Des FSBCard, un système permettant d&#8217;exporter/importer son profil utilisateur dans un autre forum (idée dont je en suis pas peu fière)!</li>
</ul>
<pre></pre>
<p>Bien entendu cela ne se limite pas à cela.</p>
<p>A noter que FSB recherche des graphistes pour le projet!</p>
<h2>Site</h2>
<p>Je vous invite à en découvrir plus sur le site officiel est <a href="http://www.fire-soft-board.com" title="http://www.fire-soft-board.com">http://www.fire-soft-board.com</a>, en français (qui à l&#8217;heure où je parle est en transformation).</p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F76&amp;linkname=ExperienceLibre%20%3A%20Fire%20Soft%20Board" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F76&amp;linkname=ExperienceLibre%20%3A%20Fire%20Soft%20Board" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F76&amp;linkname=ExperienceLibre%20%3A%20Fire%20Soft%20Board" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F76&amp;linkname=ExperienceLibre%20%3A%20Fire%20Soft%20Board" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F76&amp;linkname=ExperienceLibre%20%3A%20Fire%20Soft%20Board" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F76&amp;linkname=ExperienceLibre%20%3A%20Fire%20Soft%20Board" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F76&amp;title=ExperienceLibre%20%3A%20Fire%20Soft%20Board" id="wpa2a_10"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/76/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Zend Framework (ZF) : un livre d&#8217;or,  sixième étapes : Conclusions</title>
		<link>http://grummfy.be/blog/65#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/65#comments</comments>
		<pubDate>Mon, 06 Aug 2007 02:38:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[jouons]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[tutoriel]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=65</guid>
		<description><![CDATA[Créations d&#8217;un livre d&#8217;or en 6 étapes Définition Créations des tables sql et des répertoires Bases des fichiers Affichages et ajout de messages Modification et suppression des messages Conclusions Conclusions Avant de faire la conclusion finale, je vais ajouter deux trois trucs au script : Dans la base de donnée ajouter trois champs : ip(varchar de 15), [...]]]></description>
			<content:encoded><![CDATA[<h2>Créations d&#8217;un livre d&#8217;or en 6 étapes</h2>
<ol>
<li><a href="?p=58#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Définition</a></li>
<li><a href="?p=59#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Créations des tables sql et des répertoires</a></li>
<li><a href="?p=60#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Bases des fichiers</a></li>
<li><a href="?p=63#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Affichages et ajout de messages</a></li>
<li><a href="?p=64#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Modification et suppression des messages</a></li>
<li><a href="?p=65#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Conclusions</a></li>
</ol>
<h3>Conclusions</h3>
<p>Avant de faire la conclusion finale, je vais ajouter deux trois trucs au script : Dans la base de donnée ajouter trois champs : ip(varchar de 15), email(varchar de 60) et site(varchar de 60) et modifier en conséquence le fichier contrôleur</p>
<p>On pourrait ajouter un système de validation des messages&#8230; et encore d&#8217;autre choses.</p>
<p>On peux ajouter un système de cache (voir archive)</p>
<p>Afin de terminer en plus joli voici une feuille de style à ajouter : <strong>/public/style/site.css</strong></p>
<pre> body,html { 	margin: 0px; 	font-family: Verdana,Arial,Helvetica,sans-serif; 	color: #000000; 	background-color: #ffffff; 	text-align: justify; } h1 { 	font-size: 1.4em; 	color: #800000; } #content { 	margin: 0px auto 0px auto; 	width: 500px; } .livre_block_message { 	border: 1px dotted #aaaaaa; 	margin-bottom: 1.5em; 	padding: 0.5em; } a { 	color: #800000; }</pre>
<p>et pour qu&#8217;elle soit pris en compte on modifie header.phtml :</p>
<pre> ... 	&lt;link rel="stylesheet" type="text/css" media="screen" href="&lt;?php echo $this-&gt;baseUrl;?&gt;/public/style/site.css" /&gt; &lt;/head&gt; ...</pre>
<h3>Conclusion</h3>
<p>Dans ce tutoriel on a :</p>
<ul>
<li>Utiliser Zend_View</li>
<li>Utiliser Zend_View_Helper</li>
<li>Utiliser Zend_Db_Table</li>
<li>Utiliser Zend_Config_Ini</li>
<li>Utiliser Zend_Controller_Front</li>
</ul>
<p>Maintenant essayer de modifier et de bien comprendre tout cela, lisez le manuel de Zend Framework et vous irez rapidement vers de plus grosses application!</p>
<p><a href="/blog/media/tuto/zf_goldbook.tar.bz2#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Télécharger</a></p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F65&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20%20sixi%C3%A8me%20%C3%A9tapes%20%3A%20Conclusions" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F65&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20%20sixi%C3%A8me%20%C3%A9tapes%20%3A%20Conclusions" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F65&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20%20sixi%C3%A8me%20%C3%A9tapes%20%3A%20Conclusions" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F65&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20%20sixi%C3%A8me%20%C3%A9tapes%20%3A%20Conclusions" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F65&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20%20sixi%C3%A8me%20%C3%A9tapes%20%3A%20Conclusions" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F65&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20%20sixi%C3%A8me%20%C3%A9tapes%20%3A%20Conclusions" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F65&amp;title=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20%20sixi%C3%A8me%20%C3%A9tapes%20%3A%20Conclusions" id="wpa2a_12"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/65/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework (ZF) : un livre d&#8217;or, cinquième étapes : Modification et suppression des messages</title>
		<link>http://grummfy.be/blog/64#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/64#comments</comments>
		<pubDate>Mon, 06 Aug 2007 02:36:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[jouons]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[tutoriel]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=64</guid>
		<description><![CDATA[Créations d&#8217;un livre d&#8217;or en 6 étapes Définition Créations des tables sql et des répertoires Bases des fichiers Affichages et ajout de messages Modification et suppression des messages Conclusions Modification et suppression des messages Modifions notre contrôleur : &#60;?php /** Zend_Controller_Action */ require_once 'Zend/Controller/Action.php'; class LivreController extends Zend_Controller_Action { public function indexAction() { $livre = new [...]]]></description>
			<content:encoded><![CDATA[<h2>Créations d&#8217;un livre d&#8217;or en 6 étapes</h2>
<ol>
<li><a href="?p=58#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Définition</a></li>
<li><a href="?p=59#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Créations des tables sql et des répertoires</a></li>
<li><a href="?p=60#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Bases des fichiers</a></li>
<li><a href="?p=63#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Affichages et ajout de messages</a></li>
<li><a href="?p=64#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Modification et suppression des messages</a></li>
<li><a href="?p=65#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Conclusions</a></li>
</ol>
<h3>Modification et suppression des messages</h3>
<p>Modifions notre contrôleur :</p>
<pre> &lt;?php /** Zend_Controller_Action */ require_once 'Zend/Controller/Action.php'; class LivreController extends Zend_Controller_Action { 	public function indexAction() 	{ 		$livre = new livre(); 		$this-&gt;view-&gt;livres = $livre-&gt;fetchAll(); 	} 	public function ajouterAction() 	{ 		$this-&gt;view-&gt;title .= ' .: Ajout d\'un message'; 		if ($this-&gt;getRequest()-&gt;isPost()) 		{ 			Zend_Loader::loadClass('Zend_Filter_StripTags'); 			$filter = new Zend_Filter_StripTags(); 			$livre = $this-&gt;_getEmptyMsg(); 			$livre-&gt;id = null; 			$livre-&gt;nom = trim($filter-&gt;filter($this-&gt;getRequest()-&gt;getPost('nom'))); 			$livre-&gt;message = trim($filter-&gt;filter($this-&gt;getRequest()-&gt;getPost('message'))); 			if ($livre-&gt;nom != htmlspecialchars('Pseudo')) 			{ 				$livre_ = new Livre(); 				$livre_-&gt;insertObject($livre); 				$this-&gt;_redirect('/livre'); 				return; 			} 			else 			{ 				$this-&gt;view-&gt;message = 'Merci de donner votre pseudo!'; 			} 		} 		//création d'un message vide 		$this-&gt;view-&gt;livre = $this-&gt;_getEmptyMsg(); 	} 	public function modifierAction() 	{ 		//si on est aps connecter -&gt;redirection sur le logeur 		if (!$_SESSION['connecter']) 			$this-&gt;getResponse()-&gt;setRedirect($this-&gt;view-&gt;baseUrl . '/livre/admin/'); 		$this-&gt;view-&gt;title .= ' .: Modification d\'un message'; 		//récupération du message correspondant au paramètre id 		$livreTable = new Livre(); 		$where  = $livreTable-&gt;getAdapter()-&gt;quoteInto('id = ?', intval($this-&gt;getRequest()-&gt;getParam('id'))); 		$livre = $livreTable-&gt;fetchRow($where); 		if ($this-&gt;getRequest()-&gt;isPost()) 		{ 			Zend_Loader::loadClass('Zend_Filter_StripTags'); 			$filter = new Zend_Filter_StripTags(); 			$livre-&gt;nom = trim($filter-&gt;filter($this-&gt;getRequest()-&gt;getPost('nom'))); 			$livre-&gt;message = trim($filter-&gt;filter($this-&gt;getRequest()-&gt;getPost('message'))); 			if ($livre-&gt;nom != htmlspecialchars('Pseudo')) 			{ 				$livre_ = new Livre(); 				$livre_-&gt;updateObject($livre, $livre_-&gt;getAdapter()-&gt;quoteInto('id = ?', $livre-&gt;id)); 				$this-&gt;_redirect('/livre/'); 				return; 			} 		} 		$this-&gt;view-&gt;livre = $livre; 		$this-&gt;view-&gt;action .= '/id/' . $livre-&gt;id; 		$this-&gt;render('ajouter'); 	} 	public function adminAction() 	{ 		$this-&gt;view-&gt;title .= ' .: Administration'; 		if ($this-&gt;getRequest()-&gt;isPost() &amp;&amp; !$_SESSION['connecter']) 		{ 			if ($this-&gt;getRequest()-&gt;getPost('login') == 'admin' &amp;&amp; $this-&gt;getRequest()-&gt;getPost('pass') == '1234') 			{ 				//bon password et bon login 				$_SESSION['connecter'] = true; 			} 		} 		elseif (!$_SESSION['connecter']) 		{ 			$this-&gt;render(); 			return; 		} 		$this-&gt;getResponse()-&gt;setRedirect($this-&gt;view-&gt;baseUrl . '/livre/'); 	} 	public function disadminAction() 	{ 		$this-&gt;view-&gt;title .= ' .: Déconnection'; 		if ($_SESSION['connecter']) 		{ 			$_SESSION['connecter'] = false; 		} 		$this-&gt;getResponse()-&gt;setRedirect($this-&gt;view-&gt;baseUrl . '/livre/'); 	} 	public function supprimerAction() 	{ 		//si on est aps connecter -&gt;redirection sur le logeur 		if (!$_SESSION['connecter']) 			$this-&gt;getResponse()-&gt;setRedirect($this-&gt;view-&gt;baseUrl . '/livre/admin/'); 		$this-&gt;view-&gt;title .= ' .: Suppretion d\'un message'; 		$livre = $this-&gt;_getEmptyMsg(); 		$livre-&gt;id = intval($this-&gt;getRequest()-&gt;getParam('id')); 		$this-&gt;view-&gt;action .= '/id/' . $livre-&gt;id; 		if ($this-&gt;getRequest()-&gt;isPost()) 		{ 			$livre_ = new Livre(); 			if ($livre_-&gt;delete($livre_-&gt;getAdapter()-&gt;quoteInto('id = ?', $livre-&gt;id))) 				$this-&gt;view-&gt;message = 'Message supprimé!'; 			else 				$this-&gt;view-&gt;message = 'Message &lt;b&gt;non&lt;/b&gt; supprimé!'; 			$this-&gt;view-&gt;message .= '&lt;br /&gt; Vous aller être rediriger!&lt;br /&gt;'; 			$this-&gt;getResponse()-&gt;setRawHeader('Refresh:3; url=' . $this-&gt;view-&gt;baseUrl . '/livre/'); 		} 	} 	function init() 	{ 		session_name('goldbook'); 		session_start(); 		$_SESSION['connecter'] = isset($_SESSION['connecter'])?$_SESSION['connecter']:false; 		$this-&gt;view-&gt;connecter = $_SESSION['connecter']; 		$this-&gt;view-&gt;title = 'Livre d\'or'; 		//url de base... 		$this-&gt;view-&gt;baseUrl = $this-&gt;_request-&gt;getBaseUrl(); 		$this-&gt;view-&gt;action = $this-&gt;getRequest()-&gt;getActionName(); 		//prêt à travailler sur les livres 		Zend_Loader::loadClass('Livre'); 		//ajout des aides de view 		$this-&gt;view-&gt;addHelperPath('./app/views/helpers', 'MyWsp_View_Helper'); 		$this-&gt;view-&gt;setEscape('utf8_encode'); 	} 	/** 	 * Créer un message vide 	 * 	 * @return Object 	 */ 	protected function _getEmptyMsg() 	{ 		//création d'un message vide 		$livre = new stdClass(); 		$livre	-&gt;id = -99; 		$livre	-&gt;nom = 'Pseudo'; 		$livre	-&gt;message = 'Entrez votre message'; 		$livre	-&gt;date = time(); 		return $livre; 	} }</pre>
<p>Il nous faut créer un système de session, et une authentification pour l&#8217;administration. Ici les choses sont très basiques, car le but n&#8217;y est pas! Donc on utilise els session php et une authentification des plus basique (login: <q>admin</q>, password: <q>1234</q>)!</p>
<p>Il nous faut encore modifier index.phtml</p>
<pre> &lt;?php echo $this-&gt;render('header.phtml'); ?&gt; &lt;?php if ($this-&gt;connecter) echo '&lt;a href="' , $this-&gt;baseUrl , '/livre/disadmin"&gt;Se déconnecter&lt;/a&gt;'; ?&gt; 	&lt;div id="livre"&gt; 		&lt;p&gt;&lt;a href="&lt;?php echo $this-&gt;baseUrl; ?&gt;/livre/ajouter"&gt;Ajouter un message&lt;/a&gt;&lt;/p&gt; 		&lt;div id="livre_message"&gt; 		&lt;?php foreach($this-&gt;livres as $livre) : ?&gt; 			&lt;div class="livre_block_message"&gt; 				&lt;span class="livre_pseudo"&gt;&lt;?php 					echo $this-&gt;escape($livre-&gt;nom); 				?&gt;&lt;/span&gt; | 				&lt;span class="livre_date"&gt;Le &lt;?php echo $this-&gt;date('DDDD DD MMMM YYYY', $this-&gt;escape($livre-&gt;date)); ?&gt;&lt;/span&gt; 				&lt;br /&gt; 				&lt;span class="livre_message"&gt;&lt;?php echo nl2br($this-&gt;escape($livre-&gt;message)); ?&gt;&lt;/span&gt; 				&lt;?php 				if ($this-&gt;connecter) 					echo '&lt;br /&gt;&lt;a href="' , $this-&gt;baseUrl , '/livre/modifier/id/' , $livre-&gt;id , '"&gt;Modifier&lt;/a&gt; 					&lt;a href="' , $this-&gt;baseUrl , '/livre/supprimer/id/' , $livre-&gt;id , '"&gt;Supprimer&lt;/a&gt;'; 				?&gt; 			&lt;/div&gt; 		&lt;?php endforeach; ?&gt; 		&lt;/div&gt; 	&lt;/div&gt; &lt;?php echo $this-&gt;render('footer.phtml'); ?&gt;</pre>
<p>N&#8217;oublions pas d&#8217;ajouter les fichier admin.phtml et supprimer.phtml</p>
<p><strong>suprimer.html</strong></p>
<pre> &lt;?php echo $this-&gt;render('header.phtml'); ?&gt; 	&lt;div id="livre"&gt; 		&lt;strong&gt;&lt;?php echo $this-&gt;message; ?&gt;&lt;/strong&gt; 		&lt;form method="post" action="&lt;?php echo $this-&gt;baseUrl ?&gt;/livre/&lt;?php echo $this-&gt;action ?&gt;" name="form_nom"&gt; 			&lt;div id="livre_haut"&gt; 				&lt;button type="submit" name="del"&gt;Supprimer?&lt;/button&gt; 			&lt;/div&gt; 		&lt;/form&gt; 		&lt;br /&gt; 		&lt;br /&gt; 	&lt;/div&gt; &lt;?php echo $this-&gt;render('footer.phtml'); ?&gt;</pre>
<p><strong>admin.phtml</strong></p>
<pre> &lt;?php echo $this-&gt;render('header.phtml'); ?&gt; 	&lt;div id="livre"&gt; 		&lt;form method="post" action="&lt;?php echo $this-&gt;baseUrl ?&gt;/livre/admin" name="form_nom"&gt; 			&lt;div id="livre_haut"&gt; 				Login : &lt;input type="text" name="login"&gt; 				&lt;br /&gt; 				Password : &lt;input type="password" name="pass"&gt; 				&lt;br /&gt; 				&lt;button type="submit" name="admin"&gt;Poster&lt;/button&gt; 			&lt;/div&gt; 		&lt;/form&gt; 		&lt;br /&gt; 		&lt;br /&gt; 	&lt;/div&gt; &lt;?php echo $this-&gt;render('footer.phtml'); ?&gt;</pre>
<p>Comme on peux le remarquer pas besoin d&#8217;un fichier modifier.phtml car nous réutilisons ajouter.phtml via <q>$this-&gt;render(&#8216;ajouter&#8217;);</q>!</p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F64&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20cinqui%C3%A8me%20%C3%A9tapes%20%3A%20Modification%20et%20suppression%20des%20messages" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F64&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20cinqui%C3%A8me%20%C3%A9tapes%20%3A%20Modification%20et%20suppression%20des%20messages" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F64&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20cinqui%C3%A8me%20%C3%A9tapes%20%3A%20Modification%20et%20suppression%20des%20messages" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F64&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20cinqui%C3%A8me%20%C3%A9tapes%20%3A%20Modification%20et%20suppression%20des%20messages" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F64&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20cinqui%C3%A8me%20%C3%A9tapes%20%3A%20Modification%20et%20suppression%20des%20messages" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F64&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20cinqui%C3%A8me%20%C3%A9tapes%20%3A%20Modification%20et%20suppression%20des%20messages" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F64&amp;title=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20cinqui%C3%A8me%20%C3%A9tapes%20%3A%20Modification%20et%20suppression%20des%20messages" id="wpa2a_14"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/64/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework (ZF) : un livre d&#8217;or, quatrième étapes : Affichages et ajout de messages</title>
		<link>http://grummfy.be/blog/63#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/63#comments</comments>
		<pubDate>Mon, 06 Aug 2007 02:03:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[jouons]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[tutoriel]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=63</guid>
		<description><![CDATA[Créations d&#8217;un livre d&#8217;or en 6 étapes Définition Créations des tables sql et des répertoires Bases des fichiers Affichages et ajout de messages Modification et suppression des messages Conclusions Affichages et ajout de messages Maintenant, il nous faut modifier le contrôleur afin qu&#8217;il affiche le contenu des fichier index.phtml et ajout.phtml. &#60;?php /** Zend_Controller_Action */ [...]]]></description>
			<content:encoded><![CDATA[<h2>Créations d&#8217;un livre d&#8217;or en 6 étapes</h2>
<ol>
<li><a href="?p=58#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Définition</a></li>
<li><a href="?p=59#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Créations des tables sql et des répertoires</a></li>
<li><a href="?p=60#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Bases des fichiers</a></li>
<li><a href="?p=63#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Affichages et ajout de messages</a></li>
<li><a href="?p=64#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Modification et suppression des messages</a></li>
<li><a href="?p=65#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Conclusions</a></li>
</ol>
<h3>Affichages et ajout de messages</h3>
<p>Maintenant, il nous faut modifier le contrôleur afin qu&#8217;il affiche le contenu des fichier index.phtml et ajout.phtml.</p>
<pre> &lt;?php /** Zend_Controller_Action */ require_once 'Zend/Controller/Action.php'; class LivreController extends Zend_Controller_Action { 	public function indexAction() 	{ 		$livre = new livre(); 		$this-&gt;view-&gt;livres = $livre-&gt;fetchAll(); 	} 	public function ajouterAction() 	{ 		$this-&gt;view-&gt;title .= ' .: Ajout d\'un message'; 		if ($this-&gt;getRequest()-&gt;isPost()) 		{ 			Zend_Loader::loadClass('Zend_Filter_StripTags'); 			$filter = new Zend_Filter_StripTags(); 			$livre = $this-&gt;_getEmptyMsg(); 			$livre-&gt;id = null; 			$livre-&gt;nom = trim($filter-&gt;filter($this-&gt;getRequest()-&gt;getPost('nom'))); 			$livre-&gt;message = trim($filter-&gt;filter($this-&gt;getRequest()-&gt;getPost('message'))); 			if ($livre-&gt;nom != htmlspecialchars('Pseudo')) 			{ 				$livre_ = new Livre(); 				$livre_-&gt;insertObject($livre); 				$this-&gt;_redirect('/livre'); 				return; 			} 			else 			{ 				$this-&gt;view-&gt;message = 'Merci de donner votre pseudo!'; 			} 		} 		//création d'un message vide 		$this-&gt;view-&gt;livre = $this-&gt;_getEmptyMsg(); 	} 	function init() 	{ 		$this-&gt;view-&gt;title = 'Livre d\'or'; 		//url de base... 		$this-&gt;view-&gt;baseUrl = $this-&gt;_request-&gt;getBaseUrl(); 		$this-&gt;view-&gt;action = $this-&gt;getRequest()-&gt;getActionName(); 		//prêt à travailler sur les livres 		Zend_Loader::loadClass('Livre'); 		//ajout des aides de view 		$this-&gt;view-&gt;addHelperPath('./app/views/helpers', 'MyWsp_View_Helper'); 		$this-&gt;view-&gt;setEscape('utf8_encode'); 	} 	/** 	 * Créer un message vide 	 * 	 * @return Object 	 */ 	protected function _getEmptyMsg() 	{ 		//création d'un message vide 		$livre = new stdClass(); 		$livre	-&gt;id = -99; 		$livre	-&gt;nom = 'Pseudo'; 		$livre	-&gt;message = 'Entrez votre message'; 		$livre	-&gt;date = time(); 		return $livre; 	} }</pre>
<p>Passons en revue chaque méthode</p>
<h2>init()</h2>
<p>Cette permet l&#8217;initialisation des différent paramètre, elle est appelé dans le constructeur parent de la class. On en profite pour définir un titre de page (<q>$this-view-&gt;title</q>) et divers autres paramètres. On défini aussi un répertoire supplémentaire pour les helper de view (<q>$this-&gt;view-&gt;addHelperPath(&#8216;./app/views/helpers&#8217;, &#8216;MyWsp_View_Helper&#8217;);</q>).</p>
<h2>ajouterAction()</h2>
<p>Appeler lorsque on est à l&#8217;url /livre/ajouter, tout comme les autres méthode du type actionnNameAction() la partie actionName est prise depuis l&#8217;url! On récupère les différent paramètre si on a effectué un post ou on affiche simplement le contenu de ajouter.phtml (ceci se faisant automatiquement).</p>
<h2>indexAction()</h2>
<p>On récupère les informations dans la base de données, et on stocke les données dans le viewer.</p>
<p>Ajoutons quelques fichiers afin de rendre le tout plus intéressant et avoir un vrai jeu de templates/gabarit! <strong>header.phtml</strong></p>
<pre> &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr-be" lang="fr-be"&gt; &lt;head&gt; 	&lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8" /&gt; 	&lt;title&gt;&lt;?php echo $this-&gt;escape($this-&gt;title); ?&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="content"&gt; &lt;h1&gt;&lt;?php echo $this-&gt;escape($this-&gt;title); ?&gt;&lt;/h1&gt;</pre>
<p>le haut de la page html</p>
<p><strong>footer.phtml</strong></p>
<pre> 	&lt;/div&gt; &lt;/body&gt; &lt;/html&gt;</pre>
<p>le bas de la page html</p>
<p><strong>index.phtml</strong></p>
<pre> &lt;?php echo $this-&gt;render('header.phtml'); ?&gt; 	&lt;div id="livre"&gt; 		&lt;p&gt;&lt;a href="&lt;?php echo $this-&gt;baseUrl; ?&gt;/livre/ajouter"&gt;Ajouter un message&lt;/a&gt;&lt;/p&gt; 		&lt;div id="livre_message"&gt; 		&lt;?php foreach($this-&gt;livres as $livre) : ?&gt; 			&lt;div class="livre_block_message"&gt; 				&lt;span class="livre_pseudo"&gt;&lt;?php echo $this-&gt;escape($livre-&gt;nom); ?&gt;&lt;/span&gt; | 				&lt;span class="livre_date"&gt;Le &lt;?php echo $this-&gt;date('DDDD DD MMMM YYYY', $this-&gt;escape($livre-&gt;date)); ?&gt;&lt;/span&gt; 				&lt;br /&gt; 				&lt;span class="livre_message"&gt;&lt;?php echo nl2br($this-&gt;escape($livre-&gt;message)); ?&gt;&lt;/span&gt; 				&lt;?php 				if ($this-&gt;connecter) 					echo '&lt;br /&gt;&lt;a href="' , $this-&gt;baseUrl , '/livre/modifier/id/' , $livre-&gt;id , '"&gt;Modifier&lt;/a&gt; 					&lt;a href="' , $this-&gt;baseUrl , '/livre/supprimer/id/' , $livre-&gt;id , '"&gt;Supprimer&lt;/a&gt;'; 				?&gt; 			&lt;/div&gt; 		&lt;?php endforeach; ?&gt; 		&lt;/div&gt; 	&lt;/div&gt; &lt;?php echo $this-&gt;render('footer.phtml'); ?&gt;</pre>
<p>La liste des messages du forum, on oublie pas d&#8217;inclure le haut et le bas de page (via <q>$this-&gt;render();</q>)</p>
<p>On voix ici l&#8217;utilisation du helper Date afin d&#8217;afficher la date au format choisi.</p>
<p><strong>ajouter.phtml</strong></p>
<pre> &lt;?php echo $this-&gt;render('header.phtml'); ?&gt; 	&lt;div id="livre"&gt; 	&lt;strong&gt;&lt;?php echo $this-&gt;message; ?&gt;&lt;/strong&gt; 	&lt;?php echo $this-&gt;render('livre/_form.phtml'); ?&gt; 	&lt;/div&gt; &lt;?php echo $this-&gt;render('footer.phtml'); ?&gt;</pre>
<p>La page d&#8217;ajout des messages.</p>
<p><strong>_form.phtml</strong></p>
<pre> &lt;form method="post" action="&lt;?php echo $this-&gt;baseUrl ?&gt;/livre/&lt;?php echo $this-&gt;action; ?&gt;" name="form_nom"&gt; 	&lt;div id="livre_haut"&gt; 		&lt;input type="text" name="nom" value="&lt;?php echo $this-&gt;escape(trim($this-&gt;livre-&gt;nom)); ?&gt;"&gt; 		&amp;nbsp;&amp;bull;&amp;nbsp; 		&lt;input type="text" name="site" value="&lt;?php echo $this-&gt;escape($this-&gt;livre-&gt;site);?&gt;"&gt; 		&lt;br /&gt; 		&lt;textarea name="message" cols="50" rows="5"&gt;&lt;?php echo $this-&gt;escape($this-&gt;livre-&gt;message); ?&gt;&lt;/textarea&gt; 		&lt;br /&gt; 		&lt;button type="submit" name="add"&gt;Poster&lt;/button&gt; 	&lt;/div&gt; &lt;/form&gt; &lt;br /&gt; &lt;br /&gt;</pre>
<p>Le formulaire d&#8217;ajout et de modification (noté le <q>_</q> devant le nom permettant d&#8217;avoir un <q>template/gabarit privé</q>.</p>
<p>En principe vous êtes maitenant capable d&#8217;ajouter des messages et de les afficher!</p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F63&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20quatri%C3%A8me%20%C3%A9tapes%20%3A%20Affichages%20et%20ajout%20de%20messages" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F63&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20quatri%C3%A8me%20%C3%A9tapes%20%3A%20Affichages%20et%20ajout%20de%20messages" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F63&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20quatri%C3%A8me%20%C3%A9tapes%20%3A%20Affichages%20et%20ajout%20de%20messages" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F63&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20quatri%C3%A8me%20%C3%A9tapes%20%3A%20Affichages%20et%20ajout%20de%20messages" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F63&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20quatri%C3%A8me%20%C3%A9tapes%20%3A%20Affichages%20et%20ajout%20de%20messages" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F63&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20quatri%C3%A8me%20%C3%A9tapes%20%3A%20Affichages%20et%20ajout%20de%20messages" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F63&amp;title=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20quatri%C3%A8me%20%C3%A9tapes%20%3A%20Affichages%20et%20ajout%20de%20messages" id="wpa2a_16"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/63/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework (ZF) : Geshi comme filtre dans ZF</title>
		<link>http://grummfy.be/blog/62#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/62#comments</comments>
		<pubDate>Sat, 04 Aug 2007 00:27:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[trucs et astuces]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=62</guid>
		<description><![CDATA[Grâce à la libraire Geshi (http://qbnz.com/highlighter/) et à l&#8217;ingéniosité de ZF, colorer tout vos code, facilement, via ce nouveau filtre. Pour l&#8217;utiliser, Télécharger la libraire geshi et décompresser là (dans l&#8217;exemple dans ./../site/lib/geshi/, donc le fichier geshi.php se trouve dans se répertoire et ./../site/lib/geshi/geshi/ contient les fichiers de langues) &#60;?php Zend_Loader::loadClass&#40;'Zend_Filter_Geshi'&#41;; $zfg = new Zend_Filter_Geshi&#40;'php', [...]]]></description>
			<content:encoded><![CDATA[<p>Grâce à la libraire Geshi (<a href="http://qbnz.com/highlighter/" title="http://qbnz.com/highlighter/">http://qbnz.com/highlighter/</a>) et à l&#8217;ingéniosité de ZF, colorer tout vos code, facilement, via ce nouveau filtre.</p>
<p>Pour l&#8217;utiliser, Télécharger la libraire geshi et décompresser là (dans l&#8217;exemple dans ./../site/lib/geshi/, donc le fichier geshi.php se trouve dans se répertoire et ./../site/lib/geshi/geshi/ contient les fichiers de langues)</p>
<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span> Zend_Loader::<span style="color: #006600;">loadClass</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Zend_Filter_Geshi'</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #0000ff;">$zfg</span> = <span style="color: #000000; font-weight: bold;">new</span> Zend_Filter_Geshi<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'php'</span>, <span style="color: #ff0000;">'../site/lib/geshi/'</span><span style="color: #66cc66;">&#41;</span>; <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$zfg</span>-&gt;<span style="color: #006600;">filter</span><span style="color: #66cc66;">&#40;</span>&lt;&lt;&lt;ABC <span style="color: #000000; font-weight: bold;">&lt;?php</span> Zend_Loader::<span style="color: #006600;">loadClass</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Zend_Filter_Geshi'</span><span style="color: #66cc66;">&#41;</span>; \<span style="color: #0000ff;">$zfg</span> = <span style="color: #000000; font-weight: bold;">new</span> Zend_Filter_Geshi<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'php'</span>, <span style="color: #ff0000;">'../site/lib/geshi/'</span><span style="color: #66cc66;">&#41;</span>; ABC <span style="color: #66cc66;">&#41;</span>;</pre>
<p>Autre endroit ou trouver ce code&nbsp;: <a href="http://www.z-f.fr/code/detail/17" title="http://www.z-f.fr/code/detail/17">http://www.z-f.fr/code/detail/17</a></p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F62&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20Geshi%20comme%20filtre%20dans%20ZF" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F62&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20Geshi%20comme%20filtre%20dans%20ZF" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F62&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20Geshi%20comme%20filtre%20dans%20ZF" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F62&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20Geshi%20comme%20filtre%20dans%20ZF" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F62&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20Geshi%20comme%20filtre%20dans%20ZF" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F62&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20Geshi%20comme%20filtre%20dans%20ZF" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F62&amp;title=Zend%20Framework%20%28ZF%29%20%3A%20Geshi%20comme%20filtre%20dans%20ZF" id="wpa2a_18"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/62/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework (ZF) : un livre d&#8217;or, troisième étapes : Bases des fichiers</title>
		<link>http://grummfy.be/blog/60#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/60#comments</comments>
		<pubDate>Fri, 03 Aug 2007 00:30:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[jouons]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[tutoriel]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=60</guid>
		<description><![CDATA[Créations d&#8217;un livre d&#8217;or en 6 étapes Définition Créations des tables sql et des répertoires Bases des fichiers Affichages et ajout de messages Modification et suppression des messages Conclusions Bases des fichiers Avant tout, il nous faut créer les différents fichier .htaccess RewriteEngine on #RewriteBase /serveur/mon_repertoire/ RewriteRule .* index.php php_flag magic_quotes_gpc off php_flag register_globals off [...]]]></description>
			<content:encoded><![CDATA[<h2>Créations d&#8217;un livre d&#8217;or en 6 étapes</h2>
<ol>
<li><a href="?p=58#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Définition</a></li>
<li><a href="?p=59#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Créations des tables sql et des répertoires</a></li>
<li><a href="?p=60#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Bases des fichiers</a></li>
<li><a href="?p=63#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Affichages et ajout de messages</a></li>
<li><a href="?p=64#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Modification et suppression des messages</a></li>
<li><a href="?p=65#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Conclusions</a></li>
</ol>
<h3>Bases des fichiers</h3>
<p>Avant tout, il nous faut créer les différents fichier <strong>.htaccess</strong></p>
<pre> RewriteEngine on #RewriteBase /serveur/mon_repertoire/ RewriteRule .* index.php php_flag magic_quotes_gpc off php_flag register_globals off</pre>
<p>La ligne en commentaire, permet dans le cas d&#8217;une erreur de ce type : <q>Fatal error: Uncaught exception &#8216;Zend_Controller_Dispatcher_Exception&#8217; with message &#8216;Invalid controller specified (serveur)&#8217; in</q> de corriger le problème, pour un accès, par exemple, via : http://localhost/serveur/mon_repertoire/</p>
<p><strong>LivreControllers.php</strong></p>
<pre> &lt;?php /** Zend_Controller_Action */ require_once 'Zend/Controller/Action.php'; class LivreController extends Zend_Controller_Action { 	public function indexAction() 	{ 		echo 'Index du livre d\'or'; 		return; 	} 	public function ajouterAction() 	{ 		$this-&gt;view-&gt;title .= ' .: Ajout d\'un message'; 		echo 'ajout d\'un message!'; 		return; 	} }</pre>
<p>Le controlleur, c&#8217;est ce qui va diriger notre application</p>
<p><strong>index.php</strong></p>
<pre> &lt;?php error_reporting(E_ALL|E_STRICT); date_default_timezone_set('Europe/Brussels'); set_include_path('.' . PATH_SEPARATOR . '../site/lib' . PATH_SEPARATOR . './app/models/'  . PATH_SEPARATOR . get_include_path()); include 'Zend/Loader.php'; Zend_Loader::loadClass('Zend_Controller_Front'); Zend_Loader::loadClass('Zend_Config_Ini'); Zend_Loader::loadClass('Zend_Registry'); Zend_Loader::loadClass('Zend_Db'); // load configuration $config = new Zend_Config_Ini('./app/config.ini', 'general'); $registry = Zend_Registry::getInstance(); $registry-&gt;set('config', $config); // setup database $db = Zend_Db::factory($config-&gt;db-&gt;adapter,  $config-&gt;db-&gt;config-&gt;toArray()); Zend_Db_Table::setDefaultAdapter($db); // Régler le dossier des contrôleurs par défaut : $frontController = Zend_Controller_Front::getInstance(); $frontController-&gt;throwExceptions(true); $frontController-&gt;setControllerDirectory('./app/controllers'); // run! $frontController-&gt;dispatch();</pre>
<p><strong>Livre.php</strong></p>
<pre> &lt;?php Zend_Loader::loadClass('Zend_Db_Table'); class Livre extends Zend_Db_Table {     protected $_name = 'livre';     protected $_primary = 'id'; 	public function insertObject($object) 	{ 		return parent::insert((array) $object); 	} 	public function updateObject($object, $where) 	{ 		return $this-&gt;update((array) $object, $where); 	} }</pre>
<p>Le modèle du livre, c&#8217;est-à-dire les données -&gt; ici la base des données.</p>
<p><strong>Date.php</strong></p>
<pre> &lt;?php class MyWsp_View_Helper_Date { 	/** 	 * Retourne une date sous forme d'une chaîne, au format donné par le 	 * paramètre format, fournie par le paramètre timestamp ou la date et 	 * l'heure courantes si aucun timestamp n'est fourni. En d'autres termes, 	 * le paramètre timestamp est optionnel et vaut par défaut la valeur de la 	 * fonction time(). 	 * Plus d'info sur http://www.php.net/manual/fr/function.date.php 	 * 	 * @param string $format format de la date 	 * @param int $timestampdate à formaté 	 * 	 * @return string 	 */ 	public function date($format, $timestamp = null) 	{ 		if (!is_nan($timestamp)) 			$timestamp = time(); 		// see http://www.php.net/manual/fr/function.strftime.php 		$dates = array( 			'DDDD'	=&gt; '%A', 			'DDD'	=&gt; '%a', 			'DD'	=&gt; '%d', 			'D'		=&gt; '%e', 			'MMMM'	=&gt; '%B', 			'MMM'	=&gt; '%b', 			'MM'	=&gt; '%m', 			'YYYY'	=&gt; '%Y', 			'YY'	=&gt; '%y', 			'HH'	=&gt; '%H', 			'hh'	=&gt; '%I', 			'mm'	=&gt; '%M', 			'ss'	=&gt; '%S', 		); 		return strftime(str_replace(array_keys($dates), array_values($dates), $format), $timestamp); 	} }</pre>
<p><strong>config.ini</strong></p>
<pre> [general] db.adapter = PDO_MYSQL db.config.host = localhost db.config.username = root db.config.password = db.config.dbname = livredor</pre>
<p>Contient la configuration pour accéder à la base de donnée du livre d&#8217;or.</p>
<h4>Test</h4>
<p>Rendez-vous à l&#8217;adresse de votre script :</p>
<ul>
<li>Lire les messages : http://localhost/serveur/mon_repertoire/livre/</li>
<li>Ajouter un message : http://localhost/serveur/mon_repertoire/livre/ajouter/</li>
</ul>
<p>Si tout est ok, passons à la suite!</p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F60&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20troisi%C3%A8me%20%C3%A9tapes%20%3A%20Bases%20des%20fichiers" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F60&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20troisi%C3%A8me%20%C3%A9tapes%20%3A%20Bases%20des%20fichiers" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F60&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20troisi%C3%A8me%20%C3%A9tapes%20%3A%20Bases%20des%20fichiers" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F60&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20troisi%C3%A8me%20%C3%A9tapes%20%3A%20Bases%20des%20fichiers" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F60&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20troisi%C3%A8me%20%C3%A9tapes%20%3A%20Bases%20des%20fichiers" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F60&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20troisi%C3%A8me%20%C3%A9tapes%20%3A%20Bases%20des%20fichiers" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F60&amp;title=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20troisi%C3%A8me%20%C3%A9tapes%20%3A%20Bases%20des%20fichiers" id="wpa2a_20"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/60/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Zend Framework (ZF) : un livre d&#8217;or, deuxième étapes : Créations des tables sql et répertoires</title>
		<link>http://grummfy.be/blog/59#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/59#comments</comments>
		<pubDate>Thu, 02 Aug 2007 03:02:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[jouons]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[tutoriel]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=59</guid>
		<description><![CDATA[Créations d&#8217;un livre d&#8217;or en 6 étapes Définition Créations des tables sql et des répertoires Bases des fichiers Affichages et ajout de messages Modification et suppression des messages Conclusions Créations des tables sql Créer une nouvelle base de donnée dans votre serveur mysql. Ensuite exécuter la requête suivante : CREATE TABLE `livre` ( `id` int(10) unsigned [...]]]></description>
			<content:encoded><![CDATA[<h2>Créations d&#8217;un livre d&#8217;or en 6 étapes</h2>
<ol>
<li><a href="?p=58#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Définition</a></li>
<li><a href="?p=59#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Créations des tables sql et des répertoires</a></li>
<li><a href="?p=60#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Bases des fichiers</a></li>
<li><a href="?p=63#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Affichages et ajout de messages</a></li>
<li><a href="?p=64#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Modification et suppression des messages</a></li>
<li><a href="?p=65#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Conclusions</a></li>
</ol>
<h3>Créations des tables sql</h3>
<p>Créer une nouvelle base de donnée dans votre serveur mysql. Ensuite exécuter la requête suivante :</p>
<p>CREATE TABLE `livre` (</p>
<pre> `id` int(10) unsigned NOT NULL auto_increment,  `date` int(10) unsigned NOT NULL,  `message` text character set utf8 collate utf8_unicode_ci NOT NULL,  `nom` varchar(60) character set utf8 collate utf8_unicode_ci NOT NULL,  PRIMARY KEY  (`id`),  KEY `inde` (`date`)</pre>
<p>);</p>
<p>La structure de la table correspond donc a ceci :</p>
<table>
<thead>
<tr>
<th>Champ</th>
<th>Type</th>
<th>Défaut</th>
<th>Extra</th>
</tr>
</thead>
<tbody>
<tr>
<th>id</th>
<td>int(10)</td>
<td></td>
<td>auto_increment</td>
</tr>
<tr>
<th>date</th>
<td>int(10)</td>
<td></td>
<td></td>
</tr>
<tr>
<th>message</th>
<td>text</td>
<td></td>
<td></td>
</tr>
<tr>
<th>nom</th>
<td>varchar(60)</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Très simple et rien de compliquer jusque là, enfin normalement.</p>
<h3>Structure du script</h3>
<p>Les répertoires d&#8217;abords :</p>
<pre> /site     /lib         /Zend --&gt; ici le zend framework /test     /app         /controllers         /models         /views             /scripts                 /livre</pre>
<p>Et avec les fichiers :</p>
<pre> /app     /controllers         LivreControllers.php     /models        Livre.php     /views         /helpers         /scripts             header.phtml             footer.phtml             /livre                 livre.phtml                 ajouter.phtml     config.ini index.php .htaccess</pre>
<h5>Pourquoi une tel disposition?</h5>
<p>En fait, ZF va chercher de manière automatique grâce, notamment, au ViewHelper où se trouve les différent fichiers et les charger automatiquement! Zf utilisé le système <a href="http://fr.wikipedia.org/wiki/MVC">MVC</a>, c&#8217;est-à-dire modèle-vue-contrôleur!</p>
<ul>
<li>Contrôleur : Lien entre la vue et le modèle, réagit au requête de l&#8217;utilisateurs, etc</li>
<li>Vue : ce que voix l&#8217;utilisateur, souvent le système de templates, donc c&#8217;est la présentation des données!</li>
<li>Modèle : accès aux données, en gros accès à la base des données, au fichiers, etc</li>
</ul>
<p>Cependant divers dossiers peuvent se trouver à d&#8217;autres emplacement, mais ici on fait dans le simple!</p>
<p>Pensez à utiliser <a href="/blog/index.php?post/2007/08/01/Creation-de-repertoire-automatique-en-php-via-une-structure-txt#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">mon script</a> pour avoir plus facile &#8230;</p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F59&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20deuxi%C3%A8me%20%C3%A9tapes%20%3A%20Cr%C3%A9ations%20des%20tables%20sql%20et%20r%C3%A9pertoires" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F59&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20deuxi%C3%A8me%20%C3%A9tapes%20%3A%20Cr%C3%A9ations%20des%20tables%20sql%20et%20r%C3%A9pertoires" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F59&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20deuxi%C3%A8me%20%C3%A9tapes%20%3A%20Cr%C3%A9ations%20des%20tables%20sql%20et%20r%C3%A9pertoires" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F59&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20deuxi%C3%A8me%20%C3%A9tapes%20%3A%20Cr%C3%A9ations%20des%20tables%20sql%20et%20r%C3%A9pertoires" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F59&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20deuxi%C3%A8me%20%C3%A9tapes%20%3A%20Cr%C3%A9ations%20des%20tables%20sql%20et%20r%C3%A9pertoires" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F59&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20deuxi%C3%A8me%20%C3%A9tapes%20%3A%20Cr%C3%A9ations%20des%20tables%20sql%20et%20r%C3%A9pertoires" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F59&amp;title=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20deuxi%C3%A8me%20%C3%A9tapes%20%3A%20Cr%C3%A9ations%20des%20tables%20sql%20et%20r%C3%A9pertoires" id="wpa2a_22"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/59/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework (ZF) : un livre d&#8217;or, première étapes : définition</title>
		<link>http://grummfy.be/blog/58#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/58#comments</comments>
		<pubDate>Thu, 02 Aug 2007 02:52:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[jouons]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[tutoriel]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=58</guid>
		<description><![CDATA[Créations d&#8217;un livre d&#8217;or en 6 étapes Définition Créations des tables sql et des répertoires Bases des fichiers Affichages et ajout de messages Modification et suppression des messages Conclusions Définition des besoins Pour faire un livre d&#8217;or très basique : Ajout de message Affichage de messages Modération : modification et suppression des messages Par après on peux [...]]]></description>
			<content:encoded><![CDATA[<h2>Créations d&#8217;un livre d&#8217;or en 6 étapes</h2>
<ol>
<li><a href="?p=58#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Définition</a></li>
<li><a href="?p=59#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Créations des tables sql et des répertoires</a></li>
<li><a href="?p=60#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Bases des fichiers</a></li>
<li><a href="?p=63#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Affichages et ajout de messages</a></li>
<li><a href="?p=64#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Modification et suppression des messages</a></li>
<li><a href="?p=65#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Conclusions</a></li>
</ol>
<h3>Définition des besoins</h3>
<p>Pour faire un livre d&#8217;or très basique :</p>
<ul>
<li>Ajout de message</li>
<li>Affichage de messages</li>
<li>Modération : modification et suppression des messages</li>
</ul>
<p>Par après on peux ajouter différents éléments :</p>
<ul>
<li>Smileys</li>
<li>Site-web et email des auteurs</li>
<li>Et des trucs plus fun : cache, css, &#8230;</li>
</ul>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F58&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20premi%C3%A8re%20%C3%A9tapes%20%3A%20d%C3%A9finition" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F58&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20premi%C3%A8re%20%C3%A9tapes%20%3A%20d%C3%A9finition" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F58&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20premi%C3%A8re%20%C3%A9tapes%20%3A%20d%C3%A9finition" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F58&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20premi%C3%A8re%20%C3%A9tapes%20%3A%20d%C3%A9finition" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F58&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20premi%C3%A8re%20%C3%A9tapes%20%3A%20d%C3%A9finition" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F58&amp;linkname=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20premi%C3%A8re%20%C3%A9tapes%20%3A%20d%C3%A9finition" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F58&amp;title=Zend%20Framework%20%28ZF%29%20%3A%20un%20livre%20d%26%238217%3Bor%2C%20premi%C3%A8re%20%C3%A9tapes%20%3A%20d%C3%A9finition" id="wpa2a_24"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/58/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Création de répertoire automatique, en php, via une structure txt</title>
		<link>http://grummfy.be/blog/57#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/57#comments</comments>
		<pubDate>Wed, 01 Aug 2007 20:02:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[trucs et astuces]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=57</guid>
		<description><![CDATA[Nombres de tutoriaux de programmation pr&#233;sente la structure des diff&#233;rents r&#233;pertoires sous la forme d&#8217;unt exte de cette forme : /home /admin /index /ajouter /delete /news /id /totor C&#8217;est souvent assez embettant de recr&#233;er chaque r&#233;pertoire alors qu&#8217;un simple script suffit &#8230;. Voici ce script &#60;?php &#160; $tab = ' '; &#160; $shema = &#60;&#60;&#60;UYJY [...]]]></description>
			<content:encoded><![CDATA[<p>Nombres de tutoriaux de programmation pr&eacute;sente la structure des diff&eacute;rents r&eacute;pertoires sous la forme d&#8217;unt exte de cette forme : /home /admin /index     /ajouter     /delete     /news         /id /totor</p>
<p>C&#8217;est souvent assez embettant de recr&eacute;er chaque r&eacute;pertoire alors qu&#8217;un simple script suffit &#8230;.</p>
<p>Voici ce script</p>
<pre class="code php"><span style="color: #000000; font-weight: bold;">&lt;?php</span> &nbsp; <span style="color: #0000ff;">$tab</span> = <span style="color: #ff0000;">'    '</span>; &nbsp; <span style="color: #0000ff;">$shema</span> = &lt;&lt;&lt;UYJY <span style="color: #ff0000">/home /admin /index     /ajouter     /delete     /news         /id     /totor</span> UYJY; &nbsp; <span style="color: #0000ff;">$shema</span> = <a href="http://www.php.net/str_replace"><span style="color: #000066;">str_replace</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">
</span><span style="color: #000099; font-weight: bold;"> </span>&quot;</span>, <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;"> </span>&quot;</span>, <span style="color: #0000ff;">$shema</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #0000ff;">$shemas</span> = <a href="http://www.php.net/explode"><span style="color: #000066;">explode</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;"> </span>&quot;</span>, <span style="color: #0000ff;">$shema</span><span style="color: #66cc66;">&#41;</span>; &nbsp; <span style="color: #0000ff;">$curdir</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #0000ff;">$curdir</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span> = <a href="http://www.php.net/dirname"><span style="color: #000066;">dirname</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">__FILE__</span><span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">'/rep'</span>; <a href="http://www.php.net/mkdir"><span style="color: #000066;">mkdir</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$curdir</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #cc66cc;">0777</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #0000ff;">$lastNiv</span> = <span style="color: #cc66cc;">0</span>; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$shemas</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$line</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> 	<span style="color: #808080; font-style: italic;">//profondeur du rep</span> 	<span style="color: #0000ff;">$Niv</span> = <a href="http://www.php.net/substr_count"><span style="color: #000066;">substr_count</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$line</span>, <span style="color: #0000ff;">$tab</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #cc66cc;">1</span>; &nbsp; 	<span style="color: #808080; font-style: italic;">//nom rep</span> 	<span style="color: #0000ff;">$rep</span> = <a href="http://www.php.net/substr"><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$line</span>, <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$Niv</span><span style="color: #cc66cc;">-1</span><span style="color: #66cc66;">&#41;</span> * <a href="http://www.php.net/strlen"><span style="color: #000066;">strlen</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$tab</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>; &nbsp; 	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$Niv</span> &lt; <span style="color: #0000ff;">$lastNiv</span><span style="color: #66cc66;">&#41;</span> 	<span style="color: #66cc66;">&#123;</span> 		<span style="color: #808080; font-style: italic;">//répertoire supérieur</span> 		<span style="color: #808080; font-style: italic;">//delete des chemin inférieur</span> 		<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$i</span> = <span style="color: #0000ff;">$Niv</span> + <span style="color: #cc66cc;">1</span>; <span style="color: #0000ff;">$i</span> &lt;= <a href="http://www.php.net/count"><span style="color: #000066;">count</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$curdir</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #0000ff;">$i</span>++<span style="color: #66cc66;">&#41;</span> 		<span style="color: #66cc66;">&#123;</span> 			<a href="http://www.php.net/unset"><span style="color: #000066;">unset</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$curdir</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>; 		<span style="color: #66cc66;">&#125;</span> 	<span style="color: #66cc66;">&#125;</span> &nbsp; 	<span style="color: #808080; font-style: italic;">//save du niveau + chemin</span> 	<span style="color: #0000ff;">$lastNiv</span> = <span style="color: #0000ff;">$Niv</span>; 	<span style="color: #0000ff;">$curdir</span><span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$Niv</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #0000ff;">$curdir</span><span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$Niv</span> - <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> . <span style="color: #0000ff;">$rep</span>; &nbsp; 	<span style="color: #808080; font-style: italic;">//création rep</span> 	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/mkdir"><span style="color: #000066;">mkdir</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$curdir</span><span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$Niv</span> <span style="color: #66cc66;">&#93;</span>, <span style="color: #cc66cc;">0777</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> 		<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">'Répertoire ('</span> . <span style="color: #0000ff;">$curdir</span><span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$Niv</span> <span style="color: #66cc66;">&#93;</span> . <span style="color: #ff0000;">') créé!&lt;br /&gt;'</span> . <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;"> </span>&quot;</span>; 	<span style="color: #b1b100;">else</span> 		<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">'Répertoire ('</span> . <span style="color: #0000ff;">$curdir</span><span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$Niv</span> <span style="color: #66cc66;">&#93;</span> . <span style="color: #ff0000;">') &lt;strong&gt;n<span style="color: #000099; font-weight: bold;">\'</span>a pas&lt;/strong&gt; être créé!&lt;br /&gt;'</span> . <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;"> </span>&quot;</span>; <span style="color: #66cc66;">&#125;</span></pre>
<ul>
<li><q>$curdir[0]</q> : Le r&eacute;pertoire de base o&ugrave; sont cr&eacute;er les r&eacute;pertoires,</li>
<li><q>$shema</q> : Le sch&eacute;ma &agrave; suivre pour cr&eacute;er les r&eacute;pertoires.</li>
<li><q>$tab</q> : L&#8217;espace pour un r&eacute;pertoire (tabulation, 4 espaces, &#8230; (doit-&ecirc;tre r&eacute;gulier!)</li>
</ul>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F57&amp;linkname=Cr%C3%A9ation%20de%20r%C3%A9pertoire%20automatique%2C%20en%20php%2C%20via%20une%20structure%20txt" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F57&amp;linkname=Cr%C3%A9ation%20de%20r%C3%A9pertoire%20automatique%2C%20en%20php%2C%20via%20une%20structure%20txt" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F57&amp;linkname=Cr%C3%A9ation%20de%20r%C3%A9pertoire%20automatique%2C%20en%20php%2C%20via%20une%20structure%20txt" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F57&amp;linkname=Cr%C3%A9ation%20de%20r%C3%A9pertoire%20automatique%2C%20en%20php%2C%20via%20une%20structure%20txt" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F57&amp;linkname=Cr%C3%A9ation%20de%20r%C3%A9pertoire%20automatique%2C%20en%20php%2C%20via%20une%20structure%20txt" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F57&amp;linkname=Cr%C3%A9ation%20de%20r%C3%A9pertoire%20automatique%2C%20en%20php%2C%20via%20une%20structure%20txt" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F57&amp;title=Cr%C3%A9ation%20de%20r%C3%A9pertoire%20automatique%2C%20en%20php%2C%20via%20une%20structure%20txt" id="wpa2a_26"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/57/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MyWsp : du nouveau?</title>
		<link>http://grummfy.be/blog/53#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/53#comments</comments>
		<pubDate>Sun, 29 Jul 2007 00:05:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Projet]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[MyWsp]]></category>
		<category><![CDATA[PEAR]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[postgreql]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=53</guid>
		<description><![CDATA[Comme certains m&#8217;ont posée la question, j&#8217;y réponds. Oui MyWsp avance, lentement mais surement. La dernière nouveauté visible est le logo (temporaire à définitif), visible sur le site officiel et logo2 . Cependant ce n&#8217;est aps tout, j&#8217;ai définit presque entièrement ce que j&#8217;appelle le package de base, c&#8217;est-à-dire, un truc que l&#8217;on ne sais [...]]]></description>
			<content:encoded><![CDATA[<p>Comme certains m&#8217;ont posée la question, j&#8217;y réponds.</p>
<p>Oui <a href="/blog/index.php?tag/MyWsp#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">MyWsp</a> avance, lentement mais surement.</p>
<p>La dernière nouveauté visible est le logo (temporaire à définitif), visible sur le <a href="http://www.mywsp.net/">site officiel</a> et logo2 .</p>
<p>Cependant ce n&#8217;est aps tout, j&#8217;ai définit presque entièrement ce que j&#8217;appelle le package de base, c&#8217;est-à-dire, un truc que l&#8217;on ne sais pas utilisé tout seul, mais indispensable au fonctionnement de tout le reste! En gros le package de base comprendra&nbsp;:</p>
<ul>
<li>RSS</li>
<li>outils de sécurités tel&nbsp;: antispam, antiflood, &#8230;</li>
<li>système de session basic</li>
<li>mail simple</li>
<li>système de cache</li>
<li>gestion de base de données</li>
<li>bbcode, html et autre système d&#8217;écriture (avec possibilité de plugins pour oa7code, textile, wiki, wikini, wiki+, &#8230;)</li>
<li>peut-être un système de tpl mais je verrais à la longue!</li>
<li>système d&#8217;erreur très simple donc sans log</li>
<li>upload simple</li>
<li>quelques surfonction, genre date avec strftime, et d&#8217;autres truc utiles &#8230;</li>
<li>système de gestion des modules</li>
<li>Administration</li>
</ul>
<p>Avec cela les modules principaux verront rapidement le jour. Cependant, le gros point noir reste la gestion des modules (qui n&#8217;est pas programmer du tout, le reste est surtout une question de retouche). En effet, j&#8217;ignore encore comment je vais faire fonctionner le tout de manière optimale, que se soit pour un ou 250 modules&#8230;</p>
<p>Pour les questions, les idées n&#8217;hésité pas à répondre en commentaires ou à me contacter!</p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F53&amp;linkname=MyWsp%20%3A%20du%20nouveau%3F" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F53&amp;linkname=MyWsp%20%3A%20du%20nouveau%3F" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F53&amp;linkname=MyWsp%20%3A%20du%20nouveau%3F" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F53&amp;linkname=MyWsp%20%3A%20du%20nouveau%3F" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F53&amp;linkname=MyWsp%20%3A%20du%20nouveau%3F" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F53&amp;linkname=MyWsp%20%3A%20du%20nouveau%3F" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F53&amp;title=MyWsp%20%3A%20du%20nouveau%3F" id="wpa2a_28"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/53/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Je test, tu tests, ils bugent</title>
		<link>http://grummfy.be/blog/51#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/51#comments</comments>
		<pubDate>Mon, 16 Jul 2007 00:59:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Grummfy grrrrumf, ou comment raller]]></category>
		<category><![CDATA[découverte]]></category>
		<category><![CDATA[étrange]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=51</guid>
		<description><![CDATA[En ce moment, je test un compte sur un serveur Microsoft, avec IIS comme serveur HTTP. Au première abord je me dit, chouette, vais pouvoir voire ce que ASP à dans le ventre, le comparer avec PHP Bon après quelques test, le regret énorme des fichiers htaccess, uniquement présent sur Apache, l&#8217;absence d&#8217;url rewriting, le [...]]]></description>
			<content:encoded><![CDATA[<p>En ce moment,</p>
<p>je test un compte sur un serveur Microsoft, avec <a href="http://fr.wikipedia.org/wiki/Internet_Information_Services" hreflang="fr">IIS</a> comme <a href="http://fr.wikipedia.org/wiki/Serveur_HTTP" hreflang="fr">serveur HTTP</a>.</p>
<p>Au première abord je me dit, chouette, vais pouvoir voire ce que <a href="http://fr.wikipedia.org/wiki/Active_server_pages" hreflang="fr">ASP</a> à dans le ventre, le comparer avec <a href="http://fr.wikipedia.org/wiki/PHP" hreflang="fr">PHP</a></p>
<p>Bon après quelques test, le regret énorme des fichiers <a href="http://fr.wikipedia.org/wiki/.htaccess">htaccess</a>, uniquement présent sur <a href="http://fr.wikipedia.org/wiki/Apache_HTTP_Server" hreflang="fr">Apache</a>, l&#8217;absence d&#8217;url rewriting, le fait de devoir a chaque fois demander que l&#8217;on fasse un &laquo;&nbsp;deny from all&nbsp;&raquo; sur un dossier, etc &#8230;.</p>
<p>Je test&#8230;</p>
<p>Et je suis &#8230;</p>
<p>&#8230;</p>
<p>je suis&#8230;</p>
<pre>déçu!</pre>
<p>Trop de bug PHP à mon goût.</p>
<p>Certes ASP.net est intéressant mais bon &#8230; sans plus.</p>
<hr />
<p>Écrit le 13/07/2007, publié le 16/07/2007!</p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F51&amp;linkname=Je%20test%2C%20tu%20tests%2C%20ils%20bugent" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F51&amp;linkname=Je%20test%2C%20tu%20tests%2C%20ils%20bugent" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F51&amp;linkname=Je%20test%2C%20tu%20tests%2C%20ils%20bugent" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F51&amp;linkname=Je%20test%2C%20tu%20tests%2C%20ils%20bugent" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F51&amp;linkname=Je%20test%2C%20tu%20tests%2C%20ils%20bugent" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F51&amp;linkname=Je%20test%2C%20tu%20tests%2C%20ils%20bugent" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F51&amp;title=Je%20test%2C%20tu%20tests%2C%20ils%20bugent" id="wpa2a_30"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/51/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OVH sort un api très utiles &#8230;</title>
		<link>http://grummfy.be/blog/40#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/40#comments</comments>
		<pubDate>Sat, 16 Jun 2007 14:42:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Présentation]]></category>
		<category><![CDATA[actualité]]></category>
		<category><![CDATA[découverte]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sortie]]></category>
		<category><![CDATA[trucs et astuces]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=40</guid>
		<description><![CDATA[OVH (on vous héberge), un des hébergeurs de la sphère francophone les plus connu, vient de sortir un api très intéressant. Celui-ci se nome SOAPI et permet de profiter de la configuration et de l&#8217;achat des service de ovh. On peux aisément imaginer pour un revendeur l&#8217;utilité, mais aussi pour certaine personne cela peut-être utile. [...]]]></description>
			<content:encoded><![CDATA[<p>OVH (on vous héberge), un des hébergeurs de la sphère francophone les plus connu, vient de sortir un api très intéressant. Celui-ci se nome SOAPI et permet de profiter de la configuration et de l&#8217;achat des service de ovh.</p>
<p>On peux aisément imaginer pour un revendeur l&#8217;utilité, mais aussi pour certaine personne cela peut-être utile.</p>
<h3>Mais avant tout qu&#8217;est-ce que SOAPI exactement?</h3>
<blockquote><p>SOAPI est un service web qui vous permet d&#8217;acheter et de configurer vos produits OVH sans avoir a vous connectez à l&#8217;interface de gestion (Manager V3). Avec la technologie WSDL, vous utilisez les méthodes OVH à distance avec des petits bouts de code de quelques lignes seulement, dans votre langage de programmation favori.</p></blockquote>
<h3>Compatibilité :</h3>
<ul>
<li>PHP : PEAR SOAP, NuSOAP, PHP5 SOAP Extension</li>
<li>Perl : SOAP::WSDL (avec SOAP::Lite)</li>
<li>Python : SOAPpy</li>
<li>C#, dotNET framework 2.0</li>
</ul>
<h3>Utilisation</h3>
<p>En gros certaine partie génère un code source dans la technologie désirée.<br />
Exemple : <a href="http://www.ovh.com/soapi/fr/?method=domainCheck">Vérification d&#8217;un nom de domaine</a></p>
<p>On peux donc aisément générée des sous-domaine et des émail à la volée.</p>
<p>Mais le plus intéressant et que l&#8217;on peux créer son propre panneau de gestion&#8230; Voir son logiciel de gestion tel qu&#8217;il le propose : <a href="http://www.ovh.com/fr/espaceclients/outils/mom.xml">MOM</a></p>
<p>Qui sais ce que cela donnera&#8230;</p>
<p>En tout cas c&#8217;est à suivre avec attention!</p>
<p><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F40&amp;linkname=OVH%20sort%20un%20api%20tr%C3%A8s%20utiles%20%26%238230%3B" title="Delicious" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F40&amp;linkname=OVH%20sort%20un%20api%20tr%C3%A8s%20utiles%20%26%238230%3B" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F40&amp;linkname=OVH%20sort%20un%20api%20tr%C3%A8s%20utiles%20%26%238230%3B" title="Twitter" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F40&amp;linkname=OVH%20sort%20un%20api%20tr%C3%A8s%20utiles%20%26%238230%3B" title="Facebook" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F40&amp;linkname=OVH%20sort%20un%20api%20tr%C3%A8s%20utiles%20%26%238230%3B" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_netvibes_share" href="http://www.addtoany.com/add_to/netvibes_share?linkurl=http%3A%2F%2Fgrummfy.be%2Fblog%2F40&amp;linkname=OVH%20sort%20un%20api%20tr%C3%A8s%20utiles%20%26%238230%3B" title="Netvibes Share" rel="nofollow" target="_blank"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/icons/netvibes.png" width="16" height="16" alt="Netvibes Share"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fgrummfy.be%2Fblog%2F40&amp;title=OVH%20sort%20un%20api%20tr%C3%A8s%20utiles%20%26%238230%3B" id="wpa2a_32"><img src="http://grummfy.be/blog/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/40/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fire Soft Board RC4b Disponible!</title>
		<link>http://grummfy.be/blog/30#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/30#comments</comments>
		<pubDate>Wed, 23 May 2007 15:12:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[découverte]]></category>
		<category><![CDATA[forum]]></category>
		<category><![CDATA[Projet]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sortie]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=30</guid>
		<description><![CDATA[Bonjour,<br />
c'est avec joie que je vous annonce que la <a href="http://fr.wikipedia.org/wiki/Version_d%27un_logiciel#Release_candidate_.28RC.29_ou_pre-release" >Release Candidate</a> 4b de <accronym title="Fire Soft Board">FSB2</accronym> est sortie! ]]></description>
			<content:encoded><![CDATA[<p>Bonjour,<br />
c&#8217;est avec joie que je vous annonce que la <a href="http://fr.wikipedia.org/wiki/Version_d%27un_logiciel#Release_candidate_.28RC.29_ou_pre-release" >Release Candidate</a> 4b de <accronym title="Fire Soft Board">FSB2</accronym> est sortie!<br />
<span id="more-30"></span></p>
<h3>Mais tout d&#8217;abord qu&#8217;est ce que FSB?</h3>
<p>FSB ou  fire soft board, est avant tout un forum! Écrit en php multi-langue et multi-base de donnée!<br />
La version 2, qui continue en parallèle avec la version1, est assez complète. Fsb a tout pour être une usine à gaz, cependant cela n&#8217;en a pas le comportement.<br />
Le mieux est encore de vous laisser découvrir cette merveille.</p>
<h3>Changelog</h3>
<ul>
<li>Ajout de la possibilité de paramétrer les forums de façon à choisir la MAP que l&#8217;on veut lors des réponses</li>
<li>Ajout de la possibilité de désactiver le WYSIWYG sur l&#8217;ensemble du forum</li>
<li>Ajout de la possibilité de différencier les MAJ des MODS à lister dans l&#8217;administration des modules (balise &lt;isUpdate /&gt; dans le header)</li>
<li>Ajout d&#8217;une option de support automatique pour le forum</li>
<li>Corrections orthographiques</li>
<li>Fix de la classe Captcha, qui fonctionne désormais même si la librairie GD est désactivée</li>
<li>Fix des informations sur la MAP en cas de division de sujet</li>
<li>Fix d&#8217;un bug qui empéchait l&#8217;édition avancée des messages dans certaines configurations de droits</li>
<li>Fix d&#8217;un bug SQL sur le déplacement de sujet</li>
<li>Fix d&#8217;un bug sur l&#8217;insertion de smilies dans l&#8217;éditeur WYSIWYG</li>
<li>Fix d&#8217;un bug qui affichait le code HTML de certains FSBcode dans l&#8217;éditeur WYSIWYG</li>
<li>Fix de la configuration de la taille des avatars</li>
<li>Fix du chemin de l&#8217;image blanks.gif dans le fichier pngbehavior.htc</li>
<li>Fix de l&#8217;édition rapide en y mettant correctement les tabindex</li>
<li>Fix des droits sur la recherche</li>
<li>Fix de la restauration après installation de MODS dans l&#8217;administration</li>
</ul>
<h3>Plus d&#8217;info?</h3>
<p><strong><a href="http://www.fire-soft-board.com/fsb/sujet-6820-1.html" hreflang="fr">Voir l&#8217;annonce</a></strong><br />
<strong>Téléchargement</strong>&nbsp;:</p>
<ul>
<li><a href="http://www.fire-soft-board.com/index.php?p=download&amp;mode=release&amp;compress=tgz&amp;id=28">GZIP</a></li>
<li><a href="http://www.fire-soft-board.com/index.php?p=download&amp;mode=release&amp;compress=zip&amp;id=28">ZIP</a></li>
</ul>
<p><strong><a href="http://www.fire-soft-board.com/dl/update/maj_2.0.0.RC4a_to_2.0.0.RC4b/install.xml">Modification manuelle</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/30/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.610 seconds -->

