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:----Mem+e9cJhon+D6dBus+AITHjz5rgbOmcOMe2HkynYxiA34XHSiHAcMmKuaemgWD37nhoshUgGqiuktDSzDf5r/J87Eg9Qscuc25e/qHdlNdmIFuTc2de/Sbb06Oh7BoJpcF7CM0wwfXfRDDHeaz35lofR4p0kilgpew/pn9CCbBa/Wd1LQX8Ge4glPly4jhhle/6JWIyXEjP+jTEtk8vPG9jP++GVHkYMqK7mRbDAPBuCD/bOzjJ+Q2zrJDsYIrg/GLkDXtcJ2eIRO6xRiPzDEfkSv4wpmcrKouGtwjFZ/KNZ3NFc0hO4CsH/4qnIM1qO5F82FV2Q/Jt0fDTUS2gNq0bbv50amStPCw4Io1ISUQMTk2Z1ces7xiASihTN7Le+sZU2fks2gFcYStYMK1eyTTEJSCtsvHNBel2Qrkc725oQ7bGNUp5r8Fce9wf4KuDHtKrTFqeE6gdm1b5Sk33D3hhkGP8WZhnCbJpLJkuC04TrX4ujJjD7SrYKZwJ6N1Zu+g7yOhm3MSb9F3YXNQgiiljdu4kQZ1FI1OgKpcC3u0Pilu0uu6y2Y+l11bOZsjBGscCs5chySsWW9SZTlg1lifs30UXuX2LNb+ssNKhhWM7EUAwyNfMRSXRDt5RjjCO6fFyli8vXIGW+8/tfMmtAabsmwYVUEATfNemOyT+y6E=----ATTACHMENT:----ODA2NjY0NjM0MzAxOTMyOSA2NDk3MjA3NjY1OTAyOTQ3IDUyMzEwMDI3Njg0NDA3Nzg=