blueraster / csfilesystem
v1.0.1
2020-11-11 03:32 UTC
Requires
- illuminate/support: ^5.8
- league/flysystem: ^1.1
- nesbot/carbon: ^2.41
README
安装
php composer.phar require blueraster/csfilesystem
## or use below if you receive an error about minimum-stability
php composer.phar require blueraster/csfilesystem dev-main
如果在安装过程中遇到错误,请参阅本文档底部的安装故障排除部分
配置
在 app/AppKernel.php 中注册捆绑包
class AppKernel extends Kernel { public function registerBundles() { $bundles = [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Symfony\Bundle\TwigBundle\TwigBundle(), new Symfony\Bundle\MonologBundle\MonologBundle(), new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), // add this line before AppBundle() new BlueRaster\CSFilesystem\CSFilesystemBundle(), new AppBundle\AppBundle(), ];
将路由添加到 app/config/routing.yml
app: resource: '@AppBundle/Controller/ui' type: annotation csfilesystem: resource: '@CSFilesystemBundle/FilesController.php' type: annotation
如果在
/file-manager/页面收到错误消息,需要清除应用程序的缓存。删除var/cache目录中的文件
添加菜单项的 JS 段落
如果您想在文件页面上添加链接,请将以下片段添加到位于 dist/js/sb-admin-2.js 的 JavaScript 文件底部
(function(d){ ('addEventListener' in window) && window.addEventListener("load", function(){ var menu = d.getElementById("side-menu"); var li = d.createElement("li"); li.innerHTML = '<a href="/file-manager"><i class="fa fa-folder-o fa-fw"></i> List Files</a>'; menu && menu.appendChild(li); }); })(document);
安装故障排除
在某些情况下,您可能会在安装过程中收到错误。以下信息将帮助您解决问题。
PHP 版本错误
安装时可能会收到提及 PHP 版本的错误。对于 CSWeb 的某些版本,您的 package.json 文件中已指定特定的 PHP 版本。要从命令行删除它
php composer.phar config --unset platform.php
或简单地从 composer.json 中手动删除该部分
内存不足错误
如果您收到类似于以下错误的错误
PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 134217736 bytes)
这是由于在更新时运行的一个内部开发脚本导致的。要修复此问题,请在所有 require 和 install 命令中添加 --no-scripts。要永久防止此问题,请使用命令
php composer.phar config --unset scripts.post-update-cmd