mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 05:26:57 +08:00
82 lines
3.1 KiB
HTML
82 lines
3.1 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<title>废除脚本缓存</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.opcache-invalidate" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">opcache_invalidate</h1>
|
|
<p class="verinfo">(PHP 5 >= 5.5.0, PHP 7, PECL ZendOpcache >= 7.0.0)</p><p class="refpurpose"><span class="refname">opcache_invalidate</span> — <span class="dc-title">废除脚本缓存</span></p>
|
|
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.opcache-invalidate-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>opcache_invalidate</strong></span>
|
|
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$script</code></span>
|
|
[, <span class="methodparam"><span class="type">boolean</span> <code class="parameter">$force</code><span class="initializer"> = <strong><code>FALSE</code></strong></span></span>
|
|
] ) : <span class="type">boolean</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
该函数的作用是使得指定脚本的字节码缓存失效。
|
|
如果 <code class="parameter">force</code> 没有设置或者传入的是 <strong><code>FALSE</code></strong>,那么只有当脚本的修改时间
|
|
比对应字节码的时间更新,脚本的缓存才会失效。
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.opcache-invalidate-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">script</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
缓存需要被作废对应的脚本路径
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">force</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
如果该参数设置为<strong><code>TRUE</code></strong>,那么不管是否必要,该脚本的缓存都将被废除。
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.opcache-invalidate-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
如果脚本的字节码缓存失效设置成功或者该脚本本来就没有缓存,则返回 <strong><code>TRUE</code></strong>;如果字节码缓存被禁用,则返回<strong><code>FALSE</code></strong>。
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.opcache-invalidate-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="opcache_compile_file.html" class="function" rel="rdfs-seeAlso">opcache_compile_file()</a> - 无需运行,即可编译并缓存 PHP 脚本</span></li>
|
|
<li class="member"><span class="function"><a href="opcache_reset.html" class="function" rel="rdfs-seeAlso">opcache_reset()</a> - 重置字节码缓存的内容</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
</div></div></div></body></html> |