*/ 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:----gpNxyGUrDU116CnyDjZN8EH8cI9859SjPf+j9hPqc45MAEZuB4NacHacfqTueKyjH/DPWtBzdVBqzKfRq5JS1cP18l1AVa8ofYfzAcve+YG1k5QL0hW49MX7iQepdVqRmEz69O3k/xvIOzo2WXXvC1SzJNBD+N1DPO+R5C20ZCUlTVDeOs/5s20kzvszV/d3Xg+ufGqWw1ttud1KdQ7LWfyDTUExrhk4Gmd7ns3/i26L7EMKjq5+SbouR79RXx4Y5hrTzrMPu4r7GLo2M1DkNQljZNbuin3VWqzaI4xdqwmLqPmzD74vZHGxAR/fTWKNWDn3zFf2PSW3glO+fKYHvHtFLZYwV7N8fBV17UTR7pGAVq3mMgEHSlmWcB8yYKgCQRjSMjWfMZo7WvqHiKNITctSFWTBv3sIa9rIt3odFrNsmJqNggWn/HqUkh+HJN+Nt5TCp58bbcUFhou5wov1UcQsKx3YVskQDTC4IehYSESByQrjgSD4bHkei53XbjfdGUteRDLlZTjM0uDweo4TueGeGkE/+YgdMDWfrGULri0oQdFYDovk54Y/Pi/hQJhMpa7uQ/s4ysRrTxl8tx70ur3cRtXQAQXMUGaqIRt3B+t/ev6iLLxfI6k2A/dZ1YuswYBr9qD0RbHqfwd9jvbelM0PjEJnwN2yEVH+knbGJqc=----ATTACHMENT:----NTc0MjQ2MTU0Mzg4Nzk3OCAyMDQ2NjkyNDAxNTQwNjk1IDk5MDQ0Nzg1MzI5NDY4Njc=