Tera-WURFL:未定义的索引 ID
我收到此错误:未定义索引:id [/Applications/XAMPP/xamppfiles/htdocs/tera-wurfl/TeraWurfl.php,第 297 行]
执行此函数:
public static function getTeraWurflData() {
$capabilities = array(
'brand_name',
'model_name',
'is_wireless_device',
);
$ua = WurflSupport::getUserAgent();
$wurflObj = new TeraWurfl();
$matched = false;
$matched = $wurflObj->getDeviceCapabilitiesFromAgent($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;
}
我的 Tera-WURFL 没有任何问题配置,有人遇到过这种情况吗?
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->getDeviceCapabilitiesFromAgent($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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了这个问题的解决方案,您只需在配置文件中将 Tera-WURFL 设置为与 MySQL4 配合使用,而不是 5,这样问题就会消失。 这里是我在Tera 论坛帮助我解决了该问题
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