protected function reindexChildCheckers()
    {
        $this->fileEvents = array_fill_keys(array_keys($this->files), IN_DELETE);
        $this->dirEvents  = array_fill_keys(array_keys($this->directories), IN_DELETE);
        foreach ($this->getResource()->getFilteredResources() as $resource) {
            $basename = basename((string) $resource);
            if ($resource instanceof FileResource) {
                if (isset($this->files[$basename])) {
                    $this->fileEvents[$basename] = IN_MODIFY;
                } else {
                    $this->files[$basename] = $resource;
                    $this->fileEvents[$basename] = 'new';
                }
            } else {
                isset($this->directories[$basename])
                    ? $this->dirEvents[$basename] = IN_CREATE
                    : $this->createNewDirectoryChecker($basename, $resource);
            }
        }
        $this->watch();
    }
protected function reindexChildCheckers()
    {
        $this->fileEvents = array_fill_keys(array_keys($this->files), IN_DELETE);
        $this->dirEvents  = array_fill_keys(array_keys($this->directories), IN_DELETE);
        foreach ($this->getResource()->getFilteredResources() as $resource) {
            $basename = basename((string) $resource);
            if ($resource instanceof FileResource) {
                if (isset($this->files[$basename])) {
                    $this->fileEvents[$basename] = IN_MODIFY;
                } else {
                    $this->files[$basename] = $resource;
                    $this->fileEvents[$basename] = 'new';
                }
            } else {
                isset($this->directories[$basename])
                    ? $this->dirEvents[$basename] = IN_CREATE
                    : $this->createNewDirectoryChecker($basename, $resource);
            }
        }
        $this->watch();
    }
protected function reindexChildCheckers ( ) { $ this -> fileEvents = array_fill_keys ( array_keys ( $ this -> files ) , IN_DELETE ) ; $ this -> dirEvents = array_fill_keys ( array_keys ( $ this -> directories ) , IN_DELETE ) ; foreach ( $ this -> getResource ( ) -> getFilteredResources ( ) as $ resource ) { $ basename = basename ( ( string ) $ resource ) ; if ( $ resource instanceof FileResource ) { if ( isset ( $ this -> files [ $ basename ] ) ) { $ this -> fileEvents [ $ basename ] = IN_MODIFY ; } else { $ this -> files [ $ basename ] = $ resource ; $ this -> fileEvents [ $ basename ] = 'new' ; } } else { isset ( $ this -> directories [ $ basename ] ) ? $ this -> dirEvents [ $ basename ] = IN_CREATE : $ this -> createNewDirectoryChecker ( $ basename , $ resource ) ; } } $ this -> watch ( ) ; }
Used in case the folder was deleted and than created again or situations like this.
It rescans the folder, files that was before get IN_MODIFY event, folders - IN_CREATE - to make them to rescan itself
Used in case the folder was deleted and than created again or situations like this . It rescans the folder files that was before get IN_MODIFY event folders - IN_CREATE - to make them to rescan itself