no capability named [resolution_height] is present in wurfl

federico.botto
Posts: 7
Joined: Mon Oct 07, 2013 8:51 am

no capability named [resolution_height] is present in wurfl

Postby federico.botto » Mon Oct 07, 2013 8:59 am

Hi, i'm installing php demo wurfl and Resolution Height gives an error, but width and Markup are already detected. (Also brand_name is giving the same error)

Demo example is in: http://192.168.4.201:8080/Dev/Wurfl/
The resources is in: http://192.168.4.201:8080/Dev/Wurfl/inc/resources
the Wurfl is in: http://192.168.4.201:8080/Dev/Wurfl/inc/WURFL

My config file:

Code: Select all

<?php
/*
 * This is an example of configuring the WURFL PHP API
 */

// Enable all error logging while in development
ini_set('display_errors', 'on');
error_reporting(E_ALL);

$wurflDir = dirname(__FILE__) . '/WURFL';
$resourcesDir = dirname(__FILE__) . '/resources';

require_once $wurflDir.'/Application.php';

$persistenceDir = $resourcesDir.'/storage/persistence';
$cacheDir = $resourcesDir.'/storage/cache';

// Create WURFL Configuration
$wurflConfig = new WURFL_Configuration_InMemoryConfig();

// Set location of the WURFL File
$wurflConfig->wurflFile($resourcesDir.'/wurfl.zip');

// Set the match mode for the API ('performance' or 'accuracy')
$wurflConfig->matchMode('performance');

// Automatically reload the WURFL data if it changes
$wurflConfig->allowReload(true);

// Optionally specify which capabilities should be loaded
$wurflConfig->capabilityFilter(array(
		'is_wireless_device',
		'preferred_markup',
		'xhtml_support_level',
		'xhtmlmp_preferred_mime_type',
		'device_os',
		'device_os_version',
		'is_tablet',
		'mobile_browser_version',
		'pointing_method',
		'mobile_browser',
		'resolution_width',
));

// Setup WURFL Persistence
$wurflConfig->persistence('file', array('dir' => $persistenceDir));

// Setup Caching
$wurflConfig->cache('file', array('dir' => $cacheDir, 'expiration' => 36000));

// Create a WURFL Manager Factory from the WURFL Configuration
$wurflManagerFactory = new WURFL_WURFLManagerFactory($wurflConfig);

// Create a WURFL Manager
/* @var $wurflManager WURFL_WURFLManager */
$wurflManager = $wurflManagerFactory->create();
Attachments
WURFL PHP API Example.png
WURFL PHP API Example.png (141.54 KiB) Viewed 10076 times

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

Re: no capability named [resolution_height] is present in wu

Postby kamermans » Mon Oct 07, 2013 9:40 am

Sorry for the trouble. This error is caused by the default configuration - we will fix it an re-release it ASAP, but in the meantime, here's what you can do.

Open the file

Code: Select all

examples/demo/inc/wurfl_config_standard.php
and find this section:

Code: Select all

// Optionally specify which capabilities should be loaded
$wurflConfig->capabilityFilter(array(
	'is_wireless_device',
	'preferred_markup',
	'xhtml_support_level',
	'xhtmlmp_preferred_mime_type',
	'device_os',
	'device_os_version',
	'is_tablet',
	'mobile_browser_version',
	'pointing_method',
	'mobile_browser',
	'resolution_width',
));
Now, either remove that block entirely. It is loading only a handful of capabilities, but the demo/index.php page is using some that have not been specified.

Next, delete these folders:

Code: Select all

examples/resources/storage/cache
examples/resources/storage/persistence
Now, when you go back to the demo page, everything will work properly.
Thanks,

Steve Kamerman
ScientiaMobile

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

federico.botto
Posts: 7
Joined: Mon Oct 07, 2013 8:51 am

Re: no capability named [resolution_height] is present in wu

Postby federico.botto » Mon Oct 07, 2013 10:04 am

Thanks, now it's working!!!


Who is online

Users browsing this forum: No registered users and 1 guest