ZF-10663: Documentation for WURFL support does not work on Windows machines

Description

The WURFL code assumes that the system being run on is a *nix machine.

WURFL_Configuration_Config::getFullPath() {

$fileName = trim($fileName);
if ($fileName[0] == '/') {    <-- *nix only file check
    return $fileName;
}
$fullName = $this->configurationFileDir . $fileName; 

if(file_exists($fullName)) {
    return $fullName;
}

die("The File " . $fullName . " does not exist!!!\n");

}

Technically, I would argue that the WURFL folks should fix that, but until that happens the WURLF Quickstart could be updated with the following example code to make it work.

$wurfl['main-file'] = '../data/wurfl/wurfl-latest.zip'; $wurfl['patches'] = array('../data/wurfl/web_browsers_patch.xml');

Comments

I have the same issue with zf 1.11 using wurlf. I don't see the error on my hosted win 7 desktop, but when I view from my connected android phone tp mymachine:8080 I get the error:

C:Program Files(x86)\Zend\Apache2\htdocs\mysite\application\C:Program Files(x86)\Zend\Apache2\htdocs\mysite\application../../data/wurlf/wurlf-latest.zip does not exist!!!

The suggested fix mentioned above did not fix it for me.

I used the Quick Start sample found on zf site. http://framework.zend.com/manual/en/…

wurlf-config.php: $resourcesDir = dirname(FILE) . '/../../data/wurfl/'; $wurfl['main-file'] = $resourcesDir . 'wurfl-latest.zip'; $wurfl['patches'] = array($resourcesDir . 'web_browsers_patch.xml');$persistence['provider'] = 'file'; $persistence['dir'] = $resourcesDir . '/cache/'; $cache['provider'] = null; $configuration['wurfl'] = $wurfl; $configuration['persistence'] = $persistence; $configuration['cache'] = $cache;

application.ini:

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"

The original issue was corrected in later versions of WURFL (I tested against WURFL v1.3.1)