International PHP Conference Munich 2024

WinCache Functions Reroutes

NOTE: wincache.rerouteini was removed as of WinCache It has been replaced with automatic function reroutes. See: wincache.reroute_enabled.

The WinCache functions reroutes (available since WinCache 1.2.0, removed since WinCache 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:

To configure WinCache to use the functions reroutes use the file reroute.ini that is included in WinCache installation package. Copy this file into the same directory where php.ini file is located. After that add the wincache.rerouteini setting in php.ini and specify an absolute or relative path to the reroute.ini file.

Beispiel #1 Enabling WinCache functions reroutes

wincache.rerouteini = C:\PHP\reroute.ini

Hinweis: If WinCache functions reroutes are enabled it is recommended to increase the WinCache file cache size. This can be done by using wincache.fcachesize setting.

The reroute.ini 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:

<PHP function name>:[<number of function parameters>]=<wincache function name>

The example of the file is shown below. In this example the calls to PHP function file_get_contents() will be replaced with calls to wincache_file_get_contents() 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's parameters.

Beispiel #2 Reroute.ini file content


add a note

User Contributed Notes 1 note

deivid dot garcia dot garcia at gmail dot com
9 years ago
Prior to Wincache rerouting was broken, see this in the official forums:]

After that version, file rerouting functions are enabled by default, to disable them use:

To Top