Ckeditor 在不使用Laravel core的脚本中使用Laravel core

Ckeditor 在不使用Laravel core的脚本中使用Laravel core,ckeditor,laravel,laravel-3,kcfinder,Ckeditor,Laravel,Laravel 3,Kcfinder,我已经构建了一个Laravel3应用程序,它涉及大量的用户内容管理 对于原型和内部测试,我通过简单的配置解决了问题,现在我们将开始一个封闭测试 首先,我必须锁定Laravel应用程序身份验证系统后面的KCFinder。 其次,我必须使用每个用户的设置配置KCF 虽然这似乎是两个问题,但我怀疑它们是否正确 My Laravel安装在/srv/http/中,KCFinder安装在/srv/http/public/php/KCFinder/中 KCFinder公开了两个传入文件-browse.php

我已经构建了一个Laravel3应用程序,它涉及大量的用户内容管理

对于原型和内部测试,我通过简单的配置解决了问题,现在我们将开始一个封闭测试

首先,我必须锁定Laravel应用程序身份验证系统后面的KCFinder
其次,我必须使用每个用户的设置配置KCF

虽然这似乎是两个问题,但我怀疑它们是否正确


My Laravel安装在
/srv/http/
中,KCFinder安装在
/srv/http/public/php/KCFinder/

KCFinder公开了两个传入文件-
browse.php
upload.php
。这些文件包括最终将KCF连接在一起的
core/autoload.php

我试图在它里面使用Laravel的
public/index.php
,然后试图通过浏览器访问一些KCF(
/php/kcfinder/browse.php
)。已重定向到请求路径和Laravel应用程序根路由的混合:
/php/kcfinder/browser

我如何防止Laravel的路由,并能够在KCF范围内使用Laravel


顺便说一句,我确实尝试过捆绑方式,但显然KCF写得太糟糕了,以至于为了捆绑它,我不得不重写那里的所有内容。

我用了一个非常非常肮脏的黑客程序

/srv/http/public/php/kcfinder/core/autoload.php
中,我添加了以下行:

require '../../../paths.php';

require path('sys').'core.php';

\Laravel\Bundle::start(DEFAULT_BUNDLE);

$KCFinderRoot = addslashes(realpath(dirname(__FILE__). '/../') . DS);

\Laravel\Autoloader::map(array(
    'browser' => $KCFinderRoot . 'core/browser.php',
    'uploader' => $KCFinderRoot . 'core/uploader.php',
    'type_img' => $KCFinderRoot . 'core/types/type_img.php',
    'type_mime' => $KCFinderRoot . 'core/types/type_mime.php',
    'gd' => $KCFinderRoot . 'lib/class_gd.php',
    'input' => $KCFinderRoot . 'lib/class_input.php',
    'zipFolder' => $KCFinderRoot . 'lib/class_zipFolder.php',
    'dir' => $KCFinderRoot . 'lib/helper_dir.php',
    'file' => $KCFinderRoot . 'lib/helper_file.php',
    'httpCache' => $KCFinderRoot . 'lib/helper_httpCache.php',
    'path' => $KCFinderRoot . 'lib/helper_path.php',
    'text' => $KCFinderRoot . 'lib/helper_text.php',
));

if (!\Laravel\Auth::check())
{
    die('no user :(');
}
在KCF包含一些文件的地方,我必须挤进
$KCFinderRoot
,在某些方法中甚至需要
全局
它们

在KCF的配置中,我添加了:

// ...
'uploadURL' => "/useruploads/" . sha1(Auth::user()->id . Auth::user()->email),
'uploadDir' => path('public') . "useruploads/" . sha1(Auth::user()->id . Auth::user()->email),
// ...
最终结果就像我希望的那样,只是我不知道这有多“聪明”


另外,在接下来的几天里,我将尝试将其捆绑起来,同时保留KCF文件的完整性。

当我回答并使其工作时,我将让Q打开一段时间。也许来自Laravel核心团队的人可以提供一些见解。您使用的是arch linux吗?您对Laravel 4使用的是ckfinder+kcfinder吗?我也在使用Arch,但试图在ckfinder中找到一个很好的照片上传解决方案。是的,我使用的是CK+KC组合。我同时使用这两种方法。我的kcfinder.php是:“'uploadURL'=>”/uploads/photo/”.$post->id“,'uploadDir'=>”。我可以在文件夹“/public/uploads/photo/images”中看到那张照片。我想上传的文件夹是“/public/uploads/img/posts/$postd”。我如何定义$post->id。你能帮我吗?谢谢