Skip to content
This repository was archived by the owner on Aug 22, 2021. It is now read-only.

Commit 20c1554

Browse files
committed
add qiniu support
1 parent 41d8ded commit 20c1554

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
"Overtrue\\LaravelUEditor\\":"src/"
1414
}
1515
},
16-
"require": {},
16+
"require": {
17+
"qiniu/php-sdk": "7.*"
18+
},
1719
"require-dev": {
1820
"fabpot/php-cs-fixer": "^1.10"
1921
}

src/QiNiuStorage.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class QiNiuStorage implements StorageInterface
3333
public function store(UploadedFile $file, $filename)
3434
{
3535
$uploadManager = new UploadManager();
36+
3637
list($result, $error) = $uploadManager->putFile(
3738
$this->getQiNiuAuth()->uploadToken(config('filesystems.disks.qiniu.bucket')),
3839
basename($filename),
@@ -90,6 +91,8 @@ public function getUrl($filename)
9091
}
9192

9293
/**
94+
* Get QiNiu auth object.
95+
*
9396
* @return string
9497
*/
9598
protected function getQiNiuAuth()
@@ -99,6 +102,8 @@ protected function getQiNiuAuth()
99102

100103

101104
/**
105+
* Get QiNiu url base on file key.
106+
*
102107
* @param $key
103108
* @return string
104109
*/
@@ -108,6 +113,8 @@ protected function getQiNiuUrl($key)
108113
}
109114

110115
/**
116+
* Get QiNiu operation object.
117+
*
111118
* @return Operation
112119
*/
113120
protected function getQiNiuOperation()

src/config/ueditor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

33
return [
4-
// 存储引擎:filesystem.php 中 disks
5-
'disk' => 'qiniu',
4+
// 存储引擎:filesystem.php 中 disks,local 或 qiniu
5+
'disk' => 'local',
66

77
'route' => [
88
'name' => '/ueditor/server',

0 commit comments

Comments
 (0)