php - gii 不适用于 yiiexcel

标签 php plugins yii centos

我正在使用 Yii 并且有一个插件 YiiExcel。加载此插件时,Gii 不起作用。我的 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();

当我尝试生成文件时,我得到
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]# 

最佳答案

这是由于缺少文件。可以请下载文本/Diff.php 这里:

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

然后将其放入框架/gii/组件/ protected /组件 文件夹。它应该工作。

关于php - gii 不适用于 yiiexcel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20570735/

相关文章:

php - 删除时的横幅图像不重复编号

从测试服务器移动到实时服务器时出现 PHP 和 mysql 错误

php - Yii 框架 : Using data from related Active Record models for searching

php - Yii2 图片文件上传的条件验证

php - Yii:自定义 CRUD/管理 URL

php - beanstalkd 和hadoop 集成有什么好的方法吗?

php - 通过坐标获取单元格

javascript - jQuery 插件 : Do stuff to matched elements

Facebook 评论插件 "Warning: This Message Contains Blocked Content"

maven - Elasticsearch ICU插件-找不到分析器