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

contributors($setup);

?>
<div id="yac.installation" class="section">
  <h2 class="title">安装</h2>
  <p class="simpara">
   Yac 有三种安装方式：通过 PECL、通过 PIE，或从源码构建。
  </p>
  <p class="simpara">
   此 <a href="https://pecl.php.net/" class="link external">&raquo;&nbsp;PECL</a> 扩展未与 PHP 捆绑。
  </p>
  <p class="simpara">
   安装此 PECL 扩展相关的信息可在手册中标题为
<a href="install.pecl.php" class="link">PECL
扩展的安装</a>章节中找到。更多信息如新的发行版本、下载、源文件、
维护人员信息及变更日志等，都在此处：
   <a href="https://pecl.php.net/package/yac" class="link external">&raquo;&nbsp;https://pecl.php.net/package/yac</a>。
  </p>
  <p class="simpara">
   此扩展在 Windows 平台的二进制扩展 (<abbr title="Dynamic Link Library">DLL</abbr> 文件) 
<abbr title="PHP Extension Community Library">PECL</abbr> 可以在 PECL 官方网站上下载。
  </p>
  <div class="example" id="example-1">
   <p><strong>示例 #1 用 PECL 安装 Yac</strong></p>
   <div class="example-contents">
<div class="shellcode"><pre class="shellcode">pecl install yac</pre>
</div>
   </div>

  </div>
  <p class="simpara">
   从 Yac 2.3.2 开始，可以用 <a href="https://github.com/php/pie" class="link external">&raquo;&nbsp;PIE</a>（PHP Installer for
   Extensions，PHP 扩展安装器）安装本扩展，在命令行执行：
  </p>
  <div class="example" id="example-2">
   <p><strong>示例 #2 用 PIE 安装 Yac</strong></p>
   <div class="example-contents">
<div class="shellcode"><pre class="shellcode">pie install laruence/yac</pre>
</div>
   </div>

  </div>
  <p class="simpara">
   安装时可以同时启用可选的序列化器：
  </p>
  <div class="example" id="example-3">
   <p><strong>示例 #3 用 PIE 安装 Yac 并启用序列化器</strong></p>
   <div class="example-contents">
<div class="shellcode"><pre class="shellcode">pie install laruence/yac --enable-json</pre>
</div>
   </div>

  </div>
  <p class="simpara">
   源代码托管在
   <a href="https://github.com/laruence/yac" class="link external">&raquo;&nbsp;GitHub</a> 上。
   从源码构建扩展，在命令行执行以下命令，
   并把路径替换为本地 PHP 安装的实际路径：
  </p>
  <div class="example" id="example-4">
   <p><strong>示例 #4 从源码构建 Yac</strong></p>
   <div class="example-contents">
<div class="shellcode"><pre class="shellcode">/path/to/phpize
./configure --with-php-config=/path/to/php-config
make &amp;&amp; make install</pre>
</div>
   </div>

  </div>
  <p class="simpara">
   可用的 <code class="literal">configure</code> 选项如下：
  </p>
  <p class="simpara">
   值在存储前会用 LZ4 压缩。LZ4 压缩后端从 Yac 2.4.0 开始使用，
   取代了此前的 FastLZ。默认情况下，Yac 使用随扩展一起打包的
   LZ4 副本，无需额外的编译选项。如果要改为链接系统的 LZ4 库，
   请使用 <strong class="option configure">--with-system-lz4</strong> 选项，
   这要求系统已安装 <code class="literal">lz4.h</code> 头文件和
   <code class="literal">liblz4</code>。
  </p>
  <p class="simpara">
   可以通过 <strong class="option configure">--enable-json</strong>、
   <strong class="option configure">--enable-msgpack</strong> 或
   <strong class="option configure">--enable-igbinary</strong>
   编译进备选的序列化器，相应的扩展会被注册为可选依赖。
   运行时使用哪个序列化器由
   <a href="yac.configuration.php#ini.yac.serializer" class="link">yac.serializer</a>
   ini 配置项选择。
  </p>
 </div><?php manual_footer($setup); ?>