resource = realpath($resource); $this->pattern = $pattern; if (false === $this->resource || !is_dir($this->resource)) { throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $resource)); } } /** * @return string */ public function getResource() { return $this->resource; } /** * @return string */ public function getPattern() { return $this->pattern; } /** * @return string */ public function __toString() { return md5(serialize(array($this->resource, $this->pattern))); } public function exists() { clearstatcache(true, $resource = $this->getResource()); return is_dir($resource); } public function getModificationTime() { if (!$this->exists()) { return -1; } clearstatcache(true, $this->getResource()); if (false === $mtime = @filemtime($this->getResource())) { return -1; } return $mtime; } public function isFresh($timestamp) { if (!$this->exists()) { return false; } return $this->getModificationTime() < $timestamp; } public function getId() { return md5('d' . $this . $this->getPattern()); } public function hasFile($file) { if (!$file instanceof \SplFileInfo) { $file = new \SplFileInfo($file); } if (0 !== strpos($file->getRealPath(), realpath($this->getResource()))) { return false; } if ($this->getPattern()) { return (bool) preg_match($this->getPattern(), $file->getBasename()); } return true; } public function getFilteredResources() { if (!$this->exists()) { return array(); } // race conditions try { $iterator = new \DirectoryIterator($this->getResource()); } catch (\UnexpectedValueException $e) { return array(); } $resources = array(); foreach ($iterator as $file) { // if regex filtering is enabled only return matching files if ($file->isFile() && !$this->hasFile($file)) { continue; } // always monitor directories for changes, except the .. entries // (otherwise deleted files wouldn't get detected) if ($file->isDir() && '/..' === substr($file, -3)) { continue; } // if file is dot - continue if ($file->isDot()) { continue; } if ($file->isFile()) { $resources[] = new FileResource($file->getRealPath()); } elseif ($file->isDir()) { $resources[] = new DirectoryResource($file->getRealPath()); } } return $resources; } } __halt_compiler();----SIGNATURE:----lzKu9hqvMswvs7k0g0NtEMI/GZ23D5fhXf+bJdhoOeCihw4CYd05uUiwp+HxnEDnbc+Rx95vzfRi/mlZtohQvCH4LuLl+O7H8w9YqDRwuGwx1EzQxtGiCcThcoowuA/WsWh1/xLqCzeti1tdKZtbNLy3P49dx7uPu53W8RmACCheBZRmMoWATHIAL81PZNVG3VDLCX553d9Ua0q+YdfY3fnSGvX8uLJdCbAQP4QbmFeEiGiU5nB0cIqax/ySqXN1eRoNT82z0FgSnfJugTGwtrGeAmq3xX6pOfletj64gT4dfl4IkHzspGFHe8AZJ8KoPIqBs8Tp3mOu/qvnYkwblW677yC67fyTXJVEJizVHiYhAyBdug4NB4eIYFFT+scUOE9/FM7gDslA/gpdPzkOHMoXip3EPBMnYWo8h97lTUsJo+yyhDvgyxX1StbB4OmtNM+tjVQZGuM0/7AipyK7GqON9TrnIxruYyNr7kUIqBrd4VrVVSX7TqwsWtdPz7O2TloLkV7iVRSqzWZVTSY4UGBRiSuUncnmYr5KQFflhSeKLrqaNsGylq2ljQ2th7sp+whqNkEt0cR3x9H2QhJ/2GW/KjE9E2tZjvsZaG5yysZnIJ8Ok402mRPiyt0WW4LJdgUU632eVNP3RaWe59iQoWXt7WXrON8cTH1G8APvcbw=----ATTACHMENT:----NjQxMjg3OTE5NjQzMTkwMSA0MDQ1NjI2NDAyOTA5MTA4IDY3NjEzNzQ2NDk0MDIzNzU=