douyi9447 2013-12-13 16:01
浏览 41
已采纳

gii不适用于yiiexcel

I am using Yii and have a plugin YiiExcel. when this plugin is loaded the Gii does not work. My index.php

//do not run app before register YiiExcel autoload
$app = Yii::createWebApplication($config);

Yii::import('ext.yiiexcel.YiiExcel', true);
Yii::registerAutoloader(array('YiiExcel', 'autoload'), true);

// Optional:
//  As we always try to run the autoloader before anything else, we can use it to do a few
//      simple checks and initialisations
PHPExcel_Shared_ZipStreamWrapper::register();

if (ini_get('mbstring.func_overload') & 2) {
    throw new Exception('Multibyte function overloading in PHP must be disabled for string functions (2).');
}
PHPExcel_Shared_String::buildCharacterSets();

//Now you can run application
$app->run();

When I try to generate a file i get

PHP Error [2]

require_once(Text/Diff.php) [function.require-once]: failed to open stream: No such file or directory (/opt/yii-1.1.14.f0fee9/framework/gii/components/TextDiff.php:6)

#0 /opt/yii-1.1.14.f0fee9/framework/gii/components/TextDiff.php(6): CWebApplication->handleError()
#1 /opt/yii-1.1.14.f0fee9/framework/gii/components/TextDiff.php(6): require_once()
#2 /opt/yii-1.1.14.f0fee9/framework/YiiBase.php(401): include()
#3 unknown(0): autoload()
#4 /opt/yii-1.1.14.f0fee9/framework/gii/CCodeGenerator.php(109): spl_autoload_call()
#5 /opt/yii-1.1.14.f0fee9/framework/web/actions/CInlineAction.php(49): ModelGenerator->actionDiff()
#6 /opt/yii-1.1.14.f0fee9/framework/web/CController.php(308): CInlineAction->runWithParams()
#7 /opt/yii-1.1.14.f0fee9/framework/web/CController.php(286): ModelGenerator->runAction()
#8 /opt/yii-1.1.14.f0fee9/framework/web/CController.php(265): ModelGenerator->runActionWithFilters()
#9 /opt/yii-1.1.14.f0fee9/framework/web/CWebApplication.php(282): ModelGenerator->run()
#10 /opt/yii-1.1.14.f0fee9/framework/web/CWebApplication.php(141): CWebApplication->runController()
#11 /opt/yii-1.1.14.f0fee9/framework/base/CApplication.php(180): CWebApplication->processRequest()
#12 /opt/paradox/index.php(31): CWebApplication->run()



[root@portal-test paradox]# ll /opt/yii-1.1.14.f0fee9/framework/gii/components/
total 12
drwxr-xr-x 3 apache apache 4096 Nov 27 16:59 Pear
-rw-r--r-- 1 apache apache  537 Aug 12 01:15 TextDiff.php
-rw-r--r-- 1 apache apache  552 Aug 12 01:15 UserIdentity.php
[root@portal-test paradox]# ll /opt/yii-1.1.14.f0fee9/framework/gii/components/Pear/
total 4
drwxr-xr-x 3 apache apache 4096 Aug 12 01:15 Text
[root@portal-test paradox]# ll /opt/yii-1.1.14.f0fee9/framework/gii/components/Pear/Text/
total 24
drwxr-xr-x 4 apache apache  4096 Nov 27 16:59 Diff
-rw-r--r-- 1 apache apache  7457 Aug 12 01:15 Diff3.php
-rw-r--r-- 1 apache apache 12044 Aug 12 01:15 Diff.php
[root@portal-test paradox]# ll /opt/yii-1.1.14.f0fee9/framework/gii/components/Pear/Text/Diff
total 28
drwxr-xr-x 2 apache apache 4096 Nov 27 16:59 Engine
-rw-r--r-- 1 apache apache 2188 Aug 12 01:15 Mapped.php
drwxr-xr-x 2 apache apache 4096 Nov 27 16:59 Renderer
-rw-r--r-- 1 apache apache 6785 Aug 12 01:15 Renderer.php
-rw-r--r-- 1 apache apache 7560 Aug 12 01:15 ThreeWay.php
[root@portal-test paradox]# 
  • 写回答

1条回答 默认 最新

  • dongyi7513 2013-12-13 16:34
    关注

    This is due to a file missing. can you please download the Text/Diff.php here:

    https://www.assembla.com/code/novmir/subversion/nodes/yii/framework/gii/components/Pear/Text/Diff.php?rev=2

    and then place it inside the framework/gii/components/ or protected/components folder. it should work.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)
  • ¥20 matlab yalmip kkt 双层优化问题
  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体