mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 05:26:57 +08:00
133 lines
6.1 KiB
HTML
133 lines
6.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>Finds whether a table name matches a wildcard pattern or not</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.mysqlnd-ms-match-wild" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">mysqlnd_ms_match_wild</h1>
|
|
<p class="verinfo">(PECL mysqlnd_ms >= 1.1.0)</p><p class="refpurpose"><span class="refname">mysqlnd_ms_match_wild</span> — <span class="dc-title">Finds whether a table name matches a wildcard pattern or not</span></p>
|
|
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.mysqlnd-ms-match-wild-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
|
|
<span class="methodname"><strong>mysqlnd_ms_match_wild</strong></span>
|
|
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$table_name</code></span>
|
|
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$wildcard</code></span>
|
|
) : <span class="type">bool</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
Finds whether a table name matches a wildcard pattern or not.
|
|
</p>
|
|
<p class="para">
|
|
This function is not of much practical relevance with PECL mysqlnd_ms 1.1.0
|
|
because the plugin does not support MySQL replication table filtering yet.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.mysqlnd-ms-match-wild-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">table_name</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The table name to check if it is matched by the wildcard.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">wildcard</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The wildcard pattern to check against the table name.
|
|
The wildcard pattern supports the same placeholders as
|
|
MySQL replication filters do.
|
|
</p>
|
|
<p class="para">
|
|
MySQL replication filters
|
|
can be configured by using the MySQL Server configuration
|
|
options <em>--replicate-wild-do-table</em> and
|
|
<em>--replicate-wild-do-db</em>. Please, consult
|
|
the MySQL Reference Manual to learn more about this MySQL
|
|
Server feature.
|
|
</p>
|
|
<p class="para">
|
|
The supported placeholders are:
|
|
<ul class="itemizedlist">
|
|
<li class="listitem">
|
|
<span class="simpara">
|
|
<em>%</em> - zero or more literals
|
|
</span>
|
|
</li>
|
|
<li class="listitem">
|
|
<span class="simpara">
|
|
<em>_</em> - one literal
|
|
</span>
|
|
</li>
|
|
</ul>
|
|
</p>
|
|
<p class="para">
|
|
Placeholders can be escaped using <em>\</em>.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.mysqlnd-ms-match-wild-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
Returns <strong><code>TRUE</code></strong> <em>table_name</em> is
|
|
matched by <em>wildcard</em>.
|
|
Otherwise, returns <strong><code>FALSE</code></strong>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.mysqlnd-ms-match-wild-examples">
|
|
<h3 class="title">范例</h3>
|
|
<p class="para">
|
|
<div class="example" id="example-2273">
|
|
<p><strong>Example #1 <span class="function"><strong>mysqlnd_ms_match_wild()</strong></span> example</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br />var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">mysqlnd_ms_match_wild</span><span style="color: #007700">(</span><span style="color: #DD0000">"schema_name.table_name"</span><span style="color: #007700">, </span><span style="color: #DD0000">"schema%"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">mysqlnd_ms_match_wild</span><span style="color: #007700">(</span><span style="color: #DD0000">"abc"</span><span style="color: #007700">, </span><span style="color: #DD0000">"_"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">mysqlnd_ms_match_wild</span><span style="color: #007700">(</span><span style="color: #DD0000">"table1"</span><span style="color: #007700">, </span><span style="color: #DD0000">"table_"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">mysqlnd_ms_match_wild</span><span style="color: #007700">(</span><span style="color: #DD0000">"asia_customers"</span><span style="color: #007700">, </span><span style="color: #DD0000">"%customers"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">mysqlnd_ms_match_wild</span><span style="color: #007700">(</span><span style="color: #DD0000">"funny%table"</span><span style="color: #007700">,</span><span style="color: #DD0000">"funny\%table"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">mysqlnd_ms_match_wild</span><span style="color: #007700">(</span><span style="color: #DD0000">"funnytable"</span><span style="color: #007700">, </span><span style="color: #DD0000">"funny%table"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
<div class="example-contents"><p>以上例程会输出:</p></div>
|
|
<div class="example-contents screen">
|
|
<div class="cdata"><pre>
|
|
bool(true)
|
|
bool(false)
|
|
bool(true)
|
|
bool(true)
|
|
bool(true)
|
|
bool(true)
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |