<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/wincache.setup.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'wincache.reroutes.php',
    1 => 'WinCache Functions Reroutes',
    2 => 'WinCache Functions Reroutes',
  ),
  'up' => 
  array (
    0 => 'wincache.setup.php',
    1 => 'Installing/Configuring',
  ),
  'prev' => 
  array (
    0 => 'wincache.sessionhandler.php',
    1 => 'WinCache Session Handler',
  ),
  'next' => 
  array (
    0 => 'ref.wincache.php',
    1 => 'WinCache Functions',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/wincache/setup.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="wincache.reroutes" class="section">
  <h2 class="title">WinCache Functions Reroutes</h2>
  <p class="para">
   <em>NOTE:</em> <a href="wincache.configuration.php#ini.wincache.rerouteini" class="link">wincache.rerouteini</a> was removed as of
   WinCache 1.3.7.0.  It has been replaced with automatic function reroutes.  See:
   <a href="wincache.configuration.php#ini.wincache.reroute_enabled" class="link">wincache.reroute_enabled</a>.
  </p>
  <p class="para">
   The WinCache functions reroutes (available since WinCache 1.2.0, removed since WinCache 1.3.7.0) can be used to replace built-in PHP functions with their equivalents
   that are optimized for a particular purpose. WinCache extension includes Windows-optimized implementation of PHP file functions that
   may improve performance of PHP applications in cases when PHP has to access files on network shares. The optimized implementation is
   provided for the following functions:
  </p>
  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     <a href="function.file-exists.php" class="link">file_exists</a>
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <a href="function.file-get-contents.php" class="link">file_get_contents</a>
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <a href="function.readfile.php" class="link">readfile</a>
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <a href="function.is-readable.php" class="link">is_readable</a>
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <a href="function.is-writable.php" class="link">is_writable</a>
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <a href="function.is-dir.php" class="link">is_dir</a>
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <a href="function.realpath.php" class="link">realpath</a>
    </span>
   </li>
      <li class="listitem">
    <span class="simpara">
     <a href="function.filesize.php" class="link">filesize</a>
    </span>
   </li>
  </ul>
  <p class="para">
   To configure WinCache to use the functions reroutes use the file <var class="filename">reroute.ini</var> that is included in
   WinCache installation package. Copy this file into the same directory where <var class="filename">php.ini</var>
   file is located. After that add the wincache.rerouteini setting in <var class="filename">php.ini</var>
   and specify an absolute or relative path to the <var class="filename">reroute.ini</var> file.
   <div class="example" id="example-1">
    <p><strong>Example #1 Enabling WinCache functions reroutes</strong></p>
    <div class="example-contents">
<div class="php.inicode"><pre class="php.inicode">wincache.rerouteini = C:\PHP\reroute.ini</pre>
</div>
    </div>

   </div>
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <span class="simpara">
    If WinCache functions reroutes are enabled it is recommended to increase the WinCache file cache size. This
    can be done by using <a href="wincache.configuration.php#ini.wincache.fcachesize" class="link">wincache.fcachesize</a> setting.
   </span>
  </p></blockquote>
  <p class="para">
   The <var class="filename">reroute.ini</var> file contains the mappings between the native PHP functions and
   their equivalents in WinCache. Each line in the file defines a mapping by using the following syntax:
  </p>
  <p class="simpara">
   <code class="literal">&lt;PHP function name&gt;:[&lt;number of function parameters&gt;]=&lt;wincache function name&gt;</code>
  </p>
  <p class="para">
   The example of the file is shown below. In this example the calls to PHP function <span class="function"><a href="function.file-get-contents.php" class="function">file_get_contents()</a></span>
   will be replaced with calls to <span class="function"><strong>wincache_file_get_contents()</strong></span> only if the number of parameters passed to
   the function is less than or equals to 2. Specifying the number of parameters is useful when replacement function
   does not handle all the function&#039;s parameters.
   <div class="example" id="example-2">
    <p><strong>Example #2 Reroute.ini file content</strong></p>
    <div class="example-contents">
 <div class="php.inicode"><pre class="php.inicode">[FunctionRerouteList]
file_exists=wincache_file_exists
file_get_contents:2=wincache_file_get_contents
readfile:2=wincache_readfile
is_readable=wincache_is_readable
is_writable=wincache_is_writable
is_writeable=wincache_is_writable
is_file=wincache_is_file
is_dir=wincache_is_dir
realpath=wincache_realpath
filesize=wincache_filesize</pre>
</div>
    </div>

   </div>
  </p>
 </div><?php manual_footer($setup); ?>