This repository was archived by the owner on Jul 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ return [
126
126
Install dependency
127
127
128
128
``` bash
129
- $ composer require league /flysystem-dropbox
129
+ $ composer require spatie /flysystem-dropbox
130
130
```
131
131
132
132
Configure on the application ` components ` section:
@@ -138,8 +138,7 @@ return [
138
138
//...
139
139
'fs' => [
140
140
'class' => 'dosamigos\flysystem\DropboxFsComponent',
141
- 'token' => 'your-token',
142
- 'app' => 'your-app',
141
+ 'token' => 'your-access-token',
143
142
// 'prefix' => 'your-prefix',
144
143
],
145
144
],
Original file line number Diff line number Diff line change 1
1
<?php
2
+
2
3
/**
3
4
* This file is part of the 2amigos/yii2-flysystem-component project.
4
5
*
7
8
* For the full copyright and license information, please view
8
9
* the LICENSE file that was distributed with this source code.
9
10
*/
11
+
10
12
namespace dosamigos \flysystem ;
11
13
12
14
use Spatie \Dropbox \Client ;
@@ -19,14 +21,11 @@ class DropboxFsComponent extends AbstractFsComponent
19
21
* @var string
20
22
*/
21
23
public $ token ;
24
+
22
25
/**
23
26
* @var string
24
27
*/
25
- public $ app ;
26
- /**
27
- * @var string|null
28
- */
29
- public $ prefix ;
28
+ public $ prefix = '' ;
30
29
31
30
/**
32
31
* @inheritdoc
@@ -37,8 +36,8 @@ public function init()
37
36
throw new InvalidConfigException ('The "token" property must be set. ' );
38
37
}
39
38
40
- if ($ this ->app === null ) {
41
- throw new InvalidConfigException ('The "app " property must be set . ' );
39
+ if (! is_string ( $ this ->prefix ) ) {
40
+ throw new InvalidConfigException ('The "prefix " property must be a string . ' );
42
41
}
43
42
44
43
parent ::init ();
@@ -50,8 +49,7 @@ public function init()
50
49
protected function initAdapter ()
51
50
{
52
51
return new DropboxAdapter (
53
- new Client ($ this ->token , $ this ->app ),
54
- $ this ->prefix
52
+ new Client ($ this ->token ), $ this ->prefix
55
53
);
56
54
}
57
55
}
You can’t perform that action at this time.
0 commit comments