jonlil/ckfinder-bundle

此包已被废弃,不再维护。未建议替代包。
关于此包的最新版本(3.0.0)没有提供许可证信息。

安装次数: 20,241

依赖者: 1

建议者: 0

安全: 0

星标: 11

关注者: 7

分支: 12

开放问题: 9

语言:JavaScript

类型:symfony-bundle

3.0.0 2015-09-10 20:56 UTC

This package is not auto-updated.

Last update: 2017-08-04 06:36:21 UTC


README

由于ckfinder不在任何包管理器中,因此此项目无法工作。

要使其工作,您需要自行下载ckfinder并将其安装在vendor/jonlil/ckfinder中。

这是一个为了使其工作的丑陋的解决方案,但如果有人有时间,我很乐意接受一个PR,从ckfinders的主页下载源代码并将其放入正确的文件夹。

JonlilCKFinderBundle

  1. 安装

在您的composer.json文件的require部分添加以下行

用于CKEditor 4.4.6及以上版本

"jonlil/ckfinder-bundle": "3.*"

用于CKEditor 4.4.5及以下版本

"jonlil/ckfinder-bundle": "2.*"

app/AppKernel.php中注册此包

public function registerBundles()
{
    $bundles = array(
        new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
        new Jonlil\CKFinderBundle\JonlilCKFinderBundle('IvoryCKEditorBundle'),
    );
}
  1. 配置
路由
# app/config/routing.yml

ck_finder:
    resource: "@JonlilCKFinderBundle/Resources/config/routing/routing.yml"
    prefix: /ckfinder
用于与Amazon S3一起使用
# app/config/config.yml

jonlil_ck_finder:
    license:
        key: ""
        name: ""
    baseDir: "/"
    baseUrl: "http://s3.amazonaws.com"
    service: "s3"
    accessKey: ""
    secret: ""
    bucket: ""

还有一些可选参数

"thumbnailsEnabled": 如果您想在不同的图片上显示缩略图

"thumbnailsFile": 使用特定的缩略图来创建预览

"directAccess": 如果您可以直接访问文件以进行预览

"fileDelete", "fileRename", "fileUpload", "fileView": 如果您想阻止某些文件操作

"folderRename", "folderDelete", "folderCreate", "folderView": 如果您想阻止对文件夹的某些操作

用于与原生PHP存储一起使用
jonlil_ck_finder:
    license: # optional, can be used in demo mode also
        key: ""
        name: ""
    baseDir: "%assetic.read_from%"
    baseUrl: "/userfiles/"  # path where your files will be stored
    service: "php"
身份验证
# app/config/config.yml

parameters:
    jonlil.ckfinder.customAuthentication: %kernel.root_dir%/...path your custom config.php or any other file

在您的自定义config.php中编写自己的CheckAuthentication()函数

示例

function CheckAuthentication()
{
	isset($_SESSION['IsAuthorized']) && $_SESSION['IsAuthorized'];

}
  1. 用法

# in your symfony2 form - add this
public function buildForm (FormBuilderInterface $builder, array $options)
{
    $builder
        ->add('title')
        ->add('text', 'ckfinder')
        ->add('createdAt')
        ->add('updatedAt')
    ;
}
  1. 测试

此包提供了一组集成测试,您应该在源代码发生更改时运行这些测试。

  • 克隆此包。
  • 执行composer update
  • 运行php vendor/bin/phpunit
  1. 待办事项

修复Amazon S3缩略图 - 参考此项目

应在CheckAuthentication()中管理安全。有关更多详细信息,请查看config.php文件。