-
Notifications
You must be signed in to change notification settings - Fork 295
/
DefaultConfigRepository.php
213 lines (195 loc) · 4.47 KB
/
DefaultConfigRepository.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?php
namespace Alexusmai\LaravelFileManager\Services\ConfigService;
/**
* Class DefaultConfigRepository
*
* @package Alexusmai\LaravelFileManager\Services\ConfigService
*/
class DefaultConfigRepository implements ConfigRepository
{
/**
* LFM Route prefix
* !!! WARNING - if you change it, you should compile frontend with new prefix(baseUrl) !!!
*
* @return string
*/
final public function getRoutePrefix(): string
{
return config('file-manager.routePrefix');
}
/**
* Get disk list
*
* ['public', 'local', 's3']
*
* @return array
*/
final public function getDiskList(): array
{
return config('file-manager.diskList');
}
/**
* Default disk for left manager
*
* null - auto select the first disk in the disk list
*
* @return string|null
*/
final public function getLeftDisk(): ?string
{
return config('file-manager.leftDisk');
}
/**
* Default disk for right manager
*
* null - auto select the first disk in the disk list
*
* @return string|null
*/
final public function getRightDisk(): ?string
{
return config('file-manager.rightDisk');
}
/**
* Default path for left manager
*
* null - root directory
*
* @return string|null
*/
final public function getLeftPath(): ?string
{
return config('file-manager.leftPath');
}
/**
* Default path for right manager
*
* null - root directory
*
* @return string|null
*/
final public function getRightPath(): ?string
{
return config('file-manager.rightPath');
}
/**
* File manager modules configuration
*
* 1 - only one file manager window
* 2 - one file manager window with directories tree module
* 3 - two file manager windows
*
* @return int
*/
final public function getWindowsConfig(): int
{
return config('file-manager.windowsConfig');
}
/**
* File upload - Max file size in KB
*
* null - no restrictions
*/
final public function getMaxUploadFileSize(): ?int
{
return config('file-manager.maxUploadFileSize');
}
/**
* File upload - Allow these file types
*
* [] - no restrictions
*/
final public function getAllowFileTypes(): array
{
return config('file-manager.allowFileTypes');
}
/**
* Show / Hide system files and folders
*
* @return bool
*/
final public function getHiddenFiles(): bool
{
return config('file-manager.hiddenFiles');
}
/**
* Middleware
*
* Add your middleware name to array -> ['web', 'auth', 'admin']
* !!!! RESTRICT ACCESS FOR NON ADMIN USERS !!!!
*
* @return array
*/
final public function getMiddleware(): array
{
return config('file-manager.middleware');
}
/**
* ACL mechanism ON/OFF
*
* default - false(OFF)
*
* @return bool
*/
final public function getAcl(): bool
{
return config('file-manager.acl');
}
/**
* Hide files and folders from file-manager if user doesn't have access
*
* ACL access level = 0
*
* @return bool
*/
final public function getAclHideFromFM(): bool
{
return config('file-manager.aclHideFromFM');
}
/**
* ACL strategy
*
* blacklist - Allow everything(access - 2 - r/w) that is not forbidden by the ACL rules list
*
* whitelist - Deny anything(access - 0 - deny), that not allowed by the ACL rules list
*
* @return string
*/
final public function getAclStrategy(): string
{
return config('file-manager.aclStrategy');
}
/**
* ACL rules repository
*
* default - config file(ConfigACLRepository)
*
* @return string
*/
final public function getAclRepository(): string
{
return config('file-manager.aclRepository');
}
/**
* ACL Rules cache
*
* null or value in minutes
*
* @return int|null
*/
final public function getAclRulesCache(): ?int
{
return config('file-manager.aclRulesCache');
}
/**
* Whether to slugify filenames
*
* boolean
*
* @return bool|null
*/
final public function getSlugifyNames(): ?bool
{
return config('file-manager.slugifyNames', false);
}
}