custom-d/zon-storage
Composer 安装命令:
composer require custom-d/zon-storage
包简介
A storage api plugin for zon projects
README 文档
README
Installation:
- In your zon projects composer.json add to the bottom:
"repositories": [
{
"type": "vcs",
"url": "git@git.customd.com:composer/zon-storage.git"
}
]
then run composer require custom-d/zon-storage
Run
site/_composer/bin/zon-storage-setuporfin exec site/_composer/bin/zon-storage-setupand follow the promptsconfirm you now have migrations, models etc setup configure and run the migration
In your
site/application/librariesfolder a new file:DF_Files.phpwith the following content should exist
<?php
require_once(dirname(__DIR__) . '/zon/libraries/DF_Files.php');
use CustomD\ZonStorage\StorageTrait;
class My_DF_Files extends DF_Files
{
use StorageTrait;
}
- If needed copy the files from zon/controllers to your own controllers dir. add at the top of the class:
use CustomD\ZonStorage\hasStorageTrait;
class Files
{
use hasStorageTrait;
and look for any references to upload / upload_files methods and the variable set for $display_url and update to use a bucket name:
eg:
$display_url = (empty($this->input->post('display_url')) ? 'files/display' : $this->input->post('display_url'));
Becomes
$display_url = (empty($this->input->post('bucket')) ? 'local' : $this->input->post('bucket'));
The last step will involve looking where you use the df_files upload methods and altering the first part to being a bucket name. (alternatively you could set a file config for files/display in your storage config file.)
统计信息
- 总下载量: 240
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-23