mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 22:06:57 +08:00
94 lines
4.6 KiB
HTML
94 lines
4.6 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>Process a PHP file importing function and class definitions, overwriting where appropriate</title>
|
||
</head>
|
||
<body class="docs"><div id="layout">
|
||
<div id="layout-content"><div id="function.runkit-import" class="refentry">
|
||
<div class="refnamediv">
|
||
<h1 class="refname">runkit_import</h1>
|
||
<p class="verinfo">(PECL runkit >= 0.7.0)</p><p class="refpurpose"><span class="refname">runkit_import</span> — <span class="dc-title">
|
||
Process a PHP file importing function and class definitions, overwriting where appropriate
|
||
</span></p>
|
||
|
||
</div>
|
||
<div class="refsect1 description" id="refsect1-function.runkit-import-description">
|
||
<h3 class="title">说明</h3>
|
||
<div class="methodsynopsis dc-description">
|
||
<span class="methodname"><strong>runkit_import</strong></span>
|
||
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span>
|
||
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code><span class="initializer"> = RUNKIT_IMPORT_CLASS_METHODS</span></span>
|
||
] ) : <span class="type">bool</span></div>
|
||
|
||
<p class="para rdfs-comment">
|
||
Similar to <span class="function"><a href="include.html" class="function">include</a></span> however any code residing outside
|
||
of a function or class is simply ignored.
|
||
Additionally, depending on the value of <code class="parameter">flags</code>,
|
||
any functions or classes which already exist in the currently running environment
|
||
may be automatically overwritten by their new definitions.
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 parameters" id="refsect1-function.runkit-import-parameters">
|
||
<h3 class="title">参数</h3>
|
||
<p class="para">
|
||
<dl>
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">filename</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
Filename to import function and class definitions from
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">flags</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
Bitwise OR of the <a href="runkit.constants.html" class="link"><em>RUNKIT_IMPORT_*</em>
|
||
family of constants</a>.
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
</dl>
|
||
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 returnvalues" id="refsect1-function.runkit-import-returnvalues">
|
||
<h3 class="title">返回值</h3>
|
||
<p class="para">
|
||
成功时返回 <strong><code>TRUE</code></strong>, 或者在失败时返回 <strong><code>FALSE</code></strong>。
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 examples" id="refsect1-function.runkit-import-examples">
|
||
<h3 class="title">范例</h3>
|
||
<p class="para">
|
||
<div class="example" id="example-552">
|
||
<p><strong>Example #1 <span class="function"><strong>runkit_import()</strong></span> example</strong></p>
|
||
<div class="example-contents">
|
||
<div class="phpcode"><pre><span style="color: #000000">
|
||
<span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// import classes entirely<br /></span><span style="color: #0000BB">runkit_import</span><span style="color: #007700">(</span><span style="color: #DD0000">'myfile.inc'</span><span style="color: #007700">, </span><span style="color: #0000BB">RUNKIT_IMPORT_CLASSES</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* import classes, but not imports their static properties<br /> (RUNKIT_IMPORT_CLASS_STATIC_PROPS is available since 1.0.1) */<br /></span><span style="color: #0000BB">runkit_import</span><span style="color: #007700">(</span><span style="color: #DD0000">'myfile.inc'</span><span style="color: #007700">, </span><span style="color: #0000BB">RUNKIT_IMPORT_CLASSES </span><span style="color: #007700">& ~</span><span style="color: #0000BB">RUNKIT_IMPORT_CLASS_STATIC_PROPS</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* import only static properties of classes<br /> (RUNKIT_IMPORT_CLASS_STATIC_PROPS is available since 1.0.1) */<br /></span><span style="color: #0000BB">runkit_import</span><span style="color: #007700">(</span><span style="color: #DD0000">'myfile.inc'</span><span style="color: #007700">, </span><span style="color: #0000BB">RUNKIT_IMPORT_CLASS_STATIC_PROPS</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span>
|
||
</span>
|
||
</pre></div>
|
||
</div>
|
||
|
||
</div>
|
||
</p>
|
||
</div>
|
||
|
||
</div></div></div></body></html> |