我环顾四周,似乎找不到和我有同样问题的人,希望我没有遗漏这里的任何一个问题。
我想要获取每个用户的设备浏览器信息,我目前正计划在引导程序中这样做,遵循我在PHP会议上看到的一些东西。
为此,我遇到了:
http://framework.zend.com/manual/en/zend.http.user-agent.html
它解释了如何安装和使用wurfl。我已经按照说明进行了操作,并提出了以下例外:
未捕获异常'Zend_Http_UserAgent_Features_Exception‘,消息为’‘wurflapi’配置未定义‘
由于对Zend的理解有限,我认为问题出在configs/application.ini中
我有以下几点:
resources.useragent.wurflapi.wurfl_api_version = "1.1"
resources.useragent.wurflapi.wurfl_lib_dir = APPLICATION_PATH "/../library/wurfl-php-1.1/"
resources.useragent.wurflapi.wurfl_config_file = APPLICATION_PATH "/configs/wurfl-config.php"其中我的wurfl-config.php如下所示:
echo "Loaded";
die;
$resourcesDir = dirname(__FILE__) . '/../../data/wurlf/';
$wurfl['main-file'] = $resourcesDir . 'wurfl-latest.zip';
$wurfl['patches'] = array($resourcesDir . 'web_browsers_patch.xml');
$persistence['provider'] = 'file';
$persistence['dir'] = CACHE_ROOT . "/wurfl/";
$cache['provider'] = null;
$configuration['wurfl'] = $wurfl;
$configuration['persistence'] = $persistence;
$configuration['cache'] = $cache;我希望脚本在打印加载后会死掉,但我没有得到这个,这意味着配置没有正确加载。
问题可能出在哪里?您还需要哪些信息?以前有没有其他人遇到过这种困境?
提前感谢
发布于 2011-03-15 02:06:30
看起来你不能按我说的做。
因为这似乎不想在引导程序中工作。相反,你应该把它当做一个插件来做。
此视频教程有助于更好地解释文档:
http://mcloide.wordpress.com/2010/12/08/mobile-development-with-zend-framework-and-wurfl/
现在我已经设置了插件,我没有得到异常和我的配置加载完美。嗯!
https://stackoverflow.com/questions/5301637
复制相似问题