📄 function.clearstatcache.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Clears file status cache</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.chown.html">chown</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.copy.html">copy</a></div> <div class="up"><a href="ref.filesystem.html">Filesystem Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.clearstatcache" class="refentry"> <div class="refnamediv"> <h1 class="refname">clearstatcache</h1> <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">clearstatcache</span> — <span class="dc-title">Clears file status cache</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type"><span class="type void">void</span></span> <span class="methodname"><b><b>clearstatcache</b></b></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment"> When you use <a href="function.stat.html" class="function">stat()</a>, <a href="function.lstat.html" class="function">lstat()</a>, or any of the other functions listed in the affected functions list (below), PHP caches the information those functions return in order to provide faster performance. However, in certain cases, you may want to clear the cached information. For instance, if the same file is being checked multiple times within a single script, and that file is in danger of being removed or changed during that script's operation, you may elect to clear the status cache. In these cases, you can use the <b>clearstatcache()</b> function to clear the information that PHP caches about a file. </p> <p class="para"> You should also note that PHP doesn't cache information about non-existent files. So, if you call <a href="function.file-exists.html" class="function">file_exists()</a> on a file that doesn't exist, it will return <b><tt>FALSE</tt></b> until you create the file. If you create the file, it will return <b><tt>TRUE</tt></b> even if you then delete the file. However <a href="function.unlink.html" class="function">unlink()</a> clears the cache automatically. </p> <blockquote><p><b class="note">Note</b>: This function caches information about specific filenames, so you only need to call <b>clearstatcache()</b> if you are performing multiple operations on the same filename and require the information about that particular file to not be cached. <br /> </p></blockquote> <p class="para"> Affected functions include <a href="function.stat.html" class="function">stat()</a>, <a href="function.lstat.html" class="function">lstat()</a>, <a href="function.file-exists.html" class="function">file_exists()</a>, <a href="function.is-writable.html" class="function">is_writable()</a>, <a href="function.is-readable.html" class="function">is_readable()</a>, <a href="function.is-executable.html" class="function">is_executable()</a>, <a href="function.is-file.html" class="function">is_file()</a>, <a href="function.is-dir.html" class="function">is_dir()</a>, <a href="function.is-link.html" class="function">is_link()</a>, <a href="function.filectime.html" class="function">filectime()</a>, <a href="function.fileatime.html" class="function">fileatime()</a>, <a href="function.filemtime.html" class="function">filemtime()</a>, <a href="function.fileinode.html" class="function">fileinode()</a>, <a href="function.filegroup.html" class="function">filegroup()</a>, <a href="function.fileowner.html" class="function">fileowner()</a>, <a href="function.filesize.html" class="function">filesize()</a>, <a href="function.filetype.html" class="function">filetype()</a>, and <a href="function.fileperms.html" class="function">fileperms()</a>. </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> No value is returned. </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.chown.html">chown</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.copy.html">copy</a></div> <div class="up"><a href="ref.filesystem.html">Filesystem Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -