AppserverIo\Appserver\Core\Scanner\AbstractScanner::getDirectoryHash PHP Метод

getDirectoryHash() защищенный Метод

This is used to test if the hash value changed, so if it changed, the appserver can react accordingly.
protected getDirectoryHash ( SplFileInfo $directory ) : string
$directory SplFileInfo The directory to watch
Результат string The hash value build out of the found filenames
    protected function getDirectoryHash(\SplFileInfo $directory)
    {
        // prepare the array
        $files = new \ArrayObject();
        // prepare the array with the file extensions of the files used to build the hash
        $extensionsToWatch = $this->getExtensionsToWatch();
        // clear the cache
        clearstatcache();
        // add all files with the found extensions to the array
        foreach (glob($directory . '/*.{' . implode(',', $extensionsToWatch) . '}', GLOB_BRACE) as $filename) {
            $files->append($filename);
        }
        // calculate and return the hash value for the array
        return md5($files->serialize());
    }