PHP API method to extract wurfl.zip?

Are you absolutely, positively sure that your question does not fit anywhere else?
keith
Posts: 13
Joined: Thu May 30, 2013 2:24 pm

PHP API method to extract wurfl.zip?

Postby keith » Wed Jun 26, 2013 12:11 pm

Hi,

I'm working out some kinks in my deploy process. I intend to set 'allowReload(true)' since I will be updating the wurfl.zip on a regular basis. We have multiple servers in a pool that will need the persistence data to be available at once. Is there a programmatic way for me to force WURFL to extract the .zip file?

Thanks!

keith
Posts: 13
Joined: Thu May 30, 2013 2:24 pm

Re: PHP API method to extract wurfl.zip?

Postby keith » Thu Jun 27, 2013 1:45 pm

I think I'm just going to run something like this in a php via comand line to instantiate WURFL and force the unzip process:

Code: Select all

exec("touch wurfl.zip"); // this will change the timestamp and WURFL will assume it is new and unzip
$wurflConfig = new WURFL_Configuration_InMemoryConfig();
$wurflConfig->persistence('file', array('dir' => $persistenceDir));
$wurflConfig->wurflFile(wurfl.zip);
$wurflConfig->cache('file', array('dir' => $cacheDir, 'expiration' => 36000));
$wurflConfig->matchMode('accuracy');
$wurflConfig->allowReload(true);
$wurlfManagerFactory = new WURFL_WURFLManagerFactory($wurflConfig);
$wurlfManager = $wurlfManagerFactory->create();

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: PHP API method to extract wurfl.zip?

Postby kamermans » Thu Jun 27, 2013 2:17 pm

As long as allowReload is enabled, the WURFL will be reloeded the next time the WURFLManager is created:

Code: Select all

$wurlfManager = $wurlfManagerFactory->create();
This means that you don't really need to touch the wurfl.zip file, since modifying it will change its timestamp, then you can run a script like the one you posted to force the reload.
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!


Who is online

Users browsing this forum: Google [Bot] and 1 guest