こんにちは私は現在のzendアプリケーションにモバイルテンプレートを追加しようとしましたが、サーバーエラーが返されます。以下は、いくつかのサイトでフォローしている私の構成です。
application.in
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
<?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
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
}
}
ありがとう!!
更新:次のようにエラーが返されます
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