首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Zend Wurfl移动服务器错误

Zend Wurfl移动服务器错误
EN

Stack Overflow用户
提问于 2013-02-26 09:57:25
回答 1查看 282关注 0票数 0

您好,我尝试将移动模板添加到当前zend应用程序中,但它返回服务器错误。下面是我在几个网站上的配置。

application.in

代码语言:javascript
复制
resources.frontController.plugins[] = "Rate_Application_Mobile"
resources.useragent.wurflapi.wurfl_api_version = "1.1"
resources.useragent.wurflapi.wurfl_lib_dir = APPLICATION_PATH "/../library/wurfl/WURFL/"
resources.useragent.wurflapi.wurfl_config_file = APPLICATION_PATH "/configs/wurfl-config.php"

wurfl-config.php

代码语言:javascript
复制
<?php
$resourcesDir            = dirname(__FILE__) . '/../../data/wurfl/';

$wurfl['main-file']      = $resourcesDir  . 'wurfl-2.0.27.zip';
$wurfl['patches']        = array($resourcesDir . 'web_browsers_patch.xml');

$persistence['provider'] = 'file';
$persistence['dir']      = $resourcesDir . 'cache/';

$cache['provider']       = null;

$configuration['wurfl']       = $wurfl;
$configuration['persistence'] = $persistence;
$configuration['cache']       = $cache;

移动插件/var/www/library/Rate/Application/Mobile.php

代码语言:javascript
复制
class Rate_Application_Mobile extends Zend_Controller_Plugin_Abstract
{

    public function dispatchLoopStartup(Zend_Controller_Request_Abstract $req)
    {


        $front = Zend_Controller_Front::getInstance();
        $bootstrap = $front->getParam("bootstrap");

        $userAgent = $bootstrap->getResource('useragent');

        $device = $userAgent->getDevice();  --> this part return server error when switching to mobile browser, otherwise it return desktop when view as desktop browser


    }
}

谢谢!!

Update:错误返回如下

代码语言:javascript
复制
Warning: include(/var/www/library/wurfl/WURFL/Storage/.php): failed to open stream: No such file or directory in /var/www/library/wurfl/WURFL/ClassLoader.php on line 42

Warning: include(): Failed opening '/var/www/library/wurfl/WURFL/Storage/.php' for inclusion (include_path='/var/www/application/../library:/var/www/library:.:/usr/share/php:/usr/local/Zend/library') in /var/www/library/wurfl/WURFL/ClassLoader.php on line 42

Fatal error: Class 'WURFL_Storage_' not found in /var/www/library/wurfl/WURFL/Storage/Factory.php on line 43
EN

回答 1

Stack Overflow用户

发布于 2013-02-26 11:31:36

这是我在上面的评论中给出的答案,复制和粘贴只是为了获得支持和接受。

这是PHP错误,说明找不到类文件。您包含的PHP文件名称为空,因此WURFL可能无法检测到需要加载的内容。请在ClassLoader.php:42 (第一个错误)中执行debug_backtrace()之前的错误行,并检查它尝试/需要在Factory.php:43中加载哪些存储。如果是这个文件:Factory.php,您正在尝试加载一个文件提供程序,该文件提供程序应该在您提供的提供程序配置树中指定,但它没有被读取。

现在请清除ZF缓存,并检查是否

代码语言:javascript
复制
$persistence['provider'] = 'file';
$cache['provider'] = null;
$configuration['persistence'] = $persistence; 

请不要干涉。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15080052

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档