开发者

"There is no device with id [generic] in wurfl" in Zend implementation of WURFL

开发者 https://www.devze.com 2023-04-07 01:59 出处:网络
I\'ve followed the guide in the Zend documentation: http://framework.zend.com/manual/en/zend.http.user-agent.html

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 "/.开发者_JS百科./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')


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"
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号