【问题标题】:Errors when implementing WURFL with Zend使用 Zend 实现 WURFL 时的错误
【发布时间】:2011-03-14 16:47:01
【问题描述】:

我环顾四周,似乎找不到和我有同样问题的人,希望我没有错过这里的叮当声。

我想获取每个用户的设备浏览器信息,我目前正计划在引导程序中执行此操作,遵循我在 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;

我希望脚本在加载后会死掉,但我没有得到这个,这意味着配置没有正确加载。

问题可能出在哪里?您还需要什么信息?有没有其他人遇到过这种困境?

提前致谢

【问题讨论】:

  • 离题,但我只记得与 wurfl 一起工作很有趣。希望你喜欢做你正在做的事情:)
  • 我期待它很有趣,但目前这是我遇到过的最令人沮丧的事情之一 :)
  • 这只是意味着这将是一次有益的经历;)祝你好运!

标签: php zend-framework wurfl


【解决方案1】:

看来你不能做我想做的事。

因为这似乎不想在引导程序中工作。相反,您应该将其作为插件来执行。

此视频教程有助于更好地解释文档:

http://mcloide.wordpress.com/2010/12/08/mobile-development-with-zend-framework-and-wurfl/

现在我已经设置了插件,我没有收到异常并且我的配置加载完美。哼哼!!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-02-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多