Tera-WURFL:未定义的索引 ID

发布于 2024-11-27 03:17:10 字数 1381 浏览 1 评论 0原文

我收到此错误:未定义索引: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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清引 2024-12-04 03:17:10

我找到了这个问题的解决方案,您只需在配置文件中将 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文