<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>zend &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/zend/</link>
	<description>Feed of posts on WordPress.com tagged "zend"</description>
	<pubDate>Sat, 30 Aug 2008 17:02:09 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[MySQLi Handler Class]]></title>
<link>http://mcloide.wordpress.com/?p=51</link>
<pubDate>Fri, 29 Aug 2008 19:12:53 +0000</pubDate>
<dc:creator>mcloide</dc:creator>
<guid>http://mcloide.wordpress.com/?p=51</guid>
<description><![CDATA[Last year I have created a mysqli class to wrap&#8217;s it&#8217;s most basic methods and encapsulat]]></description>
<content:encoded><![CDATA[<p><a href="http://www.switchplanet.com/"><img class="alignleft" style="border:0 none;margin-left:10px;margin-right:10px;" src="http://www.switchplanet.com/images/starburst.gif" alt="" width="114" height="118" /></a>Last year I have created a mysqli class to wrap's it's most basic methods and encapsulate the whole database layer providing a little bit more of security. I have always felt that were some items on that class that could be re-written and improved, so I have re-created the MySQLi Handler class.</p>
<p>It's a wrapper for the mysqli methods and query constructor with pagination. It make simplier to work with the daily sql statements in a fast wizard way.</p>
<p>It's not a Zend Framework Database Manager, but hey, if you cant use Zend Framewor or Pearl DbManager, it might help you.</p>
<p>As a note, for the next version it might have some AJAX methods attached for the pagination process.</p>
<p>Anyway the class is under GNU General Public License and you can <a href="http://www.dollartoolbox.com/down/mysqlihandler.zip">download it here</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Zend Exam Tips III]]></title>
<link>http://mcloide.wordpress.com/?p=43</link>
<pubDate>Wed, 27 Aug 2008 00:37:26 +0000</pubDate>
<dc:creator>mcloide</dc:creator>
<guid>http://mcloide.wordpress.com/?p=43</guid>
<description><![CDATA[I finally found a very smart question on this mock exams. Check this out:
What is the best approach ]]></description>
<content:encoded><![CDATA[<p><a href="http://thepuzzlestore.co.uk"><img class="alignleft" style="margin-left:5px;margin-right:5px;" src="http://thepuzzlestore.co.uk/store/images/Frustration%20Logo.jpg" alt="" width="261" height="261" /></a>I finally found a very smart question on this mock exams. Check this out:</p>
<p class="MsoNormal">What is the best approach for converting this string:</p>
<p class="ceresindent"><code><span style="font-size:10pt;">$string = "a=10&#38;b[]=20&#38;c=30&#38;d=40+50";</span></code></p>
<p class="ceresindent">Into this array?</p>
<pre>array(4) {
<span>  </span>["a"]=&#62;
<span>  </span>string(2) "10"
<span>  </span>["b"]=&#62;
<span>  </span>array(1) {
<span>    </span>[0]=&#62;
<span>    </span>string(2) "20"
<span>  </span>}
<span>  </span>["c"]=&#62;
<span>  </span>string(2) "30"
<span>  </span>["d"]=&#62;
<span>  </span>string(5) "40 50"
}</pre>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal">Answer...</p>
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:0.75pt;">A</td>
<td style="padding:0.75pt;">
<p class="MsoNormal">Write a parser completely by hand, it's the only way to   make sure it's 100% accurate</p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;">B</td>
<td style="padding:0.75pt;">
<p class="MsoNormal">Use the parse_str() function to translate it to an array()</p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;">C</td>
<td style="padding:0.75pt;">
<p class="MsoNormal">Pass the variable to another PHP script via an HTTP GET   request and return the array as a serialized variable</p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;">D</td>
<td style="padding:0.75pt;">
<p class="MsoNormal">Just call unserialize() to translate it to an array()</p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;">E</td>
<td style="padding:0.75pt;">
<p class="MsoNormal">Write a string parser using strtok() and unserialize() to   convert it to an array</p>
</td>
</tr>
</tbody>
</table>
<p>My first thought  was to use unserialize and there you go, everything should be right, but as you know, not always I'm right. D was my answer at the exam and after I runned some tests I have found out that C is the correct answer.</p>
<p>Take a look again at the string <code><span style="font-size:10pt;">a=10&#38;b[]=20&#38;c=30&#38;d=40+50.</span></code></p>
<p>If you put a index.php? before the string you will get a full correct $_GET request: index.php?<code><span style="font-size:10pt;">a=10&#38;b[]=20&#38;c=30&#38;d=40+50.</span></code></p>
<p>Why the heck din't I think on that!??????</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Hört, hört!]]></title>
<link>http://thomaseschle.wordpress.com/?p=29</link>
<pubDate>Tue, 26 Aug 2008 19:51:25 +0000</pubDate>
<dc:creator>thomaas</dc:creator>
<guid>http://thomaseschle.wordpress.com/?p=29</guid>
<description><![CDATA[Schön! Das Praxissemester hat begonnen. Und es geht gleich richtig zur Sache! Ich hatte nicht mal e]]></description>
<content:encoded><![CDATA[<p>Schön! Das Praxissemester hat begonnen. Und es geht gleich richtig zur Sache! Ich hatte nicht mal einen ganzen Tag Zeit mich einzuarbeiten und schon wurde ich mit einem Projekt beladen! Es ging um ein Redesign einer bereits bestehenden Seite und die Übernahme der Suchnavigator Funktionalitäten.</p>
<p>Nach einer Woche habe ich das Projekt abgeschlossen und mich wieder ein wenig dem Einarbeitungsbogen gewidmet.<br />
Keinen ganzen Tag saß ich daran, schon kam das nächste, diesmal wirklich große Projekt auf mich zu! Es geht um einen Aufbau einer neuen Telefonbuchsuche, mit Unterstützung der Technologie von <a href="http://www.exorbyte.com" target="_blank">Exorbyte</a>.</p>
<p>Aktuell sitze ich daran und lese mich in das <a href="http://framework.zend.com" target="_blank">Zend Framework</a> ein. Interessante Sache, leider bin ich bisher noch nicht all zu weit gekommen. Einige Screencasts haben es dann herausgerissen und ich habe die Hauptfunktionalität und vor allem das Quickstart Tutorial bearbeiten können... Jetzt geht es ans eingemachte!!</p>
<p>Wünscht mir Glück und ich bin sehr Dankbar über Sämtliche Tipps und Ratschläge zum Zend Framework!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Zend Exam Type Questions II]]></title>
<link>http://mcloide.wordpress.com/?p=33</link>
<pubDate>Mon, 25 Aug 2008 23:26:09 +0000</pubDate>
<dc:creator>mcloide</dc:creator>
<guid>http://mcloide.wordpress.com/?p=33</guid>
<description><![CDATA[
It&#8217;s funny how a simple question can trick you to the most simple of the errors. Take a look ]]></description>
<content:encoded><![CDATA[<p><a href="http://www.charmingdesign.net/"><img class="alignright" style="margin-left:5px;margin-right:5px;" src="http://www.charmingdesign.net/files/zce.gif" alt="" width="220" height="216" /></a></p>
<p>It's funny how a simple question can trick you to the most simple of the errors. Take a look at this question:</p>
<pre>&#60;?php
$oranges = 10;
$apples = 5;
$string = "I have %d apples and %d oranges";
???????
?&#62;</pre>
<p class="ceresindent">What could be placed in place of <code><span style="font-size:10pt;">??????</span></code> to output the string:<br />
<code><span style="font-size:10pt;">I have 5 apples and 10 oranges</span></code></p>
<p class="MsoNormal">Answers: (choose 2)</p>
<table class="MsoNormalTable" style="height:134px;" border="0" cellpadding="0" width="422">
<tbody>
<tr>
<td style="padding:0.75pt;">A</td>
<td style="padding:0.75pt;">
<p class="MsoNormal">str_format($string, $apples, $oranges);</p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;">B</td>
<td style="padding:0.75pt;">
<p class="MsoNormal">print($string, $apples, $oranges);</p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;">C</td>
<td style="padding:0.75pt;">
<p class="MsoNormal">printf($string, $apples, $oranges);</p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;">D</td>
<td style="padding:0.75pt;">
<p class="MsoNormal">print sprintf($apples, $oranges);</p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;">E</td>
<td style="padding:0.75pt;">
<p class="MsoNormal">sprintf($string, $oranges, $apples);</p>
</td>
</tr>
</tbody>
</table>
<p>There are 2 correct answers for this and as you know, printf and sprintf are the only PHP functions that can format a string. So the answers C and E would be the correct answers, right!? Wrong. The catch in this question is that sprintf only formats the string, it does not print, making the correct answers C and D.</p>
<p>This is another question that is also interesting. I love complex (or curly) variables passing for strings. It make writing simple sql statements when inside a class way much easier. I have came accross this question during a mock exam:</p>
<p class="MsoNormal">What variable reference would go in the spots indicated by <code><span style="font-size:10pt;">?????</span></code> in the code segment below?</p>
<pre>&#60;?php
$msg = "The Quick Brown Foxed Jumped Over the Lazy Dog";
$state = true;
$retval = "";
for($i = 0; (isset(??????)); $i++) {
<span>       </span>if($state) {
<span>               </span>$retval .= strtolower(?????);
<span>        </span>} else {
<span>               </span>$retval .= strtoupper(?????);
<span>        </span>}
<span>        </span>$state = !$state;
}
print $retval;?&#62;</pre>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal">Answer...</p>
<table class="MsoNormalTable" style="height:109px;" border="0" cellpadding="0" width="368">
<tbody>
<tr>
<td style="padding:0.75pt;">A</td>
<td style="padding:0.75pt;">
<p class="MsoNormal">$msg{$i}</p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;">B</td>
<td style="padding:0.75pt;">
<p class="MsoNormal">ord($msg);</p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;">C</td>
<td style="padding:0.75pt;">
<p class="MsoNormal">chr($msg);</p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;">D</td>
<td style="padding:0.75pt;">
<p class="MsoNormal">substr($msg, $i, 2);</p>
</td>
</tr>
</tbody>
</table>
<p>Strings can be accessed as an array of characters (funny how you not always remember this kind of stuff). You can use the [$pos] to access a character in a given position of a string. The same is true for the {$pos} making the A as the correct answer. This is part of PHP string access interface that uses the [] and {} as access formats for the string. The same {} that you use for a complex string. Just a note,  $string{$pos} will be removed from PHP6 and passing the position of the character is required.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Panduan Belajar dan Tutorial PHP : The Zend PHP Certification Practice Test Book  ]]></title>
<link>http://prananto.wordpress.com/?p=152</link>
<pubDate>Fri, 22 Aug 2008 03:56:09 +0000</pubDate>
<dc:creator>prananto</dc:creator>
<guid>http://prananto.wordpress.com/?p=152</guid>
<description><![CDATA[
]]></description>
<content:encoded><![CDATA[<p style="text-align:center;"><img class="size-medium wp-image-153 aligncenter" src="http://prananto.wordpress.com/files/2008/08/cover-zend-certification.jpg?w=242" alt="" width="242" height="300" /></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[[VACANCY] Freak PHP Programmer]]></title>
<link>http://thebrainware.wordpress.com/?p=4</link>
<pubDate>Tue, 19 Aug 2008 08:12:37 +0000</pubDate>
<dc:creator>doddyprima</dc:creator>
<guid>http://thebrainware.wordpress.com/?p=4</guid>
<description><![CDATA[We are a IT company located in Jakarta (Gandaria) as a provider of IT solutions and outsourcing serv]]></description>
<content:encoded><![CDATA[<p>We are a IT company located in Jakarta (Gandaria) as a provider of IT solutions and outsourcing services.<br />
We have been developing an <span class="yshortcuts">Asset Management System</span> and a Digital Document Management System, that interconnected each other.</p>
<p>We need a strong and freak PHP artist to become our team member.<br />
<span style="color:#ff0000;"><strong>ARE you ?</strong></span></p>
<blockquote>
<blockquote><p><span style="color:#ffff00;"><em>&#60;?php</em></span><br />
<em> <span style="color:#ffff00;">if (</span><span style="color:#ff7f00;">$phpExperts</span> <span style="color:#ffff00;">&#38;&#38;</span><span style="color:#60bf00;"><span style="color:#ffff00;"> </span>$needJobs </span><span style="color:#ffff00;">) {</span></em><br />
<em> <span style="color:#ffff00;">mail(</span><span style="color:#0080ff;">$me</span><span style="color:#000000;">,</span><span style="color:#ff7f00;">"PHP Experts"</span><span style="color:#000000;"> <span style="color:#ffff00;">,</span></span><span style="color:#60bf00;"> $resume</span><span style="color:#000000;"> <span style="color:#ffff00;">);</span></span> </em><br />
<em> <span style="color:#000000;"> <span style="color:#ffff00;">}</span></span></em><span style="color:#ffff00;"><br />
<em>?&#62;</em></span></p></blockquote>
</blockquote>
<p>Objectives:<br />
- To design and administer software and databases.<br />
- To test and develop software.</p>
<p>Responsibilities:<br />
- Develop some codes that are needed for the  project’s <span class="yshortcuts" style="border-bottom:1px dashed #0066cc;cursor:pointer;">website development</span><br />
- Manage systems provided for business study and plan</p>
<p>Education:<br />
- Hold Minimum Diploma degree in <span class="yshortcuts" style="border-bottom:1px dashed #0066cc;cursor:pointer;">Computer Science</span> or Information Technology or any course related</p>
<p>Required skill(s) :<br />
- Excellent PHP programming Skills<br />
- Understand about <span class="yshortcuts">Webservices</span> in PHP<br />
- Experienced in framework, CMS development<br />
- Skilled in CSS and xHTML, concerned in latest <span class="yshortcuts" style="border-bottom:1px dashed #0066cc;cursor:pointer;">web standards</span></p>
<p>Prefered Skill(s) :<br />
- PHP Framework - Zend &#124; Prado &#124; Sympony &#124; Cake<br />
- CMS Customize<br />
- AJAX<br />
- Web Design (Template, icons, menu, CSS)<br />
- Web Security<br />
- Knows how to handle Linux Servers (Red Hat).</p>
<p>- postgreSQL (syntax and design)<br />
- <span class="yshortcuts">Oracle</span> (syntax and design)</p>
<p>Prefered experience/knowledge<br />
- Asset Management System<br />
- Digital Document Management System  (Filing)</p>
<p>Full-Time, Part-Time and Contract position available.</p>
<p>Work in a team,<br />
Able to work under pressure and willing to work overtime,<br />
Productive and able to work hard under pressure</p>
<p>Please send your CV to :<br />
<span class="yshortcuts" style="border-bottom:1px dashed #0066cc;background:transparent none repeat scroll 0 0;cursor:pointer;">doddy@gipindo.com</span> &#124; <span class="yshortcuts" style="border-bottom:1px dashed #0066cc;cursor:pointer;">doddy.prima@gmail.com</span><br />
+ with screen-shoot or web-address of portfolio<br />
<span style="font-weight:bold;">Doddy Prima Kd</span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[PHP-GTK]]></title>
<link>http://mcloide.wordpress.com/?p=20</link>
<pubDate>Mon, 18 Aug 2008 16:19:51 +0000</pubDate>
<dc:creator>mcloide</dc:creator>
<guid>http://mcloide.wordpress.com/?p=20</guid>
<description><![CDATA[Consider that you need to upload to the server insane huge files where normally a file uploader woul]]></description>
<content:encoded><![CDATA[<p>Consider that you need to upload to the server insane huge files where normally a file uploader would have a script timeout. Well so far the only way to work this out is by using a FTP (which you would have to give access to) and upload the files to a server and them process the files, but things have changed. It has just been released a stable version for PHP-GTK.</p>
<p>PHP-GTK allows you to create GUI applications portable for Windows, Mac and Linux and with this you could create a GUI application for uploading files to the server where whithout having to create access for each user. Pretty cool right !?</p>
<p>Anyway, for more information check the <a href="http://gtk.php.net/">PHP-GTK</a> site and this <a href="http://devzone.zend.com/article/3779-Create-your-own-widget-with-PHP-GTK">Zend Article</a> that have a example how to create a widget using this new feature.</p>
<p>Have fun.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Includes and Requires of PHPs]]></title>
<link>http://sainbayar.wordpress.com/?p=228</link>
<pubDate>Sat, 16 Aug 2008 07:13:26 +0000</pubDate>
<dc:creator>Сайнбаяр</dc:creator>
<guid>http://sainbayar.wordpress.com/?p=228</guid>
<description><![CDATA[WordPress нь жаахан дээр үеийн хувилбар. Гэхдээ нээх сүртэй]]></description>
<content:encoded><![CDATA[<p>Wordpress нь жаахан дээр үеийн хувилбар. Гэхдээ нээх сүртэй өөрчлөгдөж хувьсаагүй байх.</p>
<p><strong><a href="http://wordpress.org/" target="_blank">WordPress</a> 2.2.1</strong></p>
[caption id="attachment_232" align="alignnone" width="300" caption="wordpress"]<a href="http://sainbayar.files.wordpress.com/2008/08/wordpress.gif"><img class="size-medium wp-image-232" src="http://sainbayar.wordpress.com/files/2008/08/wordpress.gif?w=300" alt="wordpress" width="300" height="290" /></a>[/caption]
<p><a href="http://www.phpmyadmin.net/home_page/index.php" target="_blank"><strong>phpMyAdmin</strong></a><strong> 2.9.1.1</strong></p>
[caption id="attachment_233" align="alignnone" width="300" caption="PhpMyAdmin"]<a href="http://sainbayar.files.wordpress.com/2008/08/phpmyadmin.gif"><img class="size-medium wp-image-233" src="http://sainbayar.wordpress.com/files/2008/08/phpmyadmin.gif?w=300" alt="PhpMyAdmin" width="300" height="112" /></a>[/caption]
<p><a href="http://www.symfony-project.org/" target="_blank"><strong>Symfony</strong></a><strong> 1.1</strong></p>
[caption id="attachment_234" align="alignnone" width="300" caption="symfony"]<a href="http://sainbayar.files.wordpress.com/2008/08/symfony.gif"><img class="size-medium wp-image-234" src="http://sainbayar.wordpress.com/files/2008/08/symfony.gif?w=300" alt="symfony" width="300" height="88" /></a>[/caption]
<p><strong><a href="http://framework.zend.com/" target="_blank">Zend Framework</a> 1.5.2</strong></p>
[caption id="attachment_235" align="alignnone" width="300" caption="Zend"]<a href="http://sainbayar.files.wordpress.com/2008/08/zend-blog-db-hor.gif"><img class="size-medium wp-image-235" src="http://sainbayar.wordpress.com/files/2008/08/zend-blog-db-hor.gif?w=300" alt="Zend" width="300" height="93" /></a>[/caption]
<p><a href="http://www.cakephp.org/" target="_blank"><strong>CakePHP</strong></a></p>
[caption id="attachment_236" align="alignnone" width="300" caption="CakePHP"]<a href="http://sainbayar.files.wordpress.com/2008/08/cake.gif"><img class="size-medium wp-image-236" src="http://sainbayar.wordpress.com/files/2008/08/cake.gif?w=300" alt="CakePHP" width="300" height="283" /></a>[/caption]
<p>source: <a href="http://phpimpact.wordpress.com" target="_blank">phpimpact.wordpress.com</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Online-Dokumentation]]></title>
<link>http://drazraeltod.wordpress.com/?p=533</link>
<pubDate>Wed, 13 Aug 2008 15:02:12 +0000</pubDate>
<dc:creator>Dr. Azrael Tod</dc:creator>
<guid>http://drazraeltod.wordpress.com/?p=533</guid>
<description><![CDATA[Es hat mich ja schon lange genervt dass viele Programme/Sprachen/Framesets oder ähnliches nur Onlin]]></description>
<content:encoded><![CDATA[<p>Es hat mich ja schon lange genervt dass viele Programme/Sprachen/Framesets oder ähnliches nur Online-Dokumentationen anbieten aber in letzter Zeit wird das immer schlimmer (Das liegt sicher auch zum großen Teil daran, dass ich noch immer kein permanentes Internet in Dresden habe.)</p>
<p>Es ist einfach grauenvoll wenn man gerade mal wieder 3 Stunden in einer Bahn sitzt, das Notebook in der Tasche und eigentlich viel Zeit zum Arbeiten hätte. Leider hängt man nach 5min an einem kleinen Detail das man in Sekunden in der Doku finden würde, doch die Doku hat man natürlich mal wieder nicht mit.</p>
<p><!--more-->Ich sehe es ja noch ein dass für viele Frameworks und Bibliotheken Bücher als Medium einfach zu langsam sind. Wenn sich alle 3-4 Monate ein neues Framework als Hype breitmacht oder komplett umgeschrieben wird, wie soll sich dann jemand hinsetzen und nebenbei auch noch ein Buch dazu schreiben? Von den armen Entwicklern die sich all die Bücher kaufen sollen dann mal ganz abgesehen. In dieser Beziehung musste ich neulich auch erst wieder feststellen wie verwöhnt ich bin. Plötzlich musste ich meine Bibliotheksgewohnheiten von einer vollen Etage voller IT-Bezogener Bücher (<a href="http://drazraeltod.wordpress.com/2008/05/15/bitte-lacheln/" target="_self">Bibliothek </a>der <a href="http://drazraeltod.wordpress.com/2008/03/28/hochschulbibliothek/" target="_blank">WHZ</a>) auf ein bis zwei Regale pro Zweigstelle (<a href="http://drazraeltod.wordpress.com/2008/08/02/lest-mal-wieder/" target="_self">Stadtbibliotheken Dresden</a>, die sind an sich schon ziemlich gut ausgestattet aber halt keine Fachbibliotheken) umstellen. Natürlich findet man dann eher seltener etwas zu neueren oder ausgefallenen Themenbereichen wie <a href="http://de.wikipedia.org/wiki/Python_(Programmiersprache)" target="_blank">Python </a>mit <a href="http://code.google.com/appengine/" target="_blank">AppEngine</a>.</p>
<p>Es sollte jedenfalls möglich sein die überall vorhandenen Online-Dokumentationen nicht nur Online lesen könnte sondern auch in irgendeiner statisch zusammengestellten Form runterladen könnte. Nicht in jeder Situation muss man permanent die aktuellste Version von vor einer halben Stunde im Wiki nachlesen, manchmal würde es auch die 6 Monate alte Version im PDF-Format oder noch besser als Tarball mit HTML-Seiten tun.</p>
<p>Manche Projekte verhalten sich bei diesen Dingen auch durchaus wie gewünscht, die <a href="http://framework.zend.com/download/documentation/" target="_blank">Dokumentation zum Zend Framework</a> gibt es z.B. jederzeit gut sichtbar zum Download, das gleiche gilt ebenfalls für <a href="http://cakeforge.org/projects/cakedocs/" target="_blank">CakePHP</a> oder (als wohl bekanntestes Beispiel) für <a href="http://aktuell.de.selfhtml.org/extras/download.shtml" target="_blank">SelfHTML</a>.</p>
<p>Andere Projekte scheinen das noch immer nicht verstanden zu haben. Ich würde mich z.B. für einen möglichen Job der demnächst anstehen könnte gerne schonmal ins Symfony Framework einlesen, die <a href="http://www.symfony-project.org/doc/1_1/" target="_blank">Online-Doku</a> scheint auch recht umfangreich und hilfreich, leider gibt es keine wirklich praktikable Möglichkeit (vom Download jeder einzelnen Seite mal abgesehen) um das Ganze auf einen USB-Stick zu ziehen und mitzunehmen. Ach  halt... ich könnte natürlich <a href="http://www.amazon.com/dp/1590597869?tag=symfonyprojec-20&#38;camp=14573&#38;creative=327641&#38;linkCode=as1&#38;creativeASIN=1590597869&#38;adid=0E8EEASTSYS05JS23TXC&#38;" target="_blank">das offizelle Buch</a> ($29,10) dazu bestellen oder zu einem <a href="http://www.sensiolabs.com/en/offer/formation-symfony" target="_blank">Workshop</a> (1200€, in Frankreich) gehen, beides sehr deutlich auf der Seite angeboten. Trotz Doku unter <a href="http://www.gnu.org/licenses/fdl.txt" target="_blank">GFDL </a>ist man also ziemlich eingeschränkt, ein Schelm wer böses dabei denkt.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[ZCE Exam Question: Which PCRE regular expression will match the string PhP5-rocks?]]></title>
<link>http://mcloide.wordpress.com/?p=9</link>
<pubDate>Tue, 12 Aug 2008 15:40:58 +0000</pubDate>
<dc:creator>mcloide</dc:creator>
<guid>http://mcloide.wordpress.com/?p=9</guid>
<description><![CDATA[Which PCRE regular expression will match the string PhP5-rocks?
 
Answer&#8230; 





[ ]

/^[hp1-5]]]></description>
<content:encoded><![CDATA[<p class="MsoNormal"><strong><span style="font-size:10pt;font-family:&#34;">Which PCRE regular expression will match the string <code>PhP5-rocks</code>?</span></strong></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#34;">Answer... </span></p>
<table class="MsoNormalTable" style="height:144px;" border="0" cellpadding="0" width="410">
<tbody>
<tr>
<td style="padding:0.75pt;">
<p class="MsoNormal">
<p>[ ]</td>
<td style="padding:0.75pt;">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#34;">/^[hp1-5]*\-.*/i </span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;">
<p class="MsoNormal">
<p>[ ]</td>
<td style="padding:0.75pt;">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#34;">/[hp1-5]*\-.?/ </span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;">
<p class="MsoNormal">
<p>[ ]</td>
<td style="padding:0.75pt;">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#34;">/[hp][1-5]*\-.*/ </span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;">
<p class="MsoNormal">
<p>[ ]</td>
<td style="padding:0.75pt;">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#34;">/[PhP]{3}[1-5]{2,3}\-.*$/ </span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;">
<p class="MsoNormal">
<p>[ ]</td>
<td style="padding:0.75pt;">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#34;">/[a-z1-5\-]*/ </span></p>
</td>
</tr>
</tbody>
</table>
<p>I got intrigued with this question. At first it seems too easy, but it requires a little understanding from PHP's PCRE functions to really understand it.</p>
<p>If you do the following code and execute it:</p>
<p style="padding-left:30px;"><span style="color:#000000;"><code><span>&#60;?php</span></code><br />
<code><span><br />
$string = 'PhP5-rocks';</span></code></span></p>
<p style="padding-left:30px;"><span style="color:#000000;">print_r(preg_match('/^[hp1-5]*\-.*/i',$string,$matches,PREG_OFFSET_CAPTURE));<br />
print_r($matches);</span></p>
<p style="padding-left:30px;"><span style="color:#000000;">print_r(preg_match('/[hp1-5]*\-.?/',$string,$matches,PREG_OFFSET_CAPTURE));<br />
print_r($matches)</span></p>
<p style="padding-left:30px;"><span style="color:#000000;">print_r(preg_match('/[hp][1-5]*\-.*/',$string,$matches,PREG_OFFSET_CAPTURE));<br />
print_r($matches);</span></p>
<p style="padding-left:30px;"><span style="color:#000000;">print_r(preg_match('/[PhP]{3}[1-5]{2,3}\-.*$/',$string,$matches,PREG_OFFSET_CAPTURE));<br />
print_r($matches);</span></p>
<p style="padding-left:30px;"><span style="color:#000000;">print_r(preg_match('/[a-z1-5\-]*/',$string,$matches,PREG_OFFSET_CAPTURE));<br />
print_r($matches);<br />
?&#62;</span></p>
<p><span style="color:#000000;">T</span>he first, second and last print_r will print 1 at the screen and the remaining will print 0. If you read <a href="http://us.php.net/manual/en/function.preg-match.php">preg_match</a> function manual you will see that preg_match returns 1 or 0 always, being 1 as it has matched a string that matches that regex that was given to test. Considering this, you would have 3 correct answers for this puzzle but, in fact there's only one. When you add the refereced parameter $matches and print it, you will see that the only regex that matches the string is the first one.</p>
<p>When I first have answered this question, I have answered wrongly. I did missed the fact that were a capital P on the string (well who knew...), but this helped me to see what's was wrong and seek for the correct answer.</p>
<p>I will keep you guys posted. More to come with PHP 5 and Zend Certifications.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Resources on the web]]></title>
<link>http://mcloide.wordpress.com/?p=7</link>
<pubDate>Mon, 11 Aug 2008 17:37:25 +0000</pubDate>
<dc:creator>mcloide</dc:creator>
<guid>http://mcloide.wordpress.com/?p=7</guid>
<description><![CDATA[During the years I have been collecting some links of sites that are powerfull resources. CSS, desig]]></description>
<content:encoded><![CDATA[<p>During the years I have been collecting some links of sites that are powerfull resources. CSS, design, programming, php, javascript, jquery, frameworks, CRM's and so on. I have selected a few of them and I'm placing here so you can have it as well.</p>
<table class="t91" border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td class="tr91"><a href="http://www.dennisplucinik.com/blog/2007/08/28/60-advanced-adobe-photoshop-tutorials/">60 Advanced Adobe Photoshop Tutorials</a></td>
</tr>
<tr>
<td class="tr91"><a href="http://www.cmsimple.dk/">CMSimple Content Management - CMSimple</a></td>
</tr>
<tr>
<td class="tr91"><a href="http://www.designertoday.com/Tutorials/Illustrator.aspx">Designer Today Graphic Design Magazine, Magazin...</a></td>
</tr>
<tr>
<td class="tr91"><a href="http://templates.arcsin.se/">http://templates.arcsin.se/</a></td>
</tr>
<tr>
<td class="tr91"><a href="http://www.maani.us/charts/index.php">http://www.maani.us/charts/index.php</a></td>
</tr>
<tr>
<td class="tr91"><a href="http://www.phpsplashboard.com/">http://www.phpsplashboard.com/</a></td>
</tr>
<tr>
<td class="tr91"><a href="http://www.knowledgetree.com/">KnowledgeTree &#124; Electronic Document Management ...</a></td>
</tr>
<tr>
<td class="tr91"><a href="http://valokuva.org/?p=72">Mikko’s blog » Blog Archive » Color analysis</a></td>
</tr>
<tr>
<td class="tr91"><a href="http://www.tutorialized.com/">Photoshop Tutorials and Flash Tutorials - Tutorialized</a></td>
</tr>
<tr>
<td class="tr91"><a href="http://www.vtiger.com/">vtiger Open Source CRM - Salesforce , Marketing...</a></td>
</tr>
<tr>
<td class="tr91"><a href="http://devzone.zend.com/node/view/id/1714">What's New in PHP 5? Zend Test</a></td>
</tr>
<tr>
<td class="tr91"><a href="http://readtheweb.info/2008/01/22/zend-php5-certification-exam-study-review-10-supplementary-i/">Zend Test</a></td>
</tr>
<tr>
<td class="tr91"><a href="http://framework.zend.com/manual/en/">Zend Framework Reference Guide</a></td>
</tr>
<tr>
<td class="tr91"><a href="http://xajaxproject.org/">Xajax</a><a href="http://framework.zend.com/manual/en/"> </a></td>
</tr>
<tr>
<td class="tr91"><a href="http://script.aculo.us">Script.aculo.us </a></td>
</tr>
<tr>
<td class="tr91"><a href="http://www.jquery.com">JQuery </a></td>
</tr>
<tr>
<td class="tr91"><a href="http://www.php.net">PHP.Net</a></td>
</tr>
<tr>
<td><a href="http://php.robm.me.uk/">PHP Security Guide</a></td>
</tr>
</tbody>
</table>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Zend Framework: Action sem renderizar página ]]></title>
<link>http://programatik.wordpress.com/?p=108</link>
<pubDate>Sun, 03 Aug 2008 01:45:17 +0000</pubDate>
<dc:creator>programatik</dc:creator>
<guid>http://programatik.wordpress.com/?p=108</guid>
<description><![CDATA[Quando utilizamos o zend framework para cada action chamada ele faz forward automaticamente para uma]]></description>
<content:encoded><![CDATA[<p>Quando utilizamos o zend framework para cada action chamada ele faz forward automaticamente para uma pagina do mesmo nome e quando estamos utilizando AJAX esse não é o objetivo. Para resolver esse problema basta colocar a linha no corpo da action.</p>
<p>[sourcecode language='php']<br />
  $this->_helper->viewRenderer->setNoRender();<br />
[/sourcecode]</p>
<p>Alguns tutoriais antigos que coloquei sobre AJAX eu utilizava uma página que apenas ecoava o objeto, isso não é necessário utilizando o recurso acima e para colocar o objeto no response para poder ler na página basta fazer.</p>
<p>[sourcecode language='php']<br />
$this->_response->appendBody($objJson);<br />
[/sourcecode]</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Adobe AMF Support in Zend Framework]]></title>
<link>http://chrisgriffith.wordpress.com/?p=82</link>
<pubDate>Fri, 01 Aug 2008 15:46:24 +0000</pubDate>
<dc:creator>Chris Griffith</dc:creator>
<guid>http://chrisgriffith.wordpress.com/?p=82</guid>
<description><![CDATA[For those who use the Zend framework, you might be interested in the proposal.  Andi Gutmans of Zend]]></description>
<content:encoded><![CDATA[<p>For those who use the Zend framework, you might be interested in the proposal.  Andi Gutmans of Zend said</p>
<blockquote><p>This ZF component will allow for client-side applications built with Flex and Adobe AIR to communicate easily and efficiently with PHP on the server-side.</p></blockquote>
<p>The best part was I didn't have to suggest this to my <a href="http://static.zend.com/topics/company-management-adaniel-moskowitz.jpg">brother-in-law</a> at Zend.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Zend PHP Certification Guide and Practices]]></title>
<link>http://ideaccess.wordpress.com/?p=32</link>
<pubDate>Fri, 01 Aug 2008 08:20:45 +0000</pubDate>
<dc:creator>Waseem</dc:creator>
<guid>http://ideaccess.wordpress.com/?p=32</guid>
<description><![CDATA[
As the usage of PHP grows, the need for a globally-recognized credentials program for professional ]]></description>
<content:encoded><![CDATA[<p><img class="alignleft" src="http://ecx.images-amazon.com/images/I/519G80JQ0EL._SL500_BO2,204,203,200_PIsitb-dp-500-arrow,TopRight,45,-64_OU01_AA240_SH20_.jpg" alt="" width="240" height="240" /></p>
<p>As the usage of PHP grows, the need for a globally-recognized credentials program for professional developers is becoming more and more important. The Zend Engineer Certification Program, launched by worldwide PHP leader Zend <span class="kLink" style="text-decoration:underline !important;position:static;"><span style="color:#e82c2b !important;font-weight:400;font-size:11.2px;position:static;"><span class="kLink" style="color:#e82c2b !important;font-family:Tahoma,Arial,sans-serif;font-weight:400;font-size:11.2px;position:static;"></span></span></span>, finally creates a professional designation that represents consistently high-quality skills and knowledge in the PHP world. Written and edited by four members of the Zend Education Board who also helped create the actual Zend Certification Exam, this book contains 200 questions on every topic that is part of the exam. The Zend Certification Practice Test Book is an invaluable resource in testing your preparedness in every area of the exam, from the basics to the most advanced topics. Each question comes with a clear answer that provides an explanation of the question’s topic, its goals and end result. Answering the questions in this book will allow you to clearly and quickly identify the areas of PHP in which you are strong and those in which you need further study before being able to pass the exam! Zend Technologies, Inc. (http://www.zend.com) is the PHP company. Founded by the creators and ongoing innovators of PHP, it is the developer of the Zend Engine, the heart of PHP. Zend focuses on enterprise-class products and services that enable organizations to develop, deploy and manage business-critical PHP applications. NanoBooks are excellent, in-depth resources created by the publishers of php&#124;architect (http://www.phparch.com), the world’s premier magazine dedicated to PHP professionals. NanoBooks focus on delivering high-quality content with in-depth analysis and expertise, centered around a single, well-defined topic and without any of the fluff of larger, more expensive books.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Les configurations et Zend_Config]]></title>
<link>http://zendfaw.wordpress.com/?p=11</link>
<pubDate>Tue, 29 Jul 2008 16:33:51 +0000</pubDate>
<dc:creator>zfaw</dc:creator>
<guid>http://zendfaw.wordpress.com/?p=11</guid>
<description><![CDATA[Les différentes configurations pour la base de données ou autres peuvent être facilement stockée]]></description>
<content:encoded><![CDATA[<p>Les différentes configurations pour la base de données ou autres peuvent être facilement stockées dans un fichier à part et être relu par Zend_Config. Zend_Config peut facilement lire des fichiers dans le format XML, INI et des tableaux PHP. Comme j'avais dis lors de mon dernier post, j'ai une certaine préférence pour les fichiers <em>.ini</em>.</p>
<p>Après la lecture du fichier Zend_Config permettra l'utilisation d'une interface du type objet pour les données de configuration, indépendamment du format utilisé. Par exemple:</p>
<p><em><br />
[db]<br />
adapter = MYSQLI<br />
dbase.host = localhost<br />
dbase.username = admin<br />
dbase.password = 1234<br />
dbase.name = users<br />
</em></p>
<p>Pour lire ce fichier et accéder aux variables, il suffit de faire:</p>
<p><em><br />
$config = new Zend_Config_Ini('config.ini', 'db');<br />
$adapter = $config-&#62;adapter;<br />
$databaseHost = $config-&#62;database-&#62;host;<br />
</em></p>
<p>Et comme vous pouvez le constater, les "." deviennent un séparateur hiérarchisé après le parse de Zend_Config. Un autre caractère qui peut être interprété pas Zend_Config est ":", mais le notion pour Zend_Config est de héritage. Par exemple:</p>
<p><em><br />
[general]<br />
db.adapter = PDO_MYSQL<br />
db.config.host = localhost<br />
db.config.username = user1234<br />
db.config.password = 1234<br />
db.config.dbname = user </em></p>
<p><em>[dev : general]<br />
db.config.host = new.place.com<br />
</em><br />
<em>[prod : general]<br />
db.config.host = prod.place.com<br />
</em></p>
<p>Désormais nous pouvons initialiser le fichier des deux façons différentes, une lorsque nous sommes dans l'environnement de dev:</p>
<p><em><br />
$config = new Zend_Config_Ini('config.ini', 'dev');<br />
</em></p>
<p>Et une autre pour l'environnement de recette:</p>
<p><em><br />
$config = new Zend_Config_Ini('config.ini', 'prod');<br />
</em></p>
<p>Dans tout les deux cas nous ne pouvons pas oublier la notion d'héritage, ainsi toutes les fonctionnalités de la partie <em>général</em> seront prise en compte et ensuite les fonctionnalité de chaque partie spécifiques. Ainsi nous pouvons retrouver des configurations différentes pour chaque environnement.</p>
<p>Ensuite, l'unique chose que nous avons besoin de faire est de récupérer les infos de la base de données. Par exemple:</p>
<p><em><br />
$section = getenv('dev') ? getenv('dev') : 'prod';<br />
$config = new Zend_Config_Ini('./application/config.ini', $section);<br />
Zend_Registry::set('config', $config);<br />
</em></p>
<p>A bientôt pour d'autres articles Zend Framework.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Zend_Acl]]></title>
<link>http://zendfaw.wordpress.com/?p=3</link>
<pubDate>Mon, 28 Jul 2008 21:43:58 +0000</pubDate>
<dc:creator>zfaw</dc:creator>
<guid>http://zendfaw.wordpress.com/?p=3</guid>
<description><![CDATA[L&#8217;utilisation de ZEND_ACL est assez simple à comprendre, du moins dans sa théorie. Lors de l]]></description>
<content:encoded><![CDATA[<p>L'utilisation de ZEND_ACL est assez simple à comprendre, du moins dans sa théorie. Lors de la création d'un site internet, nous sommes assez fréquemment mené à construire des formulaires de login pour les parties résérvées du site, pouvant ainsi avoir un seul type de membre avec un seul niveau de droit sur le site, ou plusieurs niveaux, <em>i.e.</em>:administrateurs, invités, membres, ou autre. Ainsi, avec ZEND_ACL, il suffit de définir les rôles et ses droits, affecter les permissions nécessaires  et faire appel à la fonction isAllowed();. Bon après ce début, je vous invite à regarder en détail cette classe de Zend.</p>
<h3>Zend_Acl_Role</h3>
<p>Dans un site, des groupes différents d'utilisateurs peuvent être menés à avoir des responsabilités et des droits différents. Le exemple typique c'est un blog, ou je peux me logger comme éditeur du blog, et vous pouvez vous connecter comme lecteur et poster des commentaires. Cette fonction d'éditeur dans le site est determinée par ZEND_ACL_ROLE, qui est une classe qui va, tout simplement, retenir les rôles qui nous voudrons affecter à notre site:</p>
<p><em>$roleMember = new Zend_ACL_ROLE('member');</em></p>
<p>Deux règles sont importantes à retenir a ce moment:</p>
<ol>
<li>Le nom d'un groupe d'utilisateurs défini ne peut pas être changé pendant le script;</li>
<li>Chaque nom de groupe d'utilisateurs doit être unique.</li>
</ol>
<p>Ensuite il faudra affecter le groupe à une instance ZEND_ACL:</p>
<p><em>$acl = new Zend_Acl();<br />
$acl-&#62;addRole($roleMember);</em></p>
<p>Il faut savoir que nous pouvons créer un héritage des droits, ainsi le fils aura tous les droits de son père, en plus les nouveaux droits qui l'ont été affectés. Un exemple classique est celui d'un moderateur d'un forum, vu qu'il aura tous les droits d'un lecteur, et en plus il pourra écrire, éditer, contrôler les posts.</p>
<p><em>$acl = new Zend_Acl();<br />
$acl-&#62;addRole(new Zend_Acl_Role('member'));<br />
$acl-&#62;addRole(new Zend_Acl_Role('moderateur'), 'member');</em></p>
<h3>Zend_Acl_Resource</h3>
<p>La <em>resource</em> est définie comme une entité, la partie du code, les fonctionnalités qui vous souhaitez protéger. La façon de protéger est la même que pour additionner un rôle:</p>
<p><em>$forumRessource = new Zend_Acl_Ressource('administration');</em></p>
<p>Une syntaxe encore plus simple à comprendre est:</p>
<p><em><br />
$acl = new Zend_Acl();<br />
$acl-&#62;addRole(new Zend_Acl_Role('member'));<br />
$acl-&#62;addRole(new Zend_Acl_Role('moderator'), 'member');<br />
$acl-&#62;addResource(new Zend_Acl_Resource('forum'));<br />
$acl-&#62;addResource(new Zend_Acl_Resource('posts'), 'forum');<br />
$acl-&#62;addResource(new Zend_Acl_Resource('threads'), 'forum');</em></p>
<h3>Déclarons les permission pour Zend_Acl</h3>
<p>La partie finale est d'affecter les permissions dues à chaque groupe. Pour cela, nous devons savoir quels sont les privilèges d'un groupe. Les privilèges sont basés par rapport aux opérations qui pourront être réalisées dans le site, par exemple pouvoir écrire, créer, éditeur, visualiser.</p>
<p>Au départ toutes les fonctionnalités sont interdites, mais pour les rendre accesibles Zend_Acl a une fonction nommée <em>allow()</em>, qui donnera accès à la fonctionnalité. Et au même temps, nous comptons sur <em>deny()</em> pour interdire l'accès à un certain sous-groupes des fonctionnalités qui ont été déjà permises. Je ne suis vraiment pas sure d'avoir bien exprimer le sens de cette phrase. Mais si on donne à un groupe toute les possibilités d'un administrateur, on peut bloquer certaines avec <em>deny()</em>, pour un administrateur junior, par exemple. Et vous pouvez comprendre assez rapidement l'intérêt si vous pensez à l'héritage des droits. Voyons un example pour que ça puisse être un peu plus clair:</p>
<p><em>$acl-&#62;allow('members', 'forum', 'view');<br />
$acl-&#62;allow('moderators', 'forum', array('moderate', 'blacklist');</em></p>
<p>Dans cet exemple nous avons donné des privilèges au groupe <em>members</em> pour voir (<em>view</em>) le forum et pour les modérateurs nous avons donné, aussi, les privilèges de modérer et faire un blacklist, au-delà de tous les privilèges dont il a déjà hérité étant fils du groupe member. Après cet introduction du sujet nous pouvons désormais voir son intégration direct avec Zend Framework.</p>
<h3>Comment configurer un objet Zend_Acl</h3>
<p>Bon comme nous avons vu, Zend_Acl demande beaucoup de configuration avant d'être mis en pretique dans le script de notre application. Pour cette raison, de la même forme comme ça se passe avec la configuration pour la base de données, nous pouvons intégrer toute la configuration en comme un tableau, un fichier xml ou encore un fichier .ini, étant ce dernier mon préféré. Je vous propose l'exemple suivant, que nous allons appeler <em>config.ini</em>:</p>
<p><em><br />
acl.roles.guest = null<br />
acl.roles.member = guest<br />
acl.roles.admin = member<br />
</em></p>
<p>Pour lire ce fichier de configuration nous faison extension de Zend_Acl pour lire les rôles depuis le objet config vers un objet du type Acl, et ce n'est pas compliqué:</p>
<p><em>class Forum_Acl extends Zend_Acl </em></p>
<p><em> </em></p>
<p>public function __construct()<br />
{<br />
$config = Zend_Registry::get('config');<br />
$roles = $config-&#62;acl-&#62;roles;<br />
$this-&#62;_addRoles($roles);<br />
}</p>
<p> </p>
<p><em> protected function _addRoles($roles)<br />
{<br />
foreach ($roles as $name=&#62;$parents) {<br />
if (!$this-&#62;hasRole($name)) {<br />
if (empty($parents)) {<br />
$parents = null;<br />
} else {<br />
$parents = explode(',', $parents);<br />
}<br />
$this-&#62;addRole(new Zend_Acl_Role($name), $parents);<br />
}<br />
}<br />
}<br />
}</em></p>
<p>Pour ce qui connaisse Zend_Config, il n'y a pas de surprise ici, pour ce que ne le connaisse pas, c'est peut être un thème pour un article. Ainsi nous récupérons la configuration depuis le fichier config, pour ensuite créer une boucle pour récupérer chaque valeur directement. Et pour chaque valeur, ou chaque rôle, nous certifions qu'il n'a pas été additionner encore, si c'est le cas nous créons un nouveau Zend_Acl_Role. Si l'objet Acl va être utiliser pour checker les permission pour chaque action, ainsi il est conseillé de le créer dans le bootstrap, par contre si ce n'est pas le cas il vaut mieux le créer ailleurs pour un souci de économie de mémoire et de performance. Mais vous pouvez vous demander où faut il placer le Acl alors? Et bien, c'est le moment d'introduire un nouveau concept.</p>
<h3>Zend_Acl_Object</h3>
<p>Ainsi pour répondre à la question, l'endroit le plus indiqué pour implémenter un objet Acl, est un <em>action helper</em>.Je m'explique, le <em>action helper</em> se place dans le modèle MVC dans le sytème de dispatch au niveau du controlleur, permettant ainsi que nous puissions vérifier les règles Acl avant le preDispatch() du controlleur soit appeler. Ainsi le Zend_Acl va tourner avant que l'action appelée soit mis en route. Il penser à remplir l'objet avec les règles, et la function init() est là pour ça.</p>
<p><em><br />
class Forum_Controller_Action_Helper_Acl extends Zend_Controller_Action_Helper_Abstract<br />
{<br />
protected $_action;<br />
protected $_auth;<br />
protected $_acl;<br />
protected $_controllerName; </em></p>
<p><em> </em></p>
<p>public function __construct(Zend_View_Interface $view = null,<br />
array $options = array())</p>
<p>{<br />
$this-&#62;_auth = Zend_Auth::getInstance();<br />
$this-&#62;_acl = $options['acl'];<br />
}</p>
<p>public function init()<br />
{<br />
$this-&#62;_action = $this-&#62;getActionController();</p>
<p> </p>
<p><em> // additionner resource pour le controlleur<br />
$controller = $this-&#62;_action-&#62;getRequest()-&#62;getControllerName();<br />
if(!$this-&#62;_acl-&#62;has($controller)) {<br />
$this-&#62;_acl-&#62;add(new Zend_Acl_Resource($controller));<br />
}<br />
}<br />
}</em></p>
<p>Pour la mémoire une petite image du système dispatch et son intégration avec Zend_acl:</p>
<p><a href="http://zendfaw.files.wordpress.com/2008/07/flow.jpg"><img class="aligncenter size-full wp-image-6" src="http://zendfaw.wordpress.com/files/2008/07/flow.jpg" alt="" width="450" height="675" /></a></p>
<p>Le premier pas est de utiliser la fonction __construct() pour passer une instance de l'objet Acl que nous allons utiliser avec les informations et règles. Pour ensuite dans la fonction init() vérifier s'il existe des règles pour cet action du contrôleur ou pas. Et ensuite:<br />
<em><br />
/**<br />
* Proxy to the underlying Zend_Acl's allow() function.<br />
*<br />
* Nous utilisons le nom du contrôleur comme la resource<br />
* et l'action comme privilège(s)<br />
*<br />
* @param  Zend_Acl_Role_Interface&#124;string&#124;array     $roles<br />
* @param  string&#124;array                             $actions<br />
* @uses   Zend_Acl::setRule()<br />
* @return Places_Controller_Action_Helper_Acl<br />
*/<br />
public function allow($roles = null, $actions = null)<br />
{<br />
$resource = $this-&#62;_controllerName;<br />
$this-&#62;_acl-&#62;allow($roles, $resource, $actions);<br />
return $this;<br />
} </em></p>
<p><em> </em></p>
<p><em> /**<br />
* Proxy to the underlying Zend_Acl's allow() function.<br />
*<br />
* Nous utilisons le nom du contrôleur comme la resource<br />
* et l'action comme privilège(s)<br />
*<br />
* @param  Zend_Acl_Role_Interface&#124;string&#124;array     $roles<br />
* @param  string&#124;array                             $actions<br />
* @uses   Zend_Acl::setRule()<br />
* @return Places_Controller_Action_Helper_Acl<br />
*/<br />
public function deny($roles = null, $actions = null)<br />
{<br />
$resource = $this-&#62;_controllerName;<br />
$this-&#62;_acl-&#62;allow($roles, $resource, $actions);<br />
} </em></p>
<p>Simple non? Pour finir, nous allons écrire l'appel dans notre classe contrôleur. Dans le cas où le contrôleur n'appelle aucune règle et l'accès est libre, il suffit de l'écrire:</p>
<p><em></em></p>
<p><em> </em></p>
<p>class IndexController extends Zend_Controller_Action<br />
{<br />
public function init()<br />
{<br />
$this-&#62;_helper-&#62;acl-&#62;allow(null);<br />
}</p>
<p> </p>
<p><em> //... suite du code. </em></p>
<p>Pour les contrôleurs ayant des règles il suffit de les indiquer:</p>
<p><em><br />
class PlaceController extends Zend_Controller_Action<br />
{<br />
function init()<br />
{<br />
$memberActions = array('index', 'details', 'reportError');  &#124;#1<br />
$this-&#62;_helper-&#62;_acl-&#62;allow('member', $memberActions);      &#124; </em></p>
<p><em> </em></p>
<p><em> $adminActions = array('add', 'edit', 'delete');             &#124;#2<br />
$this-&#62;_helper-&#62;_acl-&#62;allow('admin', $adminActions);        &#124;<br />
}<br />
//... class continues...<br />
</em></p>
<p>Voilà, je vous prie de bien vous souvenir de la notion d'héritage. Ainsi, nous n'avons pas besoin de donner accès aux administrateurs, vu qu'ils héritent de privilèges de son parent les <em>membres</em>.</p>
<p>Voici mon premier article sur Zend Framework je reste dans l'attente de la demande pour l'article de demain. Commentez et additionnez le flux RSS.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[PHP e o DB2 (ibm_db2)]]></title>
<link>http://fabiotomio.wordpress.com/?p=37</link>
<pubDate>Thu, 24 Jul 2008 21:31:53 +0000</pubDate>
<dc:creator>fabiotomio</dc:creator>
<guid>http://fabiotomio.wordpress.com/?p=37</guid>
<description><![CDATA[Como fazer o PHP acessar o Banco de Dados DB2?
Uma saida saria utilizar o Zend Core for IBM, que é ]]></description>
<content:encoded><![CDATA[<p>Como fazer o PHP acessar o Banco de Dados DB2?</p>
<p>Uma saida saria utilizar o Zend Core for IBM, que é uma solução que combina o Apache, PHP, etc, e disponibiliza acesso ao DB2, tive problemas com ele com relação a flexibilidade, precisei instalar o php-pgsql e não consegui, isso porque é o Zend Core que gerencia os pacotes relacionados ao PHP e ao Apache, disponibilizando um utilitário que acessando um repositório próprio, com pacotes homologados.</p>
<p>A saída foi utilizar uma biblioteca do PEAR. A princípio a sua instalação era pra ser fácil, mas levei um pouco de tempo pra conseguir instalar a primeira vez.</p>
<p><strong>A primeira forma seria subir o pear:</strong></p>
<p>Executar o comando -&#62; <em>yum install pear</em></p>
<p>e em seguida utilizar o comando -&#62; pecl install ibm_db2</p>
<p>Comigo não funcionou em nenhuma daz vezes que eu tentei instalar a biblioteca.</p>
<p><strong>A segunda forma seria compilar e instalar manualmente.</strong></p>
<p>Instalar o php-devel -&#62; <em>yum install php-devel gcc</em> (precisa também do gcc)</p>
<p>Baixar o pacote disponível em http://pecl.php.net/package/ibm_db2 -&#62; <em>wget http://pecl.php.net/get/ibm_db2-1.6.6.tgz</em></p>
<p>Descompactar -&#62; <em>tar -zxvf ibm_db2-1.6.6.tgz</em></p>
<p>Entrar na pasta ibm_db2-1.6.6 -&#62; <em>cd ibm_db2-1.6.6</em></p>
<p>Executar o comando -&#62; <em>phpize</em></p>
<p>Executar o comando -&#62; <em>./configure --with-IBM_DB2=/opt/ibm/db2/V9.5/</em></p>
<p>Executar o comando -&#62; <em>make</em></p>
<p>Executar o comando -&#62; <em>make install</em></p>
<p>Editar o php.ini -&#62; <em>vi /etc/php.ini</em><br />
<em>e adicionar as linhas abaixo:<br />
extension=ibm_db2.so<br />
ibm_db2.instance_name=db2inst1</em></p>
<p>Como comentei acima eu não consegui utilizar o pecl para instalar a biblioteca, somente compilando e instalando manualmente, qualquer dúvida é só enviar entrar em contato.</p>
<p>Passo a passo executado em Linux <a href="http://www.centos.org/" target="_blank">CentOS</a> 5.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Zend Framework 1.6 RC 1 Liberado!]]></title>
<link>http://programatik.wordpress.com/?p=86</link>
<pubDate>Wed, 23 Jul 2008 12:36:19 +0000</pubDate>
<dc:creator>programatik</dc:creator>
<guid>http://programatik.wordpress.com/?p=86</guid>
<description><![CDATA[O pessoal do zend liberou a versão 1.6 RC 1(Release Candidate), quem quiser testar as novas funcion]]></description>
<content:encoded><![CDATA[<p>O pessoal do zend liberou a versão 1.6 RC 1(Release Candidate), quem quiser testar as novas funcionalidades. </p>
<p><a href="http://devzone.zend.com/article/3712-Zend-Framework-1.6-Release-Candidate-1-now-available">http://devzone.zend.com/article/3712-Zend-Framework-1.6-Release-Candidate-1-now-available</a></p>
]]></content:encoded>
</item>

</channel>
</rss>
