| <?xml version="1.0" encoding="UTF-8" ?> | |
| <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd"> | |
| <?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?> | |
| <!-- English Revision: 1421821 --> | |
| <!-- | |
| Licensed to the Apache Software Foundation (ASF) under one or more | |
| contributor license agreements. See the NOTICE file distributed with | |
| this work for additional information regarding copyright ownership. | |
| The ASF licenses this file to You under the Apache License, Version 2.0 | |
| (the "License"); you may not use this file except in compliance with | |
| the License. You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software | |
| distributed under the License is distributed on an "AS IS" BASIS, | |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| See the License for the specific language governing permissions and | |
| limitations under the License. | |
| --> | |
| <modulesynopsis metafile="mod_version.xml.meta"> | |
| <name>mod_version</name> | |
| <description>バージョン依存の設定</description> | |
| <status>Extension</status> | |
| <sourcefile>mod_version.c</sourcefile> | |
| <identifier>version_module</identifier> | |
| <summary> | |
| <p>様々なバージョンの httpd の異なる設定を扱うことになる、 | |
| テストスイートや大規模ネットワークでの使用のために設計されています。 | |
| このモジュールは新しいコンテナ ― <directive | |
| type="section" module="mod_version">IfVersion</directive> を | |
| 提供します。これを使うと、数字の比較や正規表現による柔軟な | |
| バージョンチェックができるようになります。</p> | |
| <example><title>例</title> | |
| <highlight language="config"> | |
| <IfVersion 2.4.2> | |
| # current httpd version is exactly 2.4.2 | |
| </IfVersion> | |
| <IfVersion >= 2.5> | |
| # use really new features :-) | |
| </IfVersion> | |
| </highlight> | |
| </example> | |
| <p>詳細は以下を読んでください。</p> | |
| </summary> | |
| <directivesynopsis type="section"> | |
| <name>IfVersion</name> | |
| <description>バージョン依存の設定を入れる</description> | |
| <syntax><IfVersion [[!]<var>operator</var>] <var>version</var>> ... | |
| </IfVersion></syntax> | |
| <contextlist><context>server config</context><context>virtual host</context> | |
| <context>directory</context><context>.htaccess</context></contextlist> | |
| <override>All</override> | |
| <usage> | |
| <p><directive type="section">IfVersion</directive> は <program>httpd</program> のバージョン | |
| が基準を満たしたときにのみ実行させたいディレクティブを囲みます。 | |
| 通常の (数値) 比較のときは <var>version</var> 引数は | |
| <code><var>major</var>[.<var>minor</var>[.<var>patch</var>]]</code> という | |
| 形式、例えば、<code>2.1.0</code> や <code>2.2</code> となります。 | |
| <var>minor</var> と <var>patch</var> は省略可能です。省略された場合は、 | |
| 0 を指定したものとみなされます。比較には次の数値 <var>operator</var> を | |
| 指定できます:</p> | |
| <table style="zebra" border="1"> | |
| <tr><th><var>operator</var></th><th>説明</th></tr> | |
| <tr><td><code>=</code> と <code>==</code></td> | |
| <td>同じ httpd バージョン</td></tr> | |
| <tr><td><code>></code></td> | |
| <td>より大きい httpd バージョン</td></tr> | |
| <tr><td><code>>=</code></td> | |
| <td>指定以上の httpd バージョン</td></tr> | |
| <tr><td><code><</code></td> | |
| <td>指定未満の httpd バージョン</td></tr> | |
| <tr><td><code><=</code></td> | |
| <td>指定以下の httpd バージョン</td></tr> | |
| </table> | |
| <example><title>例</title> | |
| <highlight language="config"> | |
| <IfVersion >= 2.3> | |
| # this happens only in versions greater or | |
| # equal 2.3.0. | |
| </IfVersion> | |
| </highlight> | |
| </example> | |
| <p>数値比較に加えて、http のバージョン番号に対して | |
| <glossary ref="regex">正規表現</glossary>による | |
| マッチングができます。二種類の書き方があります:</p> | |
| <table style="zebra" border="1"> | |
| <tr><th><var>operator</var></th><th>説明</th></tr> | |
| <tr><td><code>=</code> or <code>==</code></td> | |
| <td><var>version</var> は | |
| <code>/<var>regex</var>/</code> 形式</td></tr> | |
| <tr><td><code>~</code></td> | |
| <td><var>version</var> は | |
| <code><var>regex</var></code> 形式</td></tr> | |
| </table> | |
| <example><title>例</title> | |
| <highlight language="config"> | |
| <IfVersion = /^2.4.[01234]$/> | |
| # e.g. workaround for buggy versions | |
| </IfVersion> | |
| </highlight> | |
| </example> | |
| <p>マッチングの否定を表現するために、すべてのオペレータは前に | |
| 感嘆符 (<code>!</code>)を付けることができます:</p> | |
| <highlight language="config"> | |
| <IfVersion !~ ^2.4.[01234]$> | |
| # not for those versions | |
| </IfVersion> | |
| </highlight> | |
| <p><var>operator</var> が省略されたときは <code>=</code> と | |
| みなされます。</p> | |
| </usage> | |
| </directivesynopsis> | |
| </modulesynopsis> |