|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* Lenevor Framework |
|
5
|
|
|
* |
|
6
|
|
|
* LICENSE |
|
7
|
|
|
* |
|
8
|
|
|
* This source file is subject to the new BSD license that is bundled |
|
9
|
|
|
* with this package in the file license.md. |
|
10
|
|
|
* It is also available through the world-wide-web at this URL: |
|
11
|
|
|
* https://lenevor.com/license |
|
12
|
|
|
* If you did not receive a copy of the license and are unable to |
|
13
|
|
|
* obtain it through the world-wide-web, please send an email |
|
14
|
|
|
* to [email protected] so we can send you a copy immediately. |
|
15
|
|
|
* |
|
16
|
|
|
* @package Lenevor |
|
17
|
|
|
* @subpackage Base |
|
18
|
|
|
* @link https://lenevor.com |
|
19
|
|
|
* @copyright Copyright (c) 2019 - 2023 Alexander Campo <[email protected]> |
|
20
|
|
|
* @license https://opensource.org/licenses/BSD-3-Clause New BSD license or see https://lenevor.com/license or see /license.md |
|
21
|
|
|
*/ |
|
22
|
|
|
|
|
23
|
|
|
namespace Syscodes\Components\Filesystem; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Allows manage the distint adapters of file system. |
|
27
|
|
|
*/ |
|
28
|
|
|
class FilesystemManager |
|
29
|
|
|
{ |
|
30
|
|
|
/** |
|
31
|
|
|
* The application instance. |
|
32
|
|
|
* |
|
33
|
|
|
* @var \Syscodes\Components\Contracts\Core\Application $app |
|
34
|
|
|
*/ |
|
35
|
|
|
protected $app; |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* The array of resolved filesystem drivers. |
|
39
|
|
|
* |
|
40
|
|
|
* @var array $disks |
|
41
|
|
|
*/ |
|
42
|
|
|
protected $disks = []; |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* Constructor. Create a new FilesystemManager instance. |
|
46
|
|
|
* |
|
47
|
|
|
* @param \Syscodes\Components\Contracts\Core\Application $app |
|
48
|
|
|
* |
|
49
|
|
|
* @return void |
|
50
|
|
|
*/ |
|
51
|
|
|
public function __construct($app) |
|
52
|
|
|
{ |
|
53
|
|
|
$this->app = $app; |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* Get a filesystem instance. |
|
58
|
|
|
* |
|
59
|
|
|
* @param string|null $name |
|
60
|
|
|
* @return \Illuminate\Contracts\Filesystem\Filesystem |
|
|
|
|
|
|
61
|
|
|
*/ |
|
62
|
|
|
public function disk($name = null) |
|
63
|
|
|
{ |
|
64
|
|
|
$name = $name ?: $this->getDefaultDriver(); |
|
65
|
|
|
|
|
66
|
|
|
return $this->disks[$name] = $this->get($name); |
|
|
|
|
|
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* Attempt to get the disk from the local cache. |
|
71
|
|
|
* |
|
72
|
|
|
* @param string $name |
|
73
|
|
|
* |
|
74
|
|
|
* @return \Syscodes\Components\Contracts\Filesystem\Filesystem |
|
75
|
|
|
*/ |
|
76
|
|
|
protected function get($name) |
|
77
|
|
|
{ |
|
78
|
|
|
return $this->disks[$name] ?? $this->resolve($name); |
|
|
|
|
|
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* Get the default driver name. |
|
83
|
|
|
* |
|
84
|
|
|
* @return string |
|
85
|
|
|
*/ |
|
86
|
|
|
public function getDefaultDriver(): string |
|
87
|
|
|
{ |
|
88
|
|
|
return $this->app['config']['filesystems.default']; |
|
89
|
|
|
} |
|
90
|
|
|
} |
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