在 Wincache 1.3.7.0 之前,重新導向已損壞,請在官方論壇中查看此內容
http://forums.iis.net/t/1213205.aspx?Function+reroute+not+working]
在該版本之後,檔案重新導向函式預設為啟用,若要停用它們,請使用
wincache.reroute_enabled=0
注意: wincache.rerouteini 已於 WinCache 1.3.7.0 版本移除。它已被自動函式重新導向取代。請參閱:wincache.reroute_enabled。
WinCache 函式重新導向(自 WinCache 1.2.0 開始可用,自 WinCache 1.3.7.0 起移除)可用於將內建的 PHP 函式替換為針對特定目的優化的對等函式。WinCache 擴充功能包含 Windows 優化的 PHP 檔案函式實作,當 PHP 必須存取網路共享上的檔案時,可能會提高 PHP 應用程式的效能。以下函式提供了優化的實作
要設定 WinCache 使用函式重新導向,請使用 WinCache 安裝套件中包含的 reroute.ini 檔案。將此檔案複製到 php.ini 檔案所在的相同目錄中。之後,在 php.ini 中新增 wincache.rerouteini 設定,並指定 reroute.ini 檔案的絕對或相對路徑。
範例 #1 啟用 WinCache 函式重新導向
wincache.rerouteini = C:\PHP\reroute.ini
注意: 如果啟用 WinCache 函式重新導向,建議增加 WinCache 檔案快取大小。這可以使用 wincache.fcachesize 設定來完成。
reroute.ini 檔案包含原生 PHP 函式與 WinCache 中對應函式之間的映射。檔案中的每一行都使用以下語法定義映射
<PHP 函式名稱>:[<函式參數數量>]=<wincache 函式名稱>
檔案的範例如下所示。在此範例中,只有當傳遞給函式的參數數量小於或等於 2 時,才會將對 PHP 函式 file_get_contents() 的呼叫替換為對 wincache_file_get_contents() 的呼叫。當替換函式無法處理函式的所有參數時,指定參數的數量會很有用。
範例 #2 Reroute.ini 檔案內容
[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
在 Wincache 1.3.7.0 之前,重新導向已損壞,請在官方論壇中查看此內容
http://forums.iis.net/t/1213205.aspx?Function+reroute+not+working]
在該版本之後,檔案重新導向函式預設為啟用,若要停用它們,請使用
wincache.reroute_enabled=0