Page 1 of 1

no capability named [resolution_height] is present in wurfl

Posted: Mon Oct 07, 2013 8:59 am
by federico.botto
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();

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

Posted: Mon Oct 07, 2013 9:40 am
by kamermans
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.

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

Posted: Mon Oct 07, 2013 10:04 am
by federico.botto
Thanks, now it's working!!!