mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
Optimize ignored default paths NO_CI
This commit is contained in:
parent
ddb6099db2
commit
7646f8a909
|
|
@ -38,7 +38,7 @@ final class Preloader
|
||||||
* @var string[]
|
* @var string[]
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private array $ignores = [];
|
private array $ignores = ['.', '..'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ignore a path or file from preloading
|
* Ignore a path or file from preloading
|
||||||
|
|
@ -82,9 +82,7 @@ final class Preloader
|
||||||
public function load() : void
|
public function load() : void
|
||||||
{
|
{
|
||||||
foreach ($this->includes as $include) {
|
foreach ($this->includes as $include) {
|
||||||
if (\in_array($include, ['.', '..'])
|
if (\in_array($include, $this->ignores)) {
|
||||||
|| \in_array($include, $this->ignores)
|
|
||||||
) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -114,9 +112,7 @@ final class Preloader
|
||||||
}
|
}
|
||||||
|
|
||||||
while ($file = \readdir($fh)) {
|
while ($file = \readdir($fh)) {
|
||||||
if (\in_array($file, ['.', '..'])
|
if (\in_array($file, $this->ignores)) {
|
||||||
|| \in_array($file, $this->ignores)
|
|
||||||
) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user