Tera-WURFL: Undefined index id
I get this error: Undefined index: id [/Applications/XAMPP/xamppfiles/htdocs/tera-wurfl/TeraWurfl.php, line 297]
Executing this function:
public static function getTeraWurflData() {
$capabilities = array(
'brand_name',
'model_name',
'is_wireless_device',
);
$ua = WurflSupport::getUserAgent();
$wurflObj = new TeraWurfl();
$matched = false;
$matched = $wurflObj->ge开发者_开发问答tDeviceCapabilitiesFromAgent($ua, true);
$deviceCapabilities = array();
foreach ($capabilities as $capability) {
$deviceCapabilities[$capability] = $wurflObj->getDeviceCapability($capability);
}
$deviceCapabilities['user_agent'] = $ua;
if ($_SERVER)
{
$ip = $_SERVER["REMOTE_ADDR"];
}
else
{
if ( getenv( "HTTP_X_FORWARDED_FOR" ) )
$ip = getenv( "HTTP_X_FORWARDED_FOR" );
else
if ( getenv( "HTTP_CLIENT_IP" ) )
$ip = getenv("HTTP_CLIENT_IP");
else
$ip = getenv("REMOTE_ADDR");
}
$deviceCapabilities['ip'] = $ip;
return $deviceCapabilities;
}
I had no problems with my Tera-WURFL config, anybody have this happen before?
I found the solution to this problem, you just need to set your Tera-WURFL to work with MySQL4 and not 5 in your configuration file this will make it so the problem disappears. Here is a link to my post in the Tera forums that helped me resolve the issue
精彩评论