uTools-Manuals/docs/php/opcache_compile_file.html
2019-04-08 23:22:26 +08:00

76 lines
2.8 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>无需运行,即可编译并缓存 PHP 脚本</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.opcache-compile-file" class="refentry">
<div class="refnamediv">
<h1 class="refname">opcache_compile_file</h1>
<p class="verinfo">(PHP 5 &gt;= 5.5.5, PHP 7, PECL ZendOpcache &gt; 7.0.2)</p><p class="refpurpose"><span class="refname">opcache_compile_file</span> &mdash; <span class="dc-title">无需运行,即可编译并缓存 PHP 脚本</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.opcache-compile-file-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>opcache_compile_file</strong></span>
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$file</code></span>
) : <span class="type">boolean</span></div>
<p class="para rdfs-comment">
该函数可以用于在不用运行某个 PHP 脚本的情况下,编译该 PHP 脚本并将其添加到字节码缓存中去。
该函数可用于在 Web 服务器重启之后初始化缓存,以供后续请求调用。
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.opcache-compile-file-parameters">
<h3 class="title">参数</h3>
<dl>
<dt>
<code class="parameter">file</code></dt>
<dd>
<p class="para">
被编译的 PHP 脚本的路径。
</p>
</dd>
</dl>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.opcache-compile-file-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
如果 <code class="parameter">file</code> 被成功编译,则返回 <strong><code>TRUE</code></strong> 或者在失败时返回 <strong><code>FALSE</code></strong>
</p>
</div>
<div class="refsect1 errors" id="refsect1-function.opcache-compile-file-errors">
<h3 class="title">错误/异常</h3>
<p class="para">
如果文件( <code class="parameter">file</code> )不能被载入或者不能被编译,则会生成一个 <strong><code>E_WARNING</code></strong> 级别的错误。
可以使用 <a href="language.operators.errorcontrol.html" class="link">@</a> 来抑制该警告。
</p>
</div>
<div class="refsect1 seealso" id="refsect1-function.opcache-compile-file-seealso">
<h3 class="title">参见</h3>
<p class="para">
<ul class="simplelist">
<li class="member"><span class="function"><a href="opcache_invalidate.html" class="function" rel="rdfs-seeAlso">opcache_invalidate()</a> - 废除脚本缓存</span></li>
</ul>
</p>
</div>
</div></div></div></body></html>