| 82 | } |
| 83 | |
| 84 | func (p *pattern) allowReload(event *watcher.Event) bool { |
| 85 | if !isValidEventType(event.EffectType) || !isValidPathType(event) { |
| 86 | return false |
| 87 | } |
| 88 | |
| 89 | // some editors create temporary files and never actually modify the original file |
| 90 | // so we need to also check Event.AssociatedPathName |
| 91 | // see https://github.com/php/frankenphp/issues/1375 |
| 92 | return p.isValidPattern(event.PathName) || p.isValidPattern(event.AssociatedPathName) |
| 93 | } |
| 94 | |
| 95 | func (p *pattern) handle(event *watcher.Event) { |
| 96 | // If the watcher prematurely sends the die@ event, retry watching |