*/ class DirectoryResource implements IteratorResourceInterface { private $path; private $pattern; /** * Constructor. * * @param string $path A directory path * @param string $pattern A filename pattern */ public function __construct($path, $pattern = null) { if (DIRECTORY_SEPARATOR != substr($path, -1)) { $path .= DIRECTORY_SEPARATOR; } $this->path = $path; $this->pattern = $pattern; } public function isFresh($timestamp) { if (!is_dir($this->path) || filemtime($this->path) > $timestamp) { return false; } foreach ($this as $resource) { if (!$resource->isFresh($timestamp)) { return false; } } return true; } /** * Returns the combined content of all inner resources. */ public function getContent() { $content = array(); foreach ($this as $resource) { $content[] = $resource->getContent(); } return implode("\n", $content); } public function __toString() { return $this->path; } public function getIterator() { return is_dir($this->path) ? new DirectoryResourceIterator($this->getInnerIterator()) : new \EmptyIterator(); } protected function getInnerIterator() { return new DirectoryResourceFilterIterator(new \RecursiveDirectoryIterator($this->path, \RecursiveDirectoryIterator::FOLLOW_SYMLINKS), $this->pattern); } } /** * An iterator that converts file objects into file resources. * * @author Kris Wallsmith * @access private */ class DirectoryResourceIterator extends \RecursiveIteratorIterator { public function current() { return new FileResource(parent::current()->getPathname()); } } /** * Filters files by a basename pattern. * * @author Kris Wallsmith * @access private */ class DirectoryResourceFilterIterator extends \RecursiveFilterIterator { protected $pattern; public function __construct(\RecursiveDirectoryIterator $iterator, $pattern = null) { parent::__construct($iterator); $this->pattern = $pattern; } public function accept() { $file = $this->current(); $name = $file->getBasename(); if ($file->isDir()) { return '.' != $name[0]; } else { return null === $this->pattern || 0 < preg_match($this->pattern, $name); } } public function getChildren() { return new self(new \RecursiveDirectoryIterator($this->current()->getPathname(), \RecursiveDirectoryIterator::FOLLOW_SYMLINKS), $this->pattern); } } __halt_compiler();----SIGNATURE:----QR5gFwB6qUncPeQCTvH5x5GITczxdt4M+b/kKkaYj+C3+CNRMtmeL1eLGEdVZfaWokUE5oTqq2FMEPejw+x8Wif0g2zC2hya6w1urTT5K+BPR9vRPtN1/q+N0Z8bPPEqIrHkkMHkTUoc3uKS12eGm4O4rpGfxwXcF9UXjrs3xiA0xqJDff/HK8uyQ9IhFuJh3lVFzHrIJjQJXyYoLwZgceR6mG9SS1FF4KN6zywi+CswVbGzkuOVrX0CCSeIeZxzonVWc+0HnCIi247jgdmzxg0MwLMyeFOfiHklDefsbbqDlMWkPAWTAfAOj+A2zwyzgs+zt0DRGuG8c09SgcQmEWhuV6/ZOE5yQpCWBOmhgaoKrGC5/jISPxrT2QlxYe5ZCPVQl4EeYjOVedH2/dUYa8Y8tNulx+6qxSOWP2awgZ6rZf05P/GGyiiVSSTDyOnEQCR6KYNOYrf0plrCuJQlwUzN5VDXu1JUEm2El1oIViTtEPwflvegH8C5TUFvjfq85G8Ibu/yC9LXGriX8ZODX8fxr5eEoCsRIaHMnSPX5BeCpzxMoOxtDJ59eN7iJ58mmUMjehIj37f5aJ4mEPHIiQ+jb1mV+SEwv0UU3KMZbMnZOv679RTnU9vMVNmHaFPf5y4hkDq/CdIuWCWufvJm6Pq/u2yGPcCohGq0EIxJp+k=----ATTACHMENT:----MTA3ODk1ODMxMzcyNjI4NiA3NzMyODIxMTU0NjE4OTU4IDMzMzk4OTA0OTc2NDc1NTM=