<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>评论：[CakePHP]如何关闭API页面的调试信息</title>
	<atom:link href="http://tech.idv2.com/2009/07/26/cakephp-close-debuginfo-in-api/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.idv2.com/2009/07/26/cakephp-close-debuginfo-in-api/</link>
	<description>关注Web开发技术，关注Internet。</description>
	<lastBuildDate>Fri, 03 Sep 2010 10:05:58 +0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>来自：jinhr</title>
		<link>http://tech.idv2.com/2009/07/26/cakephp-close-debuginfo-in-api/comment-page-1/#comment-161703</link>
		<dc:creator>jinhr</dc:creator>
		<pubDate>Fri, 11 Sep 2009 17:18:09 +0000</pubDate>
		<guid isPermaLink="false">http://tech.idv2.com/2009/07/26/cakephp-close-debuginfo-in-api/#comment-161703</guid>
		<description>思想上没错。我在自己的项目中，处理ajax请求时，是这样做的，利用了RequestHandler这个Component．

class AppController extends Controller
{
    /*** Components ***/

    var $components = array(&#039;RequestHandler&#039;);
    
    function beforeFilter()
    {
    	$this-&gt;_checkAjax();
    }

    /** check if ajax request, disable debug
     * and cache
     * @return unknown_type
     */ 
    function _checkAjax()
    {
        if ($this-&gt;RequestHandler-&gt;isAjax())
        {
            Configure::write(&#039;debug&#039;, 0);
            $this-&gt;disableCache();
        }
        return true;
    }

    /* others ...... */

｝
注意旧版的IE中要它发起ajax请求去拿最新数据，可浏览器总是拿过时的cache中的信息，所以只好在服务器端禁止浏览器的缓存．
我把代码写在/app/app_controller.php中了，所以所有controller中的的所有action都自动事先调用了它．</description>
		<content:encoded><![CDATA[<p>思想上没错。我在自己的项目中，处理ajax请求时，是这样做的，利用了RequestHandler这个Component．</p>
<p>class AppController extends Controller<br />
{<br />
    /*** Components ***/</p>
<p>    var $components = array(&#8217;RequestHandler&#8217;);</p>
<p>    function beforeFilter()<br />
    {<br />
    	$this-&gt;_checkAjax();<br />
    }</p>
<p>    /** check if ajax request, disable debug<br />
     * and cache<br />
     * @return unknown_type<br />
     */<br />
    function _checkAjax()<br />
    {<br />
        if ($this-&gt;RequestHandler-&gt;isAjax())<br />
        {<br />
            Configure::write(&#8217;debug&#8217;, 0);<br />
            $this-&gt;disableCache();<br />
        }<br />
        return true;<br />
    }</p>
<p>    /* others &#8230;&#8230; */</p>
<p>｝<br />
注意旧版的IE中要它发起ajax请求去拿最新数据，可浏览器总是拿过时的cache中的信息，所以只好在服务器端禁止浏览器的缓存．<br />
我把代码写在/app/app_controller.php中了，所以所有controller中的的所有action都自动事先调用了它．</p>
]]></content:encoded>
	</item>
	<item>
		<title>来自：jinhr</title>
		<link>http://tech.idv2.com/2009/07/26/cakephp-close-debuginfo-in-api/comment-page-1/#comment-161700</link>
		<dc:creator>jinhr</dc:creator>
		<pubDate>Fri, 11 Sep 2009 17:17:12 +0000</pubDate>
		<guid isPermaLink="false">http://tech.idv2.com/2009/07/26/cakephp-close-debuginfo-in-api/#comment-161700</guid>
		<description>思想上没错。我在自己的项目中，处理ajax请求时，是这样做的，利用了RequestHandler这个Component．

class AppController extends Controller
{
    /*** Components ***/

    var $components = array(&#039;RequestHandler&#039;);
    
    function beforeFilter()
    {
    	$this-&gt;_checkAjax();
    }

    /** check if ajax request, disable debug
     * and cache
     * @return unknown_type
     */ 
    function _checkAjax()
    {
        if ($this-&gt;RequestHandler-&gt;isAjax())
        {
            Configure::write(&#039;debug&#039;, 0);
            $this-&gt;disableCache();
        }
        return true;
    }

    /* others ...... */

｝</description>
		<content:encoded><![CDATA[<p>思想上没错。我在自己的项目中，处理ajax请求时，是这样做的，利用了RequestHandler这个Component．</p>
<p>class AppController extends Controller<br />
{<br />
    /*** Components ***/</p>
<p>    var $components = array(&#8217;RequestHandler&#8217;);</p>
<p>    function beforeFilter()<br />
    {<br />
    	$this-&gt;_checkAjax();<br />
    }</p>
<p>    /** check if ajax request, disable debug<br />
     * and cache<br />
     * @return unknown_type<br />
     */<br />
    function _checkAjax()<br />
    {<br />
        if ($this-&gt;RequestHandler-&gt;isAjax())<br />
        {<br />
            Configure::write(&#8217;debug&#8217;, 0);<br />
            $this-&gt;disableCache();<br />
        }<br />
        return true;<br />
    }</p>
<p>    /* others &#8230;&#8230; */</p>
<p>｝</p>
]]></content:encoded>
	</item>
	<item>
		<title>来自：bs hao</title>
		<link>http://tech.idv2.com/2009/07/26/cakephp-close-debuginfo-in-api/comment-page-1/#comment-78186</link>
		<dc:creator>bs hao</dc:creator>
		<pubDate>Wed, 12 Aug 2009 04:47:34 +0000</pubDate>
		<guid isPermaLink="false">http://tech.idv2.com/2009/07/26/cakephp-close-debuginfo-in-api/#comment-78186</guid>
		<description>http://www.phpgz.com/html/framework/kcakephp/index.html

参照一下这个cakephp的文章 .</description>
		<content:encoded><![CDATA[<p><a href="http://www.phpgz.com/html/framework/kcakephp/index.html" rel="nofollow">http://www.phpgz.com/html/framework/kcakephp/index.html</a></p>
<p>参照一下这个cakephp的文章 .</p>
]]></content:encoded>
	</item>
	<item>
		<title>来自：南 靖男</title>
		<link>http://tech.idv2.com/2009/07/26/cakephp-close-debuginfo-in-api/comment-page-1/#comment-30135</link>
		<dc:creator>南 靖男</dc:creator>
		<pubDate>Sun, 26 Jul 2009 12:42:31 +0000</pubDate>
		<guid isPermaLink="false">http://tech.idv2.com/2009/07/26/cakephp-close-debuginfo-in-api/#comment-30135</guid>
		<description>用 FirePHP 好了。
http://bakery.cakephp.org/articles/view/debugging-with-firephp</description>
		<content:encoded><![CDATA[<p>用 FirePHP 好了。<br />
<a href="http://bakery.cakephp.org/articles/view/debugging-with-firephp" rel="nofollow">http://bakery.cakephp.org/articles/view/debugging-with-firephp</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
