<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/yaconf.setup.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'yaconf.configuration.php',
    1 => '运行时配置',
    2 => '运行时配置',
  ),
  'up' => 
  array (
    0 => 'yaconf.setup.php',
    1 => '安装/配置',
  ),
  'prev' => 
  array (
    0 => 'yaconf.installation.php',
    1 => '安装',
  ),
  'next' => 
  array (
    0 => 'yaconf.resources.php',
    1 => '资源类型',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/yaconf/ini.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="yaconf.configuration" class="section">
 <h2 class="title">运行时配置</h2>
 <p class="simpara">
这些函数的行为受 <var class="filename">php.ini</var> 中的设置影响。
</p>
 <p class="para">
  <table class="doctable table">
   <caption><strong>Yaconf 配置选项</strong></caption>
   
    <thead>
     <tr>
      <th>名字</th>
      <th>默认</th>
      <th>可修改范围</th>
      <th>更新日志</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td><a href="yaconf.configuration.php#ini.yaconf.directory" class="link">yaconf.directory</a></td>
      <td><code class="literal">&quot;&quot;</code></td>
      <td><strong><code><a href="info.constants.php#constant.ini-system">INI_SYSTEM</a></code></strong></td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><a href="yaconf.configuration.php#ini.yaconf.check-delay" class="link">yaconf.check_delay</a></td>
      <td><code class="literal">300</code></td>
      <td><strong><code><a href="info.constants.php#constant.ini-system">INI_SYSTEM</a></code></strong></td>
      <td class="empty">&nbsp;</td>
     </tr>

    </tbody>
   
  </table>

 </p>

 <p class="simpara">这是配置指令的简短说明。</p>

 <p class="para">
  <dl>
   
     <dt id="ini.yaconf.directory">
      <code class="parameter">yaconf.directory</code>
      <span class="type"><a href="language.types.string.php" class="type string">string</a></span>
     </dt>
     <dd>
      <p class="simpara">
       存放所有 INI 配置文件的目录。只有扩展名为
       <var class="filename">.ini</var> 的文件会被加载。
       子目录会被递归加载（最多 16 层深），每一级子目录都作为一级键
       参与寻址：例如放在 <var class="filename">users/</var> 子目录下的
       <var class="filename">database.ini</var> 文件，通过
       <code class="literal">&quot;users.database&quot;</code> 访问。该特性自 Yaconf 1.2.0
       起提供；在此之前，只有直接位于该目录下的文件会被加载。
      </p>
      <p class="simpara">
       下面的示例假定在配置的目录中放置了如下
       <var class="filename">database.ini</var>，以及一个存放各功能开关设置的
       <var class="filename">features.ini</var>。
      </p>
      <div class="example" id="example-1">
       <p><strong>示例 #1 INI 文件语法</strong></p>
       <div class="example-contents">
<div class="inicode"><pre class="inicode">; database.ini
name=production                        ; scalar value
version=PHP_VERSION                    ; PHP constants are resolved
connection_string=${DATABASE_URL}      ; environment variables are resolved
options.max_connections=50             ; nested hash key
options.timeout=30

; array entries, both notations are equivalent
replicas.0=replica-1.example.com
replicas[]=replica-2.example.com</pre>
</div>
       </div>

      </div>
      <div class="example" id="example-2">
       <p><strong>示例 #2 INI section 示例</strong></p>
       <div class="example-contents">
<div class="inicode"><pre class="inicode">; features.ini
[default]
cache_enabled=on
rate_limit=100

; the &quot;premium&quot; section inherits every key from &quot;default&quot; and
; overrides the ones it redefines
[premium:default]
rate_limit=1000</pre>
</div>
       </div>

      </div>
     </dd>
   
   
     <dt id="ini.yaconf.check-delay">
      <code class="parameter">yaconf.check_delay</code>
      <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
     </dt>
     <dd>
      <p class="simpara">
       Yaconf 检查已加载的 INI 文件是否发生变更、并重新加载变更文件的时间间隔，
       单位为秒（通过比较目录的修改时间来检测变更）。将其设置为
       <code class="literal">0</code> 时，Yaconf 会在每个请求时都进行检查。
      </p>
      <blockquote class="note"><p><strong class="note">注意</strong>: 
       <p class="simpara">
        该配置项只在非 ZTS 构建中注册。在 ZTS（线程安全）构建中，
        配置仅在启动时加载，不支持自动重新加载；修改后需要重启 PHP
        才能生效。
       </p>
      </p></blockquote>
     </dd>
   
  </dl>
 </p>
</div><?php manual_footer($setup); ?>