<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>阿維實驗室 &#187; tool</title>
	<atom:link href="http://lab.hsdn.net/blog/tag/tool/feed/" rel="self" type="application/rss+xml" />
	<link>http://lab.hsdn.net/blog</link>
	<description>阿維的實驗園地，這裡只討論程式沒有阿維的亂哈拉</description>
	<lastBuildDate>Wed, 18 Nov 2009 15:53:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Krumo: 簡單好用的PHP Debug工具</title>
		<link>http://lab.hsdn.net/blog/2009/11/krumo-%e7%b0%a1%e5%96%ae%e5%a5%bd%e7%94%a8%e7%9a%84php-debug%e5%b7%a5%e5%85%b7/</link>
		<comments>http://lab.hsdn.net/blog/2009/11/krumo-%e7%b0%a1%e5%96%ae%e5%a5%bd%e7%94%a8%e7%9a%84php-debug%e5%b7%a5%e5%85%b7/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 15:50:59 +0000</pubDate>
		<dc:creator>阿維</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[web develop]]></category>
		<category><![CDATA[除錯]]></category>

		<guid isPermaLink="false">http://lab.hsdn.net/blog/?p=92</guid>
		<description><![CDATA[寫程式最討厭的是程式發生錯誤，但是卻又不知道該從何debug起，我們通常會使用print_r 或者 var_dump 或者是 echo 慢慢的debug。如果你跟阿維一樣使用PHP 5開發，現在可以使用Krumo這個簡單好用的工具幫助我們做這件事情。
雖然IDE也有內建的debug工具，但是並不是每個人都使用IDE來進行PHP的開發，這時候Krumo就可以大展身手，即使使用IDE來開發，阿維相信Krumo也可以幫忙我們節省不少時間。但是由於Krumo只支援PHP 5，所以使用PHP 4的朋友只好說聲抱歉，或者是將PHP升級到5。
當我們下載Krumo之後，只需要將Krumo的路徑設定在INCLUDE_PATH或者是將完整路徑寫在class.krumo.php裡面，Krumo是使用CSS和樹狀目錄來顯示debug訊息，所以在krumo.ini這個設定檔裡面我們可以選擇我們想要使用的skin，debug工具也有skin可以選？沒錯，你沒有看錯，真的是這樣。
使用Krumo的方法
// print a debug backgrace
krumo::backtrace();
// print all the included(or required) files
krumo::includes();
// print all the included functions
krumo::functions();
// print all the declared classes
krumo::classes();
// print all the defined constants
krumo::defines();
此外我們也可以動態的開啟或關閉Krumo
// disable Krumo
krumo::disable();
// Krumo is disabled, nothing is printed
krumo::includes();
// enable Krumo
krumo::enable();
// Krumo is enable, printing is OK
krumo::classes();
Krumo 的debug畫面

1. Krumo 官方網站
2.  Krumo Document
3.  [...]]]></description>
			<content:encoded><![CDATA[<p>寫程式最討厭的是程式發生錯誤，但是卻又不知道該從何debug起，我們通常會使用print_r 或者 var_dump 或者是 echo 慢慢的debug。如果你跟阿維一樣使用<span style="color: #ff0000;">PHP 5</span>開發，現在可以使用<a href="http://krumo.kaloyan.info/" target="_blank">Krumo</a>這個簡單好用的工具幫助我們做這件事情。</p>
<p>雖然IDE也有內建的debug工具，但是並不是每個人都使用IDE來進行PHP的開發，這時候<a href="http://krumo.kaloyan.info/" target="_blank">Krumo</a>就可以大展身手，即使使用IDE來開發，阿維相信<a href="http://krumo.kaloyan.info/" target="_blank">Krumo</a>也可以幫忙我們節省不少時間。但是<span style="color: #ff0000;">由於</span><a href="http://krumo.kaloyan.info/" target="_blank"><span style="color: #ff0000;">Krumo</span></a><span style="color: #ff0000;">只支援PHP 5</span>，所以使用PHP 4的朋友只好說聲抱歉，或者是將PHP升級到5。</p>
<p>當我們下載<a href="http://krumo.kaloyan.info/" target="_blank">Krumo</a>之後，只需要將<a href="http://krumo.kaloyan.info/" target="_blank">Krumo</a>的路徑設定在<span style="color: #0000ff;">INCLUDE_PATH</span>或者是將<span style="color: #0000ff;">完整路徑</span>寫在<span style="color: #0000ff;">class.krumo.php</span>裡面，Krumo是使用CSS和樹狀目錄來顯示debug訊息，所以在<span style="color: #0000ff;">krumo.ini</span>這個設定檔裡面我們可以選擇我們想要使用的skin，debug工具也有skin可以選？沒錯，你沒有看錯，真的是這樣。</p>
<p><span style="font-size: medium;"><span style="color: #0000ff;"><strong>使用Krumo的方法</strong></span></span></p>
<p>// print a debug backgrace</p>
<p>krumo::backtrace();</p>
<p>// print all the included(or required) files</p>
<p>krumo::includes();</p>
<p>// print all the included functions</p>
<p>krumo::functions();</p>
<p>// print all the declared classes</p>
<p>krumo::classes();</p>
<p>// print all the defined constants</p>
<p>krumo::defines();</p>
<p><span style="color: #0000ff;"><strong><span style="font-size: medium;">此外我們也可以動態的開啟或關閉Krumo</span></strong></span></p>
<p>// disable Krumo</p>
<p>krumo::disable();</p>
<p>// Krumo is disabled, nothing is printed</p>
<p>krumo::includes();</p>
<p>// enable Krumo</p>
<p>krumo::enable();</p>
<p>// Krumo is enable, printing is OK</p>
<p>krumo::classes();</p>
<p><span style="font-size: medium;"><strong><span style="color: #0000ff;">Krumo 的debug畫面</span></strong></span></p>
<p><img class="alignnone" src="http://farm3.static.flickr.com/2515/4114425895_b716692cd0_o.png" alt="Krumo Dedug Tool" width="524" height="783" /><br />
1. <a href="http://krumo.kaloyan.info/" target="_blank">Krumo 官方網站</a></p>
<p>2.  <a href="http://krumo.kaloyan.info/docs/" target="_blank">Krumo Document</a></p>
<p>3.  <a href="http://krumo.kaloyan.info/demo/index.php" target="_blank">更多關於Krumo範例</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lab.hsdn.net/blog/2009/11/krumo-%e7%b0%a1%e5%96%ae%e5%a5%bd%e7%94%a8%e7%9a%84php-debug%e5%b7%a5%e5%85%b7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
