1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Epesi\FileStorage; |
4
|
|
|
|
5
|
|
|
use Epesi\Core\System\Modules\ModuleCore; |
|
|
|
|
6
|
|
|
use Illuminate\Support\Facades\Route; |
7
|
|
|
use Spatie\Permission\Models\Permission; |
8
|
|
|
use Spatie\Permission\Models\Role; |
9
|
|
|
|
10
|
|
|
class FileStorageCore extends ModuleCore |
11
|
|
|
{ |
12
|
|
|
protected static $alias = 'filestorage'; |
13
|
|
|
|
14
|
|
|
protected static $view = FileStorageList::class; |
15
|
|
|
|
16
|
|
|
protected static $joints = [ |
17
|
|
|
Integration\FileStorageSystemSettings::class, |
18
|
|
|
Integration\LocalFileStorageAccess::class, |
19
|
|
|
Integration\RemoteFileStorageAccess::class, |
20
|
|
|
]; |
21
|
|
|
|
22
|
|
|
public static function info() |
23
|
|
|
{ |
24
|
|
|
return [ |
25
|
|
|
__('Author') => 'Georgi Hristov', |
26
|
|
|
__('Copyright') => 'X Systems Ltd', |
27
|
|
|
'', |
28
|
|
|
'Provides unified file storage functionality' |
29
|
|
|
]; |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
public function install() |
33
|
|
|
{ |
34
|
|
|
Models\File::migrate(); |
35
|
|
|
Models\FileAccessLog::migrate(); |
36
|
|
|
Models\FileContent::migrate(); |
37
|
|
|
Models\FileRemoteAccess::migrate(); |
38
|
|
|
|
39
|
|
|
$downloadFiles = Permission::create(['name' => 'download files']); |
40
|
|
|
|
41
|
|
|
Role::findByName('Admin')->givePermissionTo($downloadFiles); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public function uninstall() |
45
|
|
|
{ |
46
|
|
|
Permission::findByName('download files')->delete(); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public static function boot() |
50
|
|
|
{ |
51
|
|
|
Route::group(['namespace' => self::namespace()], function() { |
52
|
|
|
Route::get('file', 'FileStorageController@get')->middleware('web', FileStorageAccess::class); |
53
|
|
|
}); |
54
|
|
|
} |
55
|
|
|
} |
56
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths