<?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"
	>

<channel>
	<title>stoimen.com/blog &#187; featured</title>
	<atom:link href="http://www.stoimen.com/blog/category/featured/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stoimen.com/blog</link>
	<description>web developing</description>
	<pubDate>Wed, 10 Dec 2008 05:59:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>My new Zen site</title>
		<link>http://www.stoimen.com/blog/2008/12/10/zen-site/</link>
		<comments>http://www.stoimen.com/blog/2008/12/10/zen-site/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 05:59:58 +0000</pubDate>
		<dc:creator>stoimen</dc:creator>
		
		<category><![CDATA[featured]]></category>

		<category><![CDATA[portfolio]]></category>

		<category><![CDATA[buddhism]]></category>

		<category><![CDATA[site]]></category>

		<category><![CDATA[zen]]></category>

		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.stoimen.com/blog/?p=125</guid>
		<description><![CDATA[My newest site, I made for almost 40 minutes, you can find on http://stoimen.com/zen
]]></description>
			<content:encoded><![CDATA[<p>My newest site, I made for almost 40 minutes, you can find on <a href="http://stoimen.com/zen">http://stoimen.com/zen</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stoimen.com/blog/2008/12/10/zen-site/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MaYoMo - Map Your Moments</title>
		<link>http://www.stoimen.com/blog/2008/12/01/mayomo-map-your-moments/</link>
		<comments>http://www.stoimen.com/blog/2008/12/01/mayomo-map-your-moments/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 12:06:48 +0000</pubDate>
		<dc:creator>stoimen</dc:creator>
		
		<category><![CDATA[featured]]></category>

		<category><![CDATA[portfolio]]></category>

		<category><![CDATA[web development]]></category>

		<category><![CDATA[citizen journalism]]></category>

		<category><![CDATA[map]]></category>

		<category><![CDATA[mayomo]]></category>

		<category><![CDATA[moments]]></category>

		<category><![CDATA[web media]]></category>

		<guid isPermaLink="false">http://www.stoimen.com/blog/?p=122</guid>
		<description><![CDATA[please visit MaYoMo
]]></description>
			<content:encoded><![CDATA[<p>please visit <a href="http://mayomo.com">MaYoMo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stoimen.com/blog/2008/12/01/mayomo-map-your-moments/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to create a PHP Framework?</title>
		<link>http://www.stoimen.com/blog/2008/09/17/how-to-create-a-php-framework/</link>
		<comments>http://www.stoimen.com/blog/2008/09/17/how-to-create-a-php-framework/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 07:33:01 +0000</pubDate>
		<dc:creator>stoimen</dc:creator>
		
		<category><![CDATA[featured]]></category>

		<category><![CDATA[web development]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[learn]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[quick start]]></category>

		<guid isPermaLink="false">http://www.stoimen.com/blog/?p=119</guid>
		<description><![CDATA[A very good post on how a PHP framework can be build I found here. Everyone should be familiar with the basic principles described in the article, so don&#8217;t hesitate to read it carefully.
]]></description>
			<content:encoded><![CDATA[<p>A very good post on how a PHP framework can be build I found <a href="http://nettuts.com/php/creating-a-php5-framework-part-1/">here</a>. Everyone should be familiar with the basic principles described in the article, so don&#8217;t hesitate to read it carefully.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stoimen.com/blog/2008/09/17/how-to-create-a-php-framework/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Zend Framework - quick tutorial (part 2)</title>
		<link>http://www.stoimen.com/blog/2008/08/11/zend-framework-quick-tutorial-part-2-directory-layout-and-bootstrapping/</link>
		<comments>http://www.stoimen.com/blog/2008/08/11/zend-framework-quick-tutorial-part-2-directory-layout-and-bootstrapping/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 10:25:38 +0000</pubDate>
		<dc:creator>stoimen</dc:creator>
		
		<category><![CDATA[featured]]></category>

		<category><![CDATA[web development]]></category>

		<category><![CDATA[zend framework]]></category>

		<category><![CDATA[bootstrap.php]]></category>

		<category><![CDATA[directory layout]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[front controller]]></category>

		<category><![CDATA[quick start]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[zend]]></category>

		<category><![CDATA[__autoload]]></category>

		<guid isPermaLink="false">http://www.stoimen.com/blog/?p=55</guid>
		<description><![CDATA[Directory Layout and Bootstrapping.

When someone starts with the learning of a framework, first he begins to read various articles to understand the basic rules to work with.
There are a lot of tutorials how exactly to start, and there is also an official quick start guide, but beside this there are too much advices how should [...]]]></description>
			<content:encoded><![CDATA[<h2>Directory Layout and Bootstrapping.<br />
<a title="part 1 - introduction" href="http://www.stoimen.com/blog/2008/08/05/zend-framework-quick-tutorial-part-1-introduction/"></a></h2>
<p>When someone starts with the learning of a framework, first he begins to read various articles to understand the basic rules to work with.</p>
<p>There are a lot of tutorials how exactly to start, and there is also an official quick start guide, but beside this there are too much advices how should you directory layout look like.</p>
<p>For me the following directory layout is working well. I don&#8217;t remember exactly where I&#8217;ve found it, but I think many people use it.</p>
<blockquote>
<pre>
<ul>
<li>application
<ul>
<li>admin</li>
<li>controllers</li>
<li>models</li>
<li>views</li>
</ul>
</li>
<li>content
<ul>
<li>controllers</li>
<li>models</li>
<li>views</li>
</ul>
</li>
<li>layouts</li>
<li>bootstrap.php</li>
<li>config.ini</li>
<li>library</li>
<li>Zend</li>
<li>public</li>
<li>index.php</li>
</ul>
</pre>
</blockquote>
<p>Almost half of the sources &#8220;how to start&#8221; recommend all of the initialization should be in index.php in the public folder. In fact all the logic of the public/private folders is that we don&#8217;t like to show anything on the web, and that&#8217;s why index.php contains only the following peace of code (it&#8217;s recommended to leave the file open from the ?&gt; closing tag):</p>
<blockquote><p>&lt;?php<br />
require &#8216;../application/bootstrap.php&#8217;;</p>
</blockquote>
<p>Anything else, all the initialization is in bootstrap.php:</p>
<pre>error_reporting (E_ALL | E_STRICT);

ini_set ('display_startup_errors', 1);
ini_set ('display_errors', 1);

set_include_path ('../library' . PATH_SEPARATOR . get_include_path());

require_once "Zend/Loader.php";
Zend_Loader::registerAutoload();

$front = Zend_Controller_Front::getInstance();

$front-&gt;throwExceptions(true);

$front-&gt;setControllerDirectory(array('default' =&gt; '../application/content/controllers',
'admin'   =&gt; '../application/admin/controllers'));

$front-&gt;dispatch();</pre>
<p>We set the error reporting to be ON, which si good when you develop any application and to collect all error messages. Than add the <em>library </em>folder in the include path with that line of code:</p>
<blockquote><p>set_include_path(&#8217;../library&#8217; . PATH_SEPARATOR . get_include_path());</p>
</blockquote>
<p>Next step is to start the __autoload functionality built in Zend Framework:</p>
<blockquote><p>require_once &#8220;Zend/Loader.php&#8221;;<br />
Zend_Loader::registerAutoload();</p>
</blockquote>
<p>Finally start the front controller which implements the singleton pattern and point to the two main directories - admin and content. I used them for administration panel and front end, but you can used as many as you application needs:</p>
<blockquote><p>$front-&gt;setControllerDirectory(array(&#8217;default&#8217; =&gt; &#8216;../application/content/controllers&#8217;,<br />
&#8216;admin&#8217;   =&gt; &#8216;../application/admin/controllers&#8217;));</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.stoimen.com/blog/2008/08/11/zend-framework-quick-tutorial-part-2-directory-layout-and-bootstrapping/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why should we learn a framework?</title>
		<link>http://www.stoimen.com/blog/2008/08/04/why-you-should-learn-a-framework/</link>
		<comments>http://www.stoimen.com/blog/2008/08/04/why-you-should-learn-a-framework/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 08:21:17 +0000</pubDate>
		<dc:creator>stoimen</dc:creator>
		
		<category><![CDATA[featured]]></category>

		<category><![CDATA[web development]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[learn]]></category>

		<guid isPermaLink="false">http://www.stoimen.com/blog/?p=27</guid>
		<description><![CDATA[If anybody still asks should we learn a framework, I recommend him to read the recent post
of Ian P. Christian.
Before you start, however there are no recommendation there about which framework you&#8217;ve to choose, but he gives a good examples and advices why there&#8217;s no need to apply common design patters over and over again.
]]></description>
			<content:encoded><![CDATA[<p>If anybody still asks should we learn a framework, I recommend him to read the recent <a href="http://pookey.co.uk/blog/archives/56-Should-you-learn-a-framework.html">post</a><br />
of Ian P. Christian.</p>
<p>Before you start, however there are no recommendation there about which framework you&#8217;ve to choose, but he gives a good examples and advices why there&#8217;s no need to apply common design patters over and over again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stoimen.com/blog/2008/08/04/why-you-should-learn-a-framework/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Zend_Layout</title>
		<link>http://www.stoimen.com/blog/2008/07/31/zend-layout-dont-include-header-every-time/</link>
		<comments>http://www.stoimen.com/blog/2008/07/31/zend-layout-dont-include-header-every-time/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 12:50:38 +0000</pubDate>
		<dc:creator>stoimen</dc:creator>
		
		<category><![CDATA[featured]]></category>

		<category><![CDATA[web development]]></category>

		<category><![CDATA[zend_layout]]></category>

		<guid isPermaLink="false">http://www.stoimen.com/blog/?p=22</guid>
		<description><![CDATA[Или как да не пишем във всеки шаблон, че ще има header.
Всеки, който започва да използва нов web framework първоначално се запитва за няколко основни неща. Като цяло те и отговарят на MVC практиката.

Как да направим така че всичките ни състояния в сайта да бъдат описани в различни файлове, така че да можем лесно да [...]]]></description>
			<content:encoded><![CDATA[<h2>Или как да не пишем във всеки шаблон, че ще има header.</h2>
<p>Всеки, който започва да използва нов web framework първоначално се запитва за няколко основни неща. Като цяло те и отговарят на <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC</a> практиката.</p>
<ol>
<li>Как да направим така че всичките ни състояния в сайта да бъдат описани в различни файлове, така че да можем лесно да си намираме и поддържаме кода.</li>
<li>Как да се погрижим за правата и ролите на различните потребители на сайта.</li>
<li>Как да разделим html-а на няколко файла, за да не пишем по един милион пъти includes на header или footer.</li>
</ol>
<p>Почти всеки, който се е сблъсквал с PHP програмиране е чувал за <a href="http://www.smarty.net/">Smarty</a> и когато някой, по-често псевдо разбирач, ти изреди една плеяда колко е ретроградно да се слага php код измежду html таговете и как трябвало Smarty да се притече на помощ, ето един добър довод за излагане против Smarty.</p>
<p>Хубаво е да се ползва Smarty. Няма проблем. Само че нека си представим следния пример. Имаме сайт с header - content - footer. Като обикновено header-a съдържа разни връзки към css и meta тагове. Със Smarty като искаме да използваме тая структура за 10 файла, 10 пъти ще имаме следния код:</p>
<blockquote><p>{include file=&#8221;header.tpl&#8221;}</p>
<p>{include file=&#8221;content.tpl&#8221;}</p>
<p>{include file=&#8221;footer.tpl&#8221;}</p></blockquote>
<p>и ако това се повтаря в 100 файла, ще се наложи, няма как - 100 пъти едно и също за тоя header и footer.</p>
<p>След като и <a href="http://framework.zend.com/">Zend Framework</a> се е измъчил в по-предишни версии, доколкото разбирам, все пак аз отскоро се захванах с него и направо започнах от 1.5.3, сега проблемът се решава от <a href="http://framework.zend.com/manual/en/zend.layout.html">Zend_Layout</a>. A и сблъсквайки се с проблема с header-a и footer-a стигнаь до четене на няколко урока, от които разбрах, че хората преди са се опитвали да решат проблема с plugin към <a href="http://framework.zend.com/manual/en/zend.controller.front.html">Front Controller-а</a> и явно това е било разпространената практика.</p>
<p>Може би и на създателите на ZF им е станало ясно, че така няма да стане и затова се е погрижил Zend_Layout.</p>
<p>Дори сега се появяват уроци които се стремят да помогнат на решаването на този проблем с помощта на plugin, но аз препоръчвам да не се захваща никой с тях, въпреки че може на някой да му е интересно. Най-добре да се насочи към използването на Zend_Layout. За жалост пък при него поне официалната документация ми се видя недостатъчно, но пък намерих една <a href="http://static.zend.com/topics/ZendLayoutZendView.pdf">презентация</a> от <a href="http://devzone.zend.com/article/3311-Zend_Layout-and-Zend-_View-Enhancements-Webinar">webinar</a> на Zend.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stoimen.com/blog/2008/07/31/zend-layout-dont-include-header-every-time/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Treality Web Site</title>
		<link>http://www.stoimen.com/blog/2008/03/10/treality-web-site/</link>
		<comments>http://www.stoimen.com/blog/2008/03/10/treality-web-site/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 20:20:26 +0000</pubDate>
		<dc:creator>stoimen</dc:creator>
		
		<category><![CDATA[featured]]></category>

		<category><![CDATA[portfolio]]></category>

		<category><![CDATA[treality]]></category>

		<category><![CDATA[web site]]></category>

		<guid isPermaLink="false">http://www.stoimen.com/blog/archives/5</guid>
		<description><![CDATA[
Official web site of the company I&#8217;m working for. Treality.com is still beta but online. Take a look!
]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.stoimen.com/blog/wp-content/uploads/2008/09/treality.jpg" target="_blank"><img class="aligncenter size-full wp-image-100" title="treality" src="http://www.stoimen.com/blog/wp-content/uploads/2008/09/treality.jpg" alt="" width="465" height="350" /></a></p>
<p>Official web site of the company I&#8217;m working for. <a title="Treality Web Address" href="http://www.treality.com" target="_blank">Treality.com</a> is still beta but online. Take a look!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stoimen.com/blog/2008/03/10/treality-web-site/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Perl Regular Expressions</title>
		<link>http://www.stoimen.com/blog/2007/10/17/perl-regular-expressions/</link>
		<comments>http://www.stoimen.com/blog/2007/10/17/perl-regular-expressions/#comments</comments>
		<pubDate>Wed, 17 Oct 2007 11:45:53 +0000</pubDate>
		<dc:creator>stoimen</dc:creator>
		
		<category><![CDATA[featured]]></category>

		<category><![CDATA[web development]]></category>

		<category><![CDATA[perl]]></category>

		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://www.stoimen.com/blog/archives/4</guid>
		<description><![CDATA[perl regular expressions]]></description>
			<content:encoded><![CDATA[<p>For everyone who did write a code someday comes the question of using regular expressions. Almost everybody has heart about automatic and regular languages. Assume you have all word for a given languages, which means all possible combination between the letters of a given alphabet. For all these possible word only few construct the &#8220;language&#8221; as we know this term. Of course there&#8217;s also need of grammatic, etc. But however we have the set of words in a given language.</p>
<p>Than comes the task to find those of the words of the language that match a given condition. In fact the regular expressions are a powerful tool to do this job.</p>
<p>Using PHP you can use preg_ functions, which will perform a perl regular expressions match.  In my case I had to find in about 180 .html files specific words.</p>
<p>Assume the files contain something like:</p>
<pre>&lt;!-- wellformed html comment --&gt;</pre>
<pre>&lt;tr&gt;</pre>
<pre>&lt;td class="classname1"&gt;&lt;img ...&gt;&lt;/td&gt;

&lt;td class="classname2"&gt;

&lt;a ... &gt;

Word to match

&lt;/a&gt;

&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td ...&gt;&lt;/td&gt;

&lt;td ...&gt;&lt;/td&gt;

&lt;/tr&gt;

&lt;!--wellformed html comment--&gt;</pre>
<p>The regular expressions for <strong>preg_replace</strong> function I used was something like this:</p>
<pre>'/^[t|s]*&lt;tr&gt;.*?$n^.*?&lt;td.*?&lt;/td&gt;.*?$n.*?</pre>
<pre>&lt;td.*?$n.*?&lt;a.*?&gt;.*?$n.*?Word  to  match.*?$n.*?&lt;/a&gt;.*$n.*?&lt;/td&gt;.*$n.*?</pre>
<pre>&lt;/tr&gt;.*$n.*?&lt;tr.*$n.*?&lt;td.*$n.*?&lt;td.*$n.*?&lt;/tr&gt;/m'</pre>
<p>&#8230; and it worked for me. In fact if you use &#8217;s&#8217; instead of &#8216;m&#8217; modifier that&#8217;s gonna be you mistake cause of the multiple matches before the current tag you want to match.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stoimen.com/blog/2007/10/17/perl-regular-expressions/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
