protected function generateTimestamps($directory, $level = 0)
{
if (($dir = opendir($directory)) === false) {
throw new TIOException('directorycachedependency_directory_invalid', $directory);
}
$timestamps = array();
while (($file = readdir($dir)) !== false) {
$path = $directory . DIRECTORY_SEPARATOR . $file;
if ($file === '.' || $file === '..') {
continue;
} else {
if (is_dir($path)) {
if (($this->_recursiveLevel < 0 || $level < $this->_recursiveLevel) && $this->validateDirectory($path)) {
$timestamps = array_merge($this->generateTimestamps($path, $level + 1));
}
} else {
if ($this->validateFile($path)) {
$timestamps[$path] = filemtime($path);
}
}
}
}
closedir($dir);
return $timestamps;
}