【问题标题】:"There is no device with id [generic] in wurfl" in Zend implementation of WURFLWURFL 的 Zend 实现中的“Wurfl 中没有 id [generic] 的设备”
【发布时间】:2011-09-21 21:36:08
【问题描述】:

我已按照 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')

【问题讨论】:

    标签: zend-framework wurfl


    【解决方案1】:

    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"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-29
      • 2011-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多