eee
This commit is contained in:
@@ -63,7 +63,10 @@ class FileWatcher extends AbstractProcess implements OnProcessInterface
|
||||
public function __construct()
|
||||
{
|
||||
$this->watchPaths = config('servers.reload.listen', []);
|
||||
$this->excludePatterns = config('servers.reload.scan.skip_patterns', []);
|
||||
$this->excludePatterns = array_values(array_unique(array_merge(
|
||||
['/vendor/', '/tests/', '/cache/', '/node_modules/', '/storage/', '/.git/', '/.idea/'],
|
||||
config('servers.reload.scan.skip_patterns', [])
|
||||
)));
|
||||
$this->extensions = config('servers.reload.scan.extensions', ['php']);
|
||||
|
||||
di(EventProvider::class)->on(OnWorkerStart::class, [di(Router::class), 'scan_build_route']);
|
||||
@@ -237,8 +240,10 @@ class FileWatcher extends AbstractProcess implements OnProcessInterface
|
||||
|
||||
private function isExcluded(string $path): bool
|
||||
{
|
||||
$path = '/' . trim(str_replace('\\', '/', $path), '/') . '/';
|
||||
foreach ($this->excludePatterns as $pattern) {
|
||||
if (strpos($path, $pattern) !== false) {
|
||||
$pattern = '/' . trim(str_replace('\\', '/', (string)$pattern), '/') . '/';
|
||||
if ($pattern !== '//' && strpos($path, $pattern) !== false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user