我正在按照關於使用Zend Framework設置WURFL的教程來實現輕鬆的移動瀏覽器檢測。帶Zend框架的WURFL忽略緩存目錄配置
http://framework.zend.com/manual/en/zend.http.user-agent.html#zend.http.user-agent.quick-start
我已完成了安裝到可以檢測到桌面瀏覽器,並給我的瀏覽器的所有細節和功能,但是當我嘗試訪問使用的是iPhone的網站(移動版Safari點)它試圖寫入緩存目錄時會引發錯誤。
這裏就是我看到在我的錯誤日誌:
2011-06-08T22:32:34-07:00 ERR (3): The file cache directory does not exist and could not be created. Please make sure the cache directory is writeable: /var/tmp
然而,在我的配置在/application/configs/wurfl-config.php我已經設置了緩存目錄下面:
<?php
$resourcesDir = dirname(__FILE__) . '/../../data/wurfl/';
$wurfl['main-file'] = $resourcesDir . 'wurfl-2.0.27.zip';
$wurfl['patches'] = array($resourcesDir . 'web_browsers_patch.xml');
$persistence['provider'] = 'file';
$persistence['dir'] = $resourcesDir . '/cache/';
$cache['provider'] = null;
$configuration['wurfl'] = $wurfl;
$configuration['persistence'] = $persistence;
$configuration['cache'] = $cache;
我也確保它是可寫的服務器,但WURFL似乎覺得我的緩存目錄仍是/ var/tmp中
我怎樣才能得到WURFL觀察我的緩存目錄setti NG?
筆記:本教程使用wurfl-1.1作爲例子,我只能在sourceforge上找到wurfl-1.3。這可能是一個問題。
注意:我在我的application.ini文件這些行:
; WURFL
resources.useragent.wurflapi.wurfl_api_version = "1.1"
resources.useragent.wurflapi.wurfl_lib_dir = APPLICATION_PATH "/../library/wurfl-php-1.3.0/WURFL/"
resources.useragent.wurflapi.wurfl_config_file = APPLICATION_PATH "/configs/wurfl-config.php"
好吧,我甚至都不知道.ini文件中所有可能的東西。謝謝! – AntBrown 2011-06-23 02:07:29