<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[[实践OK]php is_readable() 和is_dir()都有缓存，需要clearstatcacheoige空缓存，获取文件信息前最好清空状态缓存__clearstatcache，特别是file_put_contents这个拿来写日志的时候]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Fri, 30 Jul 2010 16:00:46 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	一）一定要有True，及FILE_APPEND：<br/><textarea name="code" class="php" rows="15" cols="100">file_put_contents(&quot;/tmp/jack.txt&quot;,var_export($curProcessor,True) ,FILE_APPEND);</textarea><br/>二）生成Curl Post格式的接口调试：<br/><textarea name="code" class="php" rows="15" cols="100">file_put_contents(&quot;/tmp/jack.txt&quot;,&quot;curl -d&#92;&quot;&quot;.http_build_query($data).&quot;&#92;&quot; &quot;.$url,FILE_APPEND);</textarea><br/>三）生成db的update加where的日志(Key作为数据库的字段，值为值，where也一样)：<br/><textarea name="code" class="php" rows="15" cols="100">
file_put_contents(&quot;/tmp/jack.txt&quot;,&quot;curl -d&#92;&quot;&quot;.http_build_query($updateDataArr).&quot;&#92;&quot; &quot;.var_export($whereArr,TRUE),FILE_APPEND);
</textarea><br/>一行完成Curl的POST输出：<br/>view plainprint?<br/>echo &quot;curl -d&#92;&quot;&quot;.http_build_query($data).&quot;&#92;&quot; &quot;.$url;&nbsp;&nbsp;<br/><br/>最近写一个infobright导入脚本的时候，需要判断文件超过一定大小2G时候，再建立一个文件，但在获取文件大小信息的时候，本来已经调用file_put_contents写入文件，但通过filesize获取文件大小的时候，大小还是没写入前的大小，后来发现原来php为了提高函数效率，会缓存之前文件信息，需调用 clearstatcache();来清除缓存，清除缓存后，再使用filesize函数获取的文件大小就正确了~~,正确调用过程如下：<br/><br/>file_put_contents($this-&gt;current_file, $data,FILE_APPEND);<br/>clearstatcache();<br/>if(filesize($this-&gt;current_file) &gt; self::$file_max_size)<br/>&#123;<br/>......<br/>&#125;<br/><br/>来源：http://hi.baidu.com/johntech/blog/item/50b23aebe3afb533b90e2d04.html
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践OK]php is_readable() 和is_dir()都有缓存，需要clearstatcacheoige空缓存，获取文件信息前最好清空状态缓存__clearstatcache，特别是file_put_contents这个拿来写日志的时候]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>