Building Android Apps with HTML, CSS, and JavaScript, 2nd Edition
by Jonathan Stark, Brian Jepson, Brian MacDonald
Configuration
Create the following wurfl-config file (wurfl-config.xml) in ~/src/wurfl-php-1.3.1/ (or the directory you created when you extracted wurfl-php):
<?xml version="1.0" encoding="UTF-8"?>
<wurfl-config>
<wurfl>
<main-file>wurfl-latest.xml</main-file>
<patches>
<patch>web_browsers_patch.xml</patch>
</patches>
</wurfl>
<persistence>
<provider>file</provider>
<params>dir=./work/cache</params>
</persistence>
</wurfl-config>Create the cache directory and make sure it and
its parent is writable by whichever user runs PHP scripts. If your web
server is configured to run your PHP scripts under your user credentials,
this step should not be necessary. As with previous examples, replace
~/src/wurfl-php-1.3.1/ with the location you
created earlier. Replace _www with the username
that your PHP scripts run under (you will need superuser credentials to
run this command):
$mkdir -p$~/src/wurfl-php-1.3.1/work/cachesudo chown -R_www ~/src/wurfl-php-1.3.1/work
If any of the parent directories above your cache directory are not readable by the username that the PHP scripts run under, you won’t be able to write to the cache. If WURFL reports an error writing to the cache folder, you can choose another location for it (such as /var/wurfl/cache) and change your wurfl-config.xml to point to it. Before you do that, create the cache directory and give write access for it and its parent to the username that your PHP scripts run under:
$sudo mkdir -p$/var/www/wurfl/cachesudo chown -R_www /var/www/wurfl ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access