diff options
Diffstat (limited to 'phpBB/phpbb/event')
-rw-r--r-- | phpBB/phpbb/event/php_exporter.php | 3 | ||||
-rw-r--r-- | phpBB/phpbb/event/recursive_event_filter_iterator.php | 43 |
2 files changed, 35 insertions, 11 deletions
diff --git a/phpBB/phpbb/event/php_exporter.php b/phpBB/phpbb/event/php_exporter.php index 8e4a9d399d..e95426244b 100644 --- a/phpBB/phpbb/event/php_exporter.php +++ b/phpBB/phpbb/event/php_exporter.php @@ -112,7 +112,8 @@ class php_exporter new \RecursiveDirectoryIterator( $dir, \FilesystemIterator::SKIP_DOTS - ) + ), + $dir ), \RecursiveIteratorIterator::LEAVES_ONLY ); diff --git a/phpBB/phpbb/event/recursive_event_filter_iterator.php b/phpBB/phpbb/event/recursive_event_filter_iterator.php index c520bdae4a..970c4bbd04 100644 --- a/phpBB/phpbb/event/recursive_event_filter_iterator.php +++ b/phpBB/phpbb/event/recursive_event_filter_iterator.php @@ -20,6 +20,29 @@ namespace phpbb\event; */ class recursive_event_filter_iterator extends \RecursiveFilterIterator { + protected $root_path; + + /** + * Construct + * + * @param \RecursiveIterator $iterator + * @param string $root_path + */ + public function __construct(\RecursiveIterator $iterator, $root_path) + { + $this->root_path = str_replace(DIRECTORY_SEPARATOR, '/', $root_path); + parent::__construct($iterator); + } + + /** + * Return the inner iterator's children contained in a recursive_event_filter_iterator + * + * @return recursive_event_filter_iterator + */ + public function getChildren() { + return new self($this->getInnerIterator()->getChildren(), $this->root_path); + } + /** * {@inheritDoc} */ @@ -30,16 +53,16 @@ class recursive_event_filter_iterator extends \RecursiveFilterIterator return (substr($relative_path, -4) === '.php' || $this->current()->isDir()) && $filename[0] !== '.' - && strpos($relative_path, 'phpBB/cache/') !== 0 - && strpos($relative_path, 'phpBB/develop/') !== 0 - && strpos($relative_path, 'phpBB/ext/') !== 0 - && strpos($relative_path, 'phpBB/files/') !== 0 - && strpos($relative_path, 'phpBB/includes/utf/') !== 0 - && strpos($relative_path, 'phpBB/language/') !== 0 - && strpos($relative_path, 'phpBB/phpbb/db/migration/data/') !== 0 - && strpos($relative_path, 'phpBB/phpbb/event/') !== 0 - && strpos($relative_path, 'phpBB/store/') !== 0 - && strpos($relative_path, 'phpBB/vendor/') !== 0 + && strpos($relative_path, $this->root_path . 'cache/') !== 0 + && strpos($relative_path, $this->root_path . 'develop/') !== 0 + && strpos($relative_path, $this->root_path . 'ext/') !== 0 + && strpos($relative_path, $this->root_path . 'files/') !== 0 + && strpos($relative_path, $this->root_path . 'includes/utf/') !== 0 + && strpos($relative_path, $this->root_path . 'language/') !== 0 + && strpos($relative_path, $this->root_path . 'phpbb/db/migration/data/') !== 0 + && strpos($relative_path, $this->root_path . 'phpbb/event/') !== 0 + && strpos($relative_path, $this->root_path . 'store/') !== 0 + && strpos($relative_path, $this->root_path . 'vendor/') !== 0 ; } } |