@@ -70,7 +70,7 @@ protected function inotifyPerformAdditionalOperations(array $inotifyEvent): void
70
70
$ eventInfo = new EventInfo ($ inotifyEvent , $ this ->watchedItems [$ inotifyEvent ['wd ' ]]);
71
71
// Register this path also if it's directory
72
72
if ($ eventInfo ->getWatchedItem ()->isDir ()) {
73
- $ this ->recursivelyRegisterInotifyEvent ($ eventInfo ->getWatchedItem ()->getFullPath ());
73
+ $ this ->inotifyWatchPathRecursively ($ eventInfo ->getWatchedItem ()->getFullPath ());
74
74
}
75
75
76
76
return ;
@@ -81,7 +81,7 @@ protected function inotifyPerformAdditionalOperations(array $inotifyEvent): void
81
81
$ eventInfo = new EventInfo ($ inotifyEvent , $ this ->watchedItems [$ inotifyEvent ['wd ' ]]);
82
82
// Remove this path also if it's directory
83
83
if ($ eventInfo ->getWatchedItem ()->isDir ()) {
84
- $ this ->removeInotifyEvent ($ eventInfo );
84
+ $ this ->inotifyRemovePathWatch ($ eventInfo );
85
85
}
86
86
}
87
87
}
@@ -93,23 +93,23 @@ protected function inotifyPerformAdditionalOperations(array $inotifyEvent): void
93
93
* @param string $path
94
94
* @return void
95
95
*/
96
- protected function recursivelyRegisterInotifyEvent (string $ path ): void
96
+ protected function inotifyWatchPathRecursively (string $ path ): void
97
97
{
98
98
if (is_dir ($ path )) {
99
99
$ iterator = new RecursiveDirectoryIterator ($ path );
100
100
101
101
// Loop through files
102
102
foreach (new RecursiveIteratorIterator ($ iterator ) as $ file ) {
103
103
if ($ file ->isDir ()/**&& !in_array($file->getRealPath(), $this->watchedItems)**/ ) {
104
- $ this ->registerInotifyEvent ($ file ->getRealPath ());
104
+ $ this ->inotifyWatchPath ($ file ->getRealPath ());
105
105
}
106
106
}
107
107
108
108
return ;
109
109
}
110
110
111
111
// Register file watch
112
- $ this ->registerInotifyEvent ($ path );
112
+ $ this ->inotifyWatchPath ($ path );
113
113
}
114
114
115
115
/**
@@ -118,7 +118,7 @@ protected function recursivelyRegisterInotifyEvent(string $path): void
118
118
* @param string $path
119
119
* @return void
120
120
*/
121
- protected function registerInotifyEvent (string $ path ): void
121
+ protected function inotifyWatchPath (string $ path ): void
122
122
{
123
123
$ descriptor = inotify_add_watch (
124
124
$ this ->getInotifyFD (),
@@ -138,7 +138,7 @@ protected function registerInotifyEvent(string $path): void
138
138
* @param EventInfo $eventInfo
139
139
* @return void
140
140
*/
141
- protected function removeInotifyEvent (EventInfo $ eventInfo )
141
+ protected function inotifyRemovePathWatch (EventInfo $ eventInfo )
142
142
{
143
143
// Stop watching event
144
144
inotify_rm_watch ($ this ->getInotifyFD (), $ eventInfo ->getWatchDescriptor ());
@@ -209,7 +209,7 @@ public function watch(): void
209
209
{
210
210
// Register paths
211
211
foreach ($ this ->paths as $ path ) {
212
- $ this ->recursivelyRegisterInotifyEvent ($ path );
212
+ $ this ->inotifyWatchPathRecursively ($ path );
213
213
}
214
214
215
215
// Set up a new event listener for inotify read events
0 commit comments