“wurfl 中没有具有 id [generic] 的设备”在 Zend 中实现 WURFL

发布于 2024-12-06 06:01:05 字数 1703 浏览 1 评论 0原文

我按照 Zend 文档中的指南进行操作: http://framework.zend.com/manual/en/zend .http.user-agent.html

并在我的 application.ini 中包含所有配置,如下所示:

; Mobile device detection
resources.useragent.storage.adapter                                     = "Session"
resources.useragent.wurflapi.wurfl_api_version                          = "1.1"
resources.useragent.wurflapi.wurfl_lib_dir                              = APPLICATION_PATH "/../library/wurfl-php-1.3.1/WURFL/"
resources.useragent.wurflapi.wurfl_config_array.cache.provider          = "file"
resources.useragent.wurflapi.wurfl_config_array.cache.dir               = APPLICATION_PATH "/../data/wurfl/cache/" 
resources.useragent.wurflapi.wurfl_config_array.wurfl.main-file         = APPLICATION_PATH "/../data/wurfl/wurfl.xml"
resources.useragent.wurflapi.wurfl_config_array.wurfl.patches           = APPLICATION_PATH "/../data/wurfl/web_browsers_patch.xml"
resources.useragent.wurflapi.wurfl_config_array.persistence.provider    = "file"
resources.useragent.wurflapi.wurfl_config_array.persistence.dir.dir     = APPLICATION_PATH "/../data/wurfl/cache/"

在填充 data/wurfl/cache 之前第一次运行我的应用程序时,我收到此致命错误:

Cannot send headers; headers already sent in /Applications/MAMP/htdocs/thebirdy.com/library/wurfl-php-1.3.1/WURFL/Xml/VersionIterator.php, line 29

第二个当我运行我的应用程序时,每次随后,我收到应用程序错误:

There is no device with id [generic] in wurfl
/Applications/MAMP/htdocs/thebirdy.com/library/wurfl-php-1.3.1/WURFL/CustomDeviceRepository.php(70): WURFL_CustomDeviceRepository->getDevice('generic')

I've followed the guide in the Zend documentation:
http://framework.zend.com/manual/en/zend.http.user-agent.html

And included all the configs in my application.ini like this:

; Mobile device detection
resources.useragent.storage.adapter                                     = "Session"
resources.useragent.wurflapi.wurfl_api_version                          = "1.1"
resources.useragent.wurflapi.wurfl_lib_dir                              = APPLICATION_PATH "/../library/wurfl-php-1.3.1/WURFL/"
resources.useragent.wurflapi.wurfl_config_array.cache.provider          = "file"
resources.useragent.wurflapi.wurfl_config_array.cache.dir               = APPLICATION_PATH "/../data/wurfl/cache/" 
resources.useragent.wurflapi.wurfl_config_array.wurfl.main-file         = APPLICATION_PATH "/../data/wurfl/wurfl.xml"
resources.useragent.wurflapi.wurfl_config_array.wurfl.patches           = APPLICATION_PATH "/../data/wurfl/web_browsers_patch.xml"
resources.useragent.wurflapi.wurfl_config_array.persistence.provider    = "file"
resources.useragent.wurflapi.wurfl_config_array.persistence.dir.dir     = APPLICATION_PATH "/../data/wurfl/cache/"

The first time I run my app before the data/wurfl/cache is populated, I get this fatal error:

Cannot send headers; headers already sent in /Applications/MAMP/htdocs/thebirdy.com/library/wurfl-php-1.3.1/WURFL/Xml/VersionIterator.php, line 29

The second time I run my app, and every subsequent time, I get the application error:

There is no device with id [generic] in wurfl
/Applications/MAMP/htdocs/thebirdy.com/library/wurfl-php-1.3.1/WURFL/CustomDeviceRepository.php(70): WURFL_CustomDeviceRepository->getDevice('generic')

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

第几種人 2024-12-13 06:01:05

application.ini 中的 wurfl 设置不需要包含那么多设置。只需具备以下内容就足够了:

resources.useragent.wurflapi.wurfl_api_version = "1.1"
resources.useragent.wurflapi.wurfl_lib_dir = APPLICATION_PATH "/../library/wurfl-php-1.1/WURFL/"
resources.useragent.wurflapi.wurfl_config_file = APPLICATION_PATH "/configs/wurfl-config.php"

Your wurfl setting in application.ini does not need to include that many settings. Just having the following is enough:

resources.useragent.wurflapi.wurfl_api_version = "1.1"
resources.useragent.wurflapi.wurfl_lib_dir = APPLICATION_PATH "/../library/wurfl-php-1.1/WURFL/"
resources.useragent.wurflapi.wurfl_config_file = APPLICATION_PATH "/configs/wurfl-config.php"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文