<?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>Symfony Vietnam</title>
	<atom:link href="http://www.symfony.vn/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.symfony.vn/blog</link>
	<description>Cộng đồng người sử dụng Symfony tại Việt Nam</description>
	<pubDate>Sun, 06 Jul 2008 13:39:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>Clip.vn đã fix 1 bug bự</title>
		<link>http://www.symfony.vn/blog/?p=66</link>
		<comments>http://www.symfony.vn/blog/?p=66#comments</comments>
		<pubDate>Sun, 06 Jul 2008 13:36:56 +0000</pubDate>
		<dc:creator>An Vũ</dc:creator>
		
		<category><![CDATA[News]]></category>

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

		<category><![CDATA[clip.vn]]></category>

		<guid isPermaLink="false">http://www.symfony.vn/blog/?p=66</guid>
		<description><![CDATA[Nội dung file http://clip.vn/crossdomain.xml đã xóa đi dòng
&#60;allow-access-from domain=&#8221;*&#8221;/&#62;
Người xóa đi dòng này cho clip.vn hẳn phải được vega vinh danh vì đã tiết kiệm được rất nhiều tiền bạc đầu tư phần cứng cho vega. Tôi không rõ có ai biết được bug đó để lợi dụng DDoS không, rất có thể đã có [...]]]></description>
			<content:encoded><![CDATA[<p>Nội dung file <a href="http://clip.vn/crossdomain.xml" target="_blank">http://clip.vn/crossdomain.xml</a> đã xóa đi dòng</p>
<p>&lt;allow-access-from domain=&#8221;*&#8221;/&gt;</p>
<p>Người xóa đi dòng này cho clip.vn hẳn phải được vega vinh danh vì đã tiết kiệm được rất nhiều tiền bạc đầu tư phần cứng cho vega. Tôi không rõ có ai biết được bug đó để lợi dụng DDoS không, rất có thể đã có bởi vì tôi có nghe tin clip.vn chuyển data center để nâng cấp đường truyền. Cá nhân tôi tận dụng bug này để viết flash player cho <a href="http://www.get.vn/video" target="_blank">GET Video</a> nhằm tránh quảng cáo từ flash player của clip.vn, tiếc là áp dụng được lâu <img src='http://www.symfony.vn/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Bài học: <strong>Đôi khi chỉ cần 1 dòng code cũng tiết kiệm được rất nhiều công sức và tiền bạc.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.symfony.vn/blog/?feed=rss2&amp;p=66</wfw:commentRss>
		</item>
		<item>
		<title>bash completion với symfony</title>
		<link>http://www.symfony.vn/blog/?p=65</link>
		<comments>http://www.symfony.vn/blog/?p=65#comments</comments>
		<pubDate>Fri, 27 Jun 2008 03:25:42 +0000</pubDate>
		<dc:creator>An Vũ</dc:creator>
		
		<category><![CDATA[Guide]]></category>

		<category><![CDATA[bash completion]]></category>

		<guid isPermaLink="false">http://www.symfony.vn/blog/?p=65</guid>
		<description><![CDATA[Nếu bạn sử dụng linux hoặc DOS, chắc hẳn bạn đã biết tính năng bash completion là 1 tính năng tiện lợi đối với việc gõ lệnh, nó giúp bạn gõ nhanh mà không phải nhớ quá nhiều thứ. Ví dụ tôi muốn gõ lệnh symfony, thay vì phải gõ đầy đủ thì tôi chỉ [...]]]></description>
			<content:encoded><![CDATA[<p>Nếu bạn sử dụng linux hoặc DOS, chắc hẳn bạn đã biết tính năng bash completion là 1 tính năng tiện lợi đối với việc gõ lệnh, nó giúp bạn gõ nhanh mà không phải nhớ quá nhiều thứ. Ví dụ tôi muốn gõ lệnh symfony, thay vì phải gõ đầy đủ thì tôi chỉ cần gõ <strong>sym&lt;tab&gt;</strong> thì linux sẽ tự động thay bằng symfony. Nếu trong trường hợp có nhiều kết quả, nó sẽ hiện ra những trường hợp có thể có. Ví dụ tôi gõ sy&lt;tab&gt;&lt;tab&gt;, kết quả hiện ra sẽ là</p>
<div class="dean_ch" style="white-space: wrap;">
symfony &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; syslogd<br />
synaptic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;syslogd-listfiles<br />
sync &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;syslog-facility<br />
synclient &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; system-config-printer<br />
syndaemon &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; system-config-printer-applet<br />
sysctl &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;system-tools-backends<br />
&nbsp;</div>
<p>Để linux có thể gợi ý tiếp những option khác cho symfony, ví dụ như <strong>symfony init-app frontend</strong>, bạn cần tạo 1 file /etc/bash_completion.d/symfony như sau:</p>
<div class="dean_ch" style="white-space: wrap;">
_symfony()<br />
{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; local cur prev action<br />
&nbsp; COMREPLY=() &nbsp; <br />
&nbsp; cur=${COMP_WORDS[COMP_CWORD]}<br />
&nbsp; prev=${COMP_WORDS[COMP_CWORD-1]}<br />
&nbsp; action=${COMP_WORDS[1]}<br />
&nbsp; <br />
&nbsp; case &quot;$prev&quot; in<br />
&nbsp; &nbsp; init-module|propel-generate-crud|propel-init-crud|propel-init-admin|propel-load-data|propel-build-all-load)<br />
&nbsp; &nbsp; &nbsp; COMPREPLY=( $( compgen -W &quot;$( ls &#8211;color=n -1 apps 2&gt;/dev/null| sed -e &#8217;s/ /\\ /g&#8217; )&quot; &#8212; $cur ))<br />
&nbsp; &nbsp; &nbsp; return 0<br />
&nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; init-project)<br />
&nbsp; &nbsp; &nbsp; COMPREPLY=( $( compgen -W &quot;$( basename $PWD )&quot; &#8212; $cur ))<br />
&nbsp; &nbsp; &nbsp; return 0<br />
&nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; init-app)<br />
&nbsp; &nbsp; &nbsp; COMPREPLY=( $( compgen -W &quot;frontend backend&quot; &#8212; $cur))<br />
&nbsp; &nbsp; &nbsp; return 0<br />
&nbsp; &nbsp; ;; &nbsp; &nbsp;<br />
&nbsp; &nbsp; symfony)<br />
&nbsp; &nbsp; &nbsp; COMPREPLY=( $( compgen -W &quot;$( symfony -T | awk &#8216;/^ &nbsp;/&#8217; | cut -d&#8217; &#8216; -f3 )&quot; &#8212; $cur ) )<br />
&nbsp; &nbsp; &nbsp; return 0<br />
&nbsp; &nbsp; ;; &nbsp; &nbsp;<br />
&nbsp; &nbsp; plugin-install)<br />
&nbsp; &nbsp; COMPREPLY=( $( compgen -W &#8216;local global&#8217; &#8212; $cur ) )<br />
&nbsp; &nbsp; return 0<br />
&nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; global|local)<br />
&nbsp; &nbsp; COMPREPLY=( $( compgen -W &#8217;symfony/&#8217; ) )<br />
&nbsp; &nbsp; return 0<br />
&nbsp; &nbsp; ;; </p>
<p>&nbsp; &nbsp; *)<br />
&nbsp; &nbsp; &nbsp; case &quot;$action&quot; in<br />
&nbsp; &nbsp; &nbsp; &nbsp; propel-generate-crud|propel-init-crud|propel-init-admin)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (($COMP_CWORD == 3)); then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COMPREPLY=( $( compgen -W &quot;$( find lib/model -maxdepth 1 -name &#8216;*.php&#8217; -exec basename {} .php \; |grep -v Peer\$| tr [:upper:] [:lower:] )&quot; &#8212; $cur ) )<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elif (($COMP_CWORD == 4)); then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COMPREPLY=( $( compgen -W &quot;$( find lib/model -maxdepth 1 -name &#8216;*.php&#8217; -exec basename {} .php \; |grep -v Peer\$ )&quot; &#8212; $cur ) )<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fi<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; esac<br />
&nbsp; &nbsp; &nbsp; return 0<br />
&nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; sync)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (($COMP_CWORD == 3)); then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COMPREPLY=( $( compgen -W &#8216;go&#8217; &#8212; $cur))<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fi<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; <br />
&nbsp; esac</p>
<p>
&nbsp; &nbsp; return 0 &nbsp;<br />
}<br />
&nbsp; &nbsp; &nbsp; &nbsp;<br />
complete -F _symfony symfony</p>
<p>&nbsp;</p></div>
<p>sau đó đóng terminal rồi bật lên lại là mọi thứ đã hoạt động.</p>
<p>Test thử xem nào:<br />
sym&lt;tab&gt;</p>
<div class="dean_ch" style="white-space: wrap;">symfony</div>
<p>symfony &lt;tab&gt;</p>
<div class="dean_ch" style="white-space: wrap;">
app &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;init-batch<br />
batch &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;init-controller<br />
cc &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; init-module<br />
clear-cache &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;init-project<br />
clear-controllers &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;log-purge<br />
controller &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; log-rotate<br />
disable &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;module<br />
doctrine-build-all &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new<br />
doctrine-build-all-load &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;plugin-install<br />
doctrine-build-all-reload &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;plugin-list<br />
doctrine-build-db &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;plugin-uninstall<br />
doctrine-build-model &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; plugin-upgrade<br />
doctrine-build-schema &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;propel-build-all<br />
doctrine-build-sql &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; propel-build-all-load<br />
doctrine-convert-schema &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;propel-build-db<br />
doctrine-dql &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; propel-build-model<br />
doctrine-drop-db &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; propel-build-schema<br />
doctrine-dump-data &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; propel-build-sql<br />
doctrine-generate-crud &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; propel-convert-xml-schema<br />
doctrine-generate-migration &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;propel-convert-yml-schema<br />
doctrine-generate-migrations-db &nbsp; &nbsp; &nbsp;propel-dump-data<br />
doctrine-generate-migrations-models &nbsp;propel-generate-crud<br />
doctrine-init-admin &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;propel-init-admin<br />
&#8211;More&#8211;<br />
&nbsp;</div>
<p>symfony doc&lt;tab&gt;</p>
<div class="dean_ch" style="white-space: wrap;">
symfony doctrine-<br />
&nbsp;</div>
<p>symfony doctrine-ini&lt;tab&gt;</p>
<div class="dean_ch" style="white-space: wrap;">
symfony doctrine-init-admin<br />
&nbsp;</div>
<p>haha, have fun!</p>
<p>Thảm khảo:</p>
<ul>
<li><a href="http://trac.symfony-project.com/wiki/BashCompletion">Bash Completion</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.symfony.vn/blog/?feed=rss2&amp;p=65</wfw:commentRss>
		</item>
		<item>
		<title>Get Video phiên bản mới</title>
		<link>http://www.symfony.vn/blog/?p=64</link>
		<comments>http://www.symfony.vn/blog/?p=64#comments</comments>
		<pubDate>Mon, 23 Jun 2008 15:55:21 +0000</pubDate>
		<dc:creator>An Vũ</dc:creator>
		
		<category><![CDATA[News]]></category>

		<category><![CDATA[get video]]></category>

		<guid isPermaLink="false">http://www.symfony.vn/blog/?p=64</guid>
		<description><![CDATA[Get Video là website tìm kiếm và download video, phần frontend được viết bằng symfony.

Get Video vừa đạt mốc 20 triệu video, bổ sung thêm tính năng advanced search cho phép tìm kiếm với nhiều tiêu chí, bao gồm:

- Tìm theo tiêu đề, mô tả, tag

- Tìm theo website
- Tìm theo thể loại
- Tìm theo [...]]]></description>
			<content:encoded><![CDATA[<div><a href="http://www.get.vn/video" target="_blank">Get Video</a> là website tìm kiếm và download video, phần frontend được viết bằng symfony.</div>
<div></div>
<div><a href="http://www.get.vn/video" target="_blank">Get Video</a> vừa đạt mốc <strong>20 triệu video</strong>, bổ sung thêm tính năng <a href="http://www.get.vn/video/advanced-search" target="_blank">advanced search</a> cho phép tìm kiếm với nhiều tiêu chí, bao gồm:
</div>
<div>- Tìm theo tiêu đề, mô tả, tag
</div>
<div>- Tìm theo website<br />
- Tìm theo thể loại<br />
- Tìm theo người gửi<br />
- Tìm theo độ dài của video (duration)<br />
và hỗ trợ sắp xếp kết quả theo độ chính xác hoặc độ dài của video.</div>
<div>
<p>Điều này rất tiện lợi cho các bạn có nhu cầu tìm phim (độ dài video thường trong khoảng 4-20 phút hoặc trên 20 phút).</p>
<p>Mong nhận được ý kiến đóng góp và sự ủng hộ của các bạn <img class="inlineimg" title="Smilie" src="http://ddth.com/images/smilies/smile.gif" border="0" alt="" /></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.symfony.vn/blog/?feed=rss2&amp;p=64</wfw:commentRss>
		</item>
		<item>
		<title>Yahoo! Answer sử dụng symfony</title>
		<link>http://www.symfony.vn/blog/?p=63</link>
		<comments>http://www.symfony.vn/blog/?p=63#comments</comments>
		<pubDate>Sat, 17 May 2008 01:41:18 +0000</pubDate>
		<dc:creator>An Vũ</dc:creator>
		
		<category><![CDATA[News]]></category>

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

		<category><![CDATA[yahoo answer]]></category>

		<guid isPermaLink="false">http://www.symfony.vn/blog/?p=63</guid>
		<description><![CDATA[From symfony project weblog
Yahoo! used symfony to redevelop another project. This time symfony was used as part of the foundation for Yahoo! Answers. Yahoo! Answers is the largest collection of human knowledge on the Web with more than 135 million users and 515 million answers worldwide. Yahoo! Answers is the 2nd ranked education &#38; reference [...]]]></description>
			<content:encoded><![CDATA[<p>From <a href="http://www.symfony-project.org/blog/2008/05/08/yahoo-answers-powered-by-symfony" target="_blank">symfony project weblog</a></p>
<blockquote><p><a title="Yahoo!" href="http://yahoo.com/">Yahoo!</a> used symfony to redevelop another project. This time symfony was used as part of the foundation for <a title="Yahoo! Answers" href="http://answers.yahoo.com/">Yahoo! Answers</a>. <a title="Yahoo! Answers" href="http://answers.yahoo.com/">Yahoo! Answers</a> is the largest collection of human knowledge on the Web with more than 135 million users and 515 million answers worldwide. <a title="Yahoo! Answers" href="http://answers.yahoo.com/">Yahoo! Answers</a> is the 2nd ranked education &amp; reference site on the web and is available in 26 markets and 12 languages.</p>
<p>Why did Yahoo! choose symfony for another large web application project?</p>
<p><strong>Philosophy<br />
</strong></p>
<ul>
<li>Full-stack framework for building complex web applications</li>
<li>Adopt best ideas from anywhere, using existing code if available (Mojavi, Prado, Rails, Django)</li>
</ul>
<p><strong>Design</strong></p>
<ul>
<li>Clean separation between Model, View, and Controller</li>
<li>Controller using modules and actions</li>
<li>Views using templates in straight PHP with helpers</li>
<li>Easy to reuse view modules to compose a page (Layouts, Components, Partials, Slots)</li>
</ul>
<p><strong>Configurability / Flexibility<br />
</strong></p>
<ul>
<li>Features we do not want are easily disabled</li>
<li>Use of factories for easy customization</li>
</ul>
<p><strong>Documentation / Support Community</strong></p>
<ul>
<li>The Definitive Guide to symfony (free online)</li>
<li>Excellent tutorials and example applications - Askeet</li>
<li>Active community with wiki, mailing lists, forums, irc channel</li>
</ul>
<p>Once again symfony fits the requirements of an enterprise web application. Dustin Whittle of Yahoo! presented <a title="A symfony Answer @ Web 2.0 Expo" href="http://en.oreilly.com/webexsf2008/public/schedule/detail/2368">a case study on redeveloping Y! Answers.</a> The focus was how to work with open source tools to create a complete framework (PHP, JS, CSS) for the enterprise. He used his experience redeveloping Yahoo! Answers with symfony and Yahoo! User Interface libraries as a case study. <a href="http://www.slideshare.net/dustin.whittle/a-symfony-answer/download">Download the presentation from slideshare</a>.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.symfony.vn/blog/?feed=rss2&amp;p=63</wfw:commentRss>
		</item>
		<item>
		<title>chacha.vn sử dụng symfony</title>
		<link>http://www.symfony.vn/blog/?p=62</link>
		<comments>http://www.symfony.vn/blog/?p=62#comments</comments>
		<pubDate>Wed, 09 Apr 2008 15:43:40 +0000</pubDate>
		<dc:creator>An Vũ</dc:creator>
		
		<category><![CDATA[News]]></category>

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

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

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

		<guid isPermaLink="false">http://www.symfony.vn/blog/?p=62</guid>
		<description><![CDATA[Tôi đã từng nghe Huy nói về việc Vega sử dụng symfony trong các project của họ, tuy nhiên cụ thể thì không biết họ dùng symfony trong dự án nào. Huy có nói với tôi Vega có ý định viết lại clip.vn bằng symfony, và hôm nay, tình cờ khi nghe nhạc trên chacha.vn, [...]]]></description>
			<content:encoded><![CDATA[<p>Tôi đã từng nghe <a href="http://imhuy.wordpress.com" target="_blank">Huy</a> nói về việc <a href="http://vega.com.vn/" target="_blank">Vega</a> sử dụng symfony trong các project của họ, tuy nhiên cụ thể thì không biết họ dùng symfony trong dự án nào. Huy có nói với tôi Vega có ý định viết lại <a href="http://clip.vn" target="_blank">clip.vn</a> bằng symfony, và hôm nay, tình cờ khi nghe nhạc trên <a href="http://chacha.vn" target="_blank">chacha.vn</a>, tôi phát hiện ra chacha cũng được viết dựa trên symfony nhờ 1 thông báo lỗi mà họ đã sơ ý để lộ.</p>
<p><span id="more-62"></span></p>
<p>Trong bài viết này, tôi sẽ cố gắng xem xét thông tin của các thông báo lỗi này để phân tích hoạt động của nó.</p>
<p>Đầu tiên là thông báo lỗi không thể connect vào database:</p>
<blockquote><p>[PropelException]<br />
[wrapped: [wrapped: connect failed [Native Error: Can&#8217;t connect to MySQL server on &#8216;192.168.1.31&#8242; (4)] [User Info: Array]]]</p></blockquote>
<p>Thông báo này cho thấy MySQL server là 1 server khác, đặt trong cùng mạng LAN, được đánh địa chỉ 192.168.1.31 và ORM mà họ sử dụng là propel.</p>
<p>Phần hấp dẫn tôi hơn cả chính là stack strace:</p>
<blockquote><p>* at ()<br />
in SF_ROOT_DIR/lib/model/sm_sql/mysql_connect.php line 29 &#8230;<br />
26.             if ($con)$con-&gt;rollback();<br />
27.             Propel::log($e-&gt;getMessage(), Propel::LOG_ERR);<br />
28.             //sfContext::getInstance()-&gt;getController()-&gt;forward(&#8217;home&#8217;,'mysqlError&#8217;);<br />
29.             throw new PropelException($e);<br />
30.<br />
31.         }<br />
32.         return $rs;<br />
* at getData(&#8217;SELECT artist.id AS artistId, artist.name AS artistName, artist.avatar_path AS avatarPath, artist.description AS description, artist.type AS type FROM artist WHERE artist.id = &#8221;&#8217;)<br />
in SF_ROOT_DIR/lib/model/ArtistPeer.php line 34 &#8230;<br />
31.               WHERE artist.id = &#8216;.$artistId;<br />
32.<br />
33.<br />
34.       $resultSet = getData($sql);<br />
35.       return $resultSet;<br />
36.   }<br />
37.<br />
* at ArtistPeer::getArtistDetail(&#8217;441&#8242;)<br />
in SF_ROOT_DIR/apps/frontend/modules/artist/actions/actions.class.php line 61 &#8230;<br />
58.    */<br />
59.   private function getCommonData($artistId)<br />
60.   {<br />
61.       $this-&gt;artistDetail               = ArtistPeer::getArtistDetail($artistId);<br />
62.       $this-&gt;artistDetail-&gt;next();<br />
63.       $this-&gt;artistDetail               = $this-&gt;artistDetail-&gt;getRow();<br />
64.       $this-&gt;forward404If(!$this-&gt;artistDetail, ARTIST_NOT_EXIST);<br />
* at artistActions-&gt;getCommonData(&#8217;441&#8242;)<br />
in SF_ROOT_DIR/apps/frontend/modules/artist/actions/actions.class.php line 189 &#8230;<br />
186.       $this-&gt;page         = $this-&gt;getRequestParameter(&#8217;songPage&#8217;);   //current page number of the listSong<br />
187.<br />
188.       //get common data<br />
189.       $this-&gt;getCommonData($this-&gt;artistId);<br />
190.<br />
191.       //the total song of artist<br />
192.       $songs                 = null;</p></blockquote>
<p>Đi ngược từ dưới lên trên ta sẽ thấy ở dòng 189 của file actions.class.php gọi hàm getCommonData() ở dòng 50 để lấy dữ liệu. Ở dòng 61 gọi ArtistPeer::getArtistDetail($artistId); để lấy 1 artist dựa theo $artistId. Lần lên phát nữa thì &#8230; mém té ghế vì các bác developer bên Vega tự viết câu SQL cho một lệnh hết sức đơn giản mà propel đã support sẵn. Việc này chẳng khác mua ô tô về để đẩy, mua xe máy về để dắt. Xài propel chỉ biết để cho có. Pó tay =))</p>
<p>Nhìn kĩ lại 1 chút thì rõ ràng các developer này vẫn chưa nhận thức được tầm quan trọng của việc tách riêng các action ra thành từng file riêng thay vì gộp lại chung 1 file (actions.class.php) trong việc làm việc nhóm.</p>
<p>Chán nản, kéo xuống cuối của stack trace lại gặp thêm 1 dòng củ chuối:</p>
<blockquote><p>require_once(SF_LANG_DIR.&#8217;lang_vn.php&#8217;);</p></blockquote>
<p>trong file index.php</p>
<p>Bó tay toàn tập, không hiểu các bác này đã đọc chương về i18n chưa nữa.</p>
<p>Còn 1 số thông tin khác có giá trị bao gồm: phiên bản symfony (1.0.8), phiên bản PHP: 5.2.5</p>
<p>Việc để xuất hiện lỗi này cho thấy database server của chacha đã quá tải dẫn đến việc propel không chờ được và throw exception. Người quản trị server và developer đã không disable tính năng thông báo lỗi của php khiến cho tôi tình cờ bắt được.</p>
<p><strong>Bài học:</strong></p>
<ul>
<li>Disable tính năng thông báo lỗi của PHP</li>
<li>Đọc kĩ tài liệu của symfony, tránh lặp lại những thứ đã có</li>
<li>Tận dụng tính năng cache ở mức tối đa nhằm giảm tải cho hệ thống, đặc biệt là database server.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.symfony.vn/blog/?feed=rss2&amp;p=62</wfw:commentRss>
		</item>
		<item>
		<title>symfony 1.0.13 is out</title>
		<link>http://www.symfony.vn/blog/?p=61</link>
		<comments>http://www.symfony.vn/blog/?p=61#comments</comments>
		<pubDate>Tue, 01 Apr 2008 19:52:39 +0000</pubDate>
		<dc:creator>An Vũ</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.symfony.vn/blog/uncategorized/symfony-1013-is-out/</guid>
		<description><![CDATA[From symfony weblog
symfony 1.0.13 has been released to fix an important bug in the tag helper.
Strings were incorrectly escaped due to the change r7900 the 1.0.12 release. The missing regression test has now been added and the bug is fixed. The 1.1 branche has also been updated.
Here is the changelog :
* r8176: Fixes #3206 - [...]]]></description>
			<content:encoded><![CDATA[<p>From symfony weblog</p>
<blockquote><p>symfony 1.0.13 has been released to fix an important bug in the tag helper.</p>
<p>Strings were incorrectly escaped due to the change r7900 the 1.0.12 release. The missing regression test has now been added and the bug is fixed. The 1.1 branche has also been updated.</p>
<p>Here is the changelog :</p>
<p>* r8176: Fixes #3206 - Simple quotes are no more escaped by Tag helper escaping<br />
* r8045: 1.0: added warning to sfPropelUniqueValidator (refs #2467)</p>
<p>We do advise you to update as soon as you can.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.symfony.vn/blog/?feed=rss2&amp;p=61</wfw:commentRss>
		</item>
		<item>
		<title>symfony 1.0.12 is (finally) out !</title>
		<link>http://www.symfony.vn/blog/?p=60</link>
		<comments>http://www.symfony.vn/blog/?p=60#comments</comments>
		<pubDate>Sat, 22 Mar 2008 01:55:34 +0000</pubDate>
		<dc:creator>An Vũ</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.symfony.vn/blog/news/symfony-1012-is-finally-out/</guid>
		<description><![CDATA[from symfony project weblog:
After two months and more than 30 tickets closed, the 1.0.12 comes with spring. As it fixes an important security issue and windows plugins problems, we do strongly advise you to update your projects.
 Here is the changelog :
* r8019: sfWebRequest handles multi-dimensional file input fields (backported from 1.1) (closes #2009)
* r8010: [...]]]></description>
			<content:encoded><![CDATA[<p>from symfony project weblog:</p>
<blockquote><p>After two months and more than 30 tickets closed, the 1.0.12 comes with spring. As it fixes an important security issue and windows plugins problems, we do strongly advise you to update your projects.</p>
<p> Here is the changelog :</p>
<p>* r8019: sfWebRequest handles multi-dimensional file input fields (backported from 1.1) (closes #2009)<br />
* r8010: 1.0: merged fix for potential php notice (closes #3168)<br />
* r8006: fixed plugin-install command on windows (closes #2590)<br />
* r7999: button_to produces invalid XHTML (closes #3113)<br />
* r7997: admin generator handles plain fields (closes #2935)<br />
* r7977: fixed view cache doesn&#8217;t accept zero client lifetime (closes #3141)<br />
* r7850: fixed default error_reporting values (PHP 5.2 has a new constant) (closes #3098)<br />
* r7831: fixed inclusion of generator.yml for every module (closes #1949)<br />
* r7802: fixed &#8220;Cannot unset string offsets&#8221; error<br />
* r7769: Etag was not checking correctly the enclosing quotes. (closes #3065)<br />
* r7762: fixed web debug toolbar segfaults PHP when debugging using xdebug<br />
* r7665: correction in DateFormHelper? (fixes #3023)<br />
* r7620: added instructions to allow periods in routes (closes #2295)<br />
* r7589: fixed sfNumberValidator to reject hexadecimal values (closes #2741)<br />
* r7547: fixed uri encoding / xhtml error (closes #2968)<br />
* r7541: fixed hebrew calender language file for 1.0 (closes #2970)</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.symfony.vn/blog/?feed=rss2&amp;p=60</wfw:commentRss>
		</item>
		<item>
		<title>Sơ lược về cache trong symfony</title>
		<link>http://www.symfony.vn/blog/?p=56</link>
		<comments>http://www.symfony.vn/blog/?p=56#comments</comments>
		<pubDate>Tue, 18 Mar 2008 23:46:36 +0000</pubDate>
		<dc:creator>An Vũ</dc:creator>
		
		<category><![CDATA[Guide]]></category>

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

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

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

		<guid isPermaLink="false">http://www.symfony.vn/blog/guide/symfony-cache/</guid>
		<description><![CDATA[Symfony cung cấp 1 cơ chế cache rất mềm dẻo nhưng mặc định cache không được bật. Vì vậy có rất nhiều lầm tưởng rằng hệ thống xây dựng trên symfony chạy chậm. Bài viết này xin giới thiệu sơ lược về các cơ chế cache mà symfony cung cấp.
Để bật chức năng cache, mở [...]]]></description>
			<content:encoded><![CDATA[<p>Symfony cung cấp 1 cơ chế cache rất mềm dẻo nhưng mặc định cache không được bật. Vì vậy có rất nhiều lầm tưởng rằng hệ thống xây dựng trên symfony chạy chậm. Bài viết này xin giới thiệu sơ lược về các cơ chế cache mà symfony cung cấp.</p>
<p><span id="more-56"></span>Để bật chức năng cache, mở file /apps/myapp/config/settings.yml và thêm vào:</p>
<div class="dean_ch" style="white-space: wrap;">dev:<br />
&nbsp; .settings:<br />
&nbsp; &nbsp; cache:                  on</div>
<p>Điều này có nghĩa rằng môi trường dev sẽ được bật chức năng cache. Để bật cache cho tất cả các môi trường, bạn thay <strong>dev</strong> bằng <strong>all</strong>. Khi chạy ở môi trường dev, những block được cache sẽ có viền màu bao quanh giúp bạn nhận biết phần nào đã được symfony cache.</p>
<h3>Cache action</h3>
<p>Để cache 1 action, mở file /apps/myapp/modules/mymodule/config/cache.yml và thêm các dòng sau:</p>
<div class="dean_ch" style="white-space: wrap;">list:<br />
&nbsp; enabled: &nbsp; &nbsp; on<br />
&nbsp; with_layout: false &nbsp; # Default value<br />
&nbsp; lifetime: &nbsp; &nbsp;86400 &nbsp; # Default value</div>
<p>trong đó list là tên action cần cache, enabled = on cho symfony biết cần phải cache action này, with_layout = false sẽ không cache layout và lifetime là thời gian cache tồn tại (hết thời gian này, cache sẽ được xóa và regenerate lại cache mới).<br />
Để cấu hình cho tất cả các action, bạn thay list bằng all. Ví dụ:</p>
<div class="dean_ch" style="white-space: wrap;">list:<br />
&nbsp; enabled: &nbsp; &nbsp;on<br />
show:<br />
&nbsp; enabled: &nbsp; &nbsp;on</p>
<p>all:<br />
&nbsp; with_layout: false &nbsp; # Default value<br />
&nbsp; lifetime: &nbsp; &nbsp;86400 &nbsp; # Default value</div>
<p>Bạn cũng nên chú ý rằng 2 trang http://myapp.example.com/user/show/id/12<br />
và http://myapp.example.com/user/show/id/25<br />
sẽ có 2 cache khác nhau và symfony không hỗ trợ việc cache cho các action gọi với tham số POST hoặc GET</p>
<h3>Cache component và partial</h3>
<p>Tương tự như action, bạn chỉ cần thay tên action bằng tên partial hoặc component. Ví dụ:</p>
<div class="dean_ch" style="white-space: wrap;">_my_partial:<br />
&nbsp; enabled: &nbsp; &nbsp;on<br />
list:<br />
&nbsp; enabled: &nbsp; &nbsp;on</div>
<p>trong đó my_partial là tên partial hoặc component. Dĩ nhiên, với cache partial và component, tham số <strong>with_layout</strong> không có tác dụng.</p>
<h3>Cache 1 nhóm nhỏ</h3>
<p>Ví dụ:</p>
<p>[source:php]<!-- Code executed each time --><br />
<?php echo link_to('last accessed user', 'user/show?id='.$last_accessed_user_id) ?><br />
<!-- Cached code --><br />
<?php if (!cache('users')): ?><br />
  <?php foreach ($users as $user): ?><br />
    <?php echo $user- >getName() ?><br />
  <?php endforeach; ?><br />
  <?php cache_save() ?><br />
<?php endif; ?>[/source]</p>
<p>đoạn code trong template trên sẽ chỉ cache phần danh sách user.</p>
<p>Với cơ chế cấu hình cache trong file yaml giúp cho bạn hoàn toàn có thể xây dựng hệ thống xong rồi mới cần phải bắt tay vào cấu hình cache cho hệ thống. Thông tin chi tiết về cache và xóa cache được cung cấp đầy đủ trong <a href="http://www.symfony-project.org/book/1_0/12-Caching" target="_blank">chương 12 của cuốn The definitive guide to symfony</a>.</p>
<p>Để tăng tốc hệ thống hơn nữa, bạn có thể sử dụng plugin <a href="http://trac.symfony-project.com/wiki/sfMemcachePlugin" target="_blank">sfMemcachePlugin</a>. Plugin này có nhiệm vụ lưu cache vào memory thay vì vào đĩa cứng để tăng tốc hệ thống khi có số lượng người truy cập lớn.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.symfony.vn/blog/?feed=rss2&amp;p=56</wfw:commentRss>
		</item>
		<item>
		<title>Slide bài thuyết trình về symfony tại PHP Lodon Conference 2008</title>
		<link>http://www.symfony.vn/blog/?p=55</link>
		<comments>http://www.symfony.vn/blog/?p=55#comments</comments>
		<pubDate>Sun, 02 Mar 2008 23:58:18 +0000</pubDate>
		<dc:creator>An Vũ</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.symfony.vn/blog/news/symfony-at-php-lodon-conference-2008/</guid>
		<description><![CDATA[Ian P. Christian (aka &#8216;pookey&#8217;) đã có 1 buổi thuyết trình về symfony tại PHP Lodon Conference 2008. Bạn có thể download nội dung slide tại đây. Có lẽ vì thời gian quá hạn hẹp nên pookey không thể trình bày hết mọi vấn đề. Slide này rất tốt cho những ai muốn có 1 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://pookey.co.uk" target="_blank">Ian P. Christian</a> (aka &#8216;pookey&#8217;) đã có 1 buổi thuyết trình về symfony tại <a href="http://www.phpconference.co.uk/" target="_blank">PHP Lodon Conference 2008</a>. Bạn có thể <a href="http://pookey.co.uk/files/symfony.pdf" target="_blank">download nội dung slide tại đây</a>. Có lẽ vì thời gian quá hạn hẹp nên pookey không thể trình bày hết mọi vấn đề. Slide này rất tốt cho những ai muốn có 1 cái nhìn sơ lược về symfony.</p>
<p>Symfony Team cũng sẽ có nhiều buổi thuyết trình vào thời gian sắp tới. Cụ thể là</p>
<ul>
<li>Fabien: March 12-14: &#8220;The symfony platform: Create your very own framework&#8221; at the <a href="http://conf.phpquebec.org/fr/session#the_symfony_platform_create_your_very_own_framework">PHP Quebec conference</a>  (Quebec)</li>
<li>Fabien/Dustin: April 14-17: The symfony project will have a booth at the <a href="http://en.oreilly.com/mysql2008/public/content/exhibitors">MySQL conference</a>  (Santa Clara - California)</li>
<li>Dustin: April 22-25: &#8220;A Delicious Symfony&#8221; at the <a href="http://en.oreilly.com/webexsf2008/public/schedule/detail/2368">O&#8217;reilly Web2.0 Expo</a>  (San Francisco - California)</li>
<li>Fabien: May 23-24: &#8220;What&#8217;s new in symfony 1.1&#8243; at the <a href="http://www.phpday.it/site/2008/01/23/symfony-e-sensio-al-phpday/">PHPDay</a>  (Rimini - Italy)</li>
<li>Fabien/Stephan: June 13-14: &#8220;symfony Tutorial&#8221; at the <a href="http://www.phpconference.nl/workshops/">Dutch PHP Conference</a>  (Amsterdam)</li>
<li>Fabien: June 13-14: &#8220;symfony: The PHP platform for professionals&#8221; at the <a href="http://www.phpconference.nl/schedule/">Dutch PHP Conference</a>  (Amsterdam)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.symfony.vn/blog/?feed=rss2&amp;p=55</wfw:commentRss>
		</item>
		<item>
		<title>Đồng bộ symfony project với server sử dụng sync</title>
		<link>http://www.symfony.vn/blog/?p=54</link>
		<comments>http://www.symfony.vn/blog/?p=54#comments</comments>
		<pubDate>Fri, 01 Feb 2008 02:16:08 +0000</pubDate>
		<dc:creator>An Vũ</dc:creator>
		
		<category><![CDATA[Guide]]></category>

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

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

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

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

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

		<guid isPermaLink="false">http://www.symfony.vn/blog/guide/d%e1%bb%93ng-b%e1%bb%99-symfony-project-v%e1%bb%9bi-server-s%e1%bb%ad-d%e1%bb%a5ng-sync/</guid>
		<description><![CDATA[Một cách thường thấy để đưa project đã làm xong lên server là dùng ftp. Cách này có nhiều điểm dở vì tốc độ chậm và khi đưa lên server ta phải nhớ lần này ta đã sửa những file nào. Một cách chuyên nghiệp hơn là dùng rsync. Ưu điểm của rsync là xác [...]]]></description>
			<content:encoded><![CDATA[<p>Một cách thường thấy để đưa project đã làm xong lên server là dùng ftp. Cách này có nhiều điểm dở vì tốc độ chậm và khi đưa lên server ta phải nhớ lần này ta đã sửa những file nào. Một cách chuyên nghiệp hơn là dùng <a href="http://samba.anu.edu.au/rsync/" target="_blank">rsync</a>. Ưu điểm của rsync là xác định được file nào đã có và chỉ đưa lên server phần nội dung đã sửa chữa. Symfony tích hợp rsync sẵn với task sync cho phép bạn đồng bộ project của mình chỉ với 1 lệnh đơn giản.</p>
<p><span id="more-54"></span><br />
Điều kiện để sử dụng lệnh này là server của bạn phải hỗ trợ ssh.</p>
<p>Đầu tiên, cho symfony biết làm thế nào để connect vào server. Mở file /config/properties.ini và thêm vào</p>
<div class="dean_ch" style="white-space: wrap;">[production]<br />
&nbsp; host=www.domain.com<br />
&nbsp; port=22<br />
&nbsp; user=root<br />
&nbsp; dir=/var/www/projects/myproject</div>
<p>trong đó dir là thư mục sẽ được đồng bộ. <strong>Chú ý rằng symfony không tạo thư mục này cho bạn mà bạn phải tạo trước. Nếu cố chạy lệnh đồng bộ mà thư mục này chưa được tạo, sẽ có những file không mong muốn bị xóa</strong>.</p>
<p>Tiếp theo, cần cho symfony biết file nào không được đưa lên server. Mở file /config/rsync_exclude.txt và sửa lại</p>
<div class="dean_ch" style="white-space: wrap;">.svn<br />
.project<br />
.settings<br />
.cache<br />
/web/uploads/*<br />
/cache/*<br />
/log/*<br />
/config/config.php<br />
/web/frontend_dev.php</div>
<p>những dòng không bắt đầu bằng dấu / sẽ loại bỏ bất kì file, thư mục nào có tên như vậy. Những dòng bắt đầu bằng dấu / sẽ được tính từ thư mục của project. Ở đây có thể thấy tôi không muốn đưa lên những file trong thư mục /cache, /web/uploads và /log. Ngoài ra, trong file trên cũng có thể thấy file /config/config.php không được đưa lên vì file config.php ở máy của tôi khác với file config.php trên server. Vì lí do bảo mật, những file chạy trong môi trường <strong>dev</strong> cũng cần phải loại bỏ (frontend_dev.php).</p>
<p>Vậy là xong, bây giờ bạn có thể kiểm tra xem symfony sẽ đồng bộ như thế nào. Gõ lệnh</p>
<blockquote><p>symfony sync production</p></blockquote>
<p>trong đó production chính là thông số cấu hình bên trên. Sau khi chạy lệnh này, symfony sẽ tiến hành kiểm tra thư mục ở máy bạn và thư mục trên server, sau đó sẽ list ra những file nào cần upload, những file nào cần xóa. Nếu thấy không có vấn đề gì, bạn có thể đồng bộ thật sự bằng lệnh</p>
<blockquote><p>symfony sync production go</p></blockquote>
<p>Vậy là xong <img src='http://www.symfony.vn/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Tham khảo</strong></p>
<ul>
<li><a href="http://www.symfony-project.org/book/1_0/16-Application-Management-Tools#Using%20rsync%20for%20Incremental%20File%20Transfer" target="_blank">Using rsync for Incremental File Transfer</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.symfony.vn/blog/?feed=rss2&amp;p=54</wfw:commentRss>
		</item>
	</channel>
</rss>
