/** * Open directory handle * * @param string $path * @param int $options * * @return boolean */ public function dir_opendir($path, $options) { $this->openFile($path); if ($this->file->isDirectory()) { $this->directoryIterator = $this->file->getIterator(); return true; } return false; }
protected function addFilesFrom(File $directory, $into) { $this->output->writeln(' <info>*</info> Add php files from ' . $directory->getPathname()); $files = $directory->getIterator(File::LIST_RECURSIVE); /** @var File $file */ foreach ($files as $file) { if (fnmatch('*.php', $file->getPathname()) && !fnmatch('*/test/*', $file->getPathname()) && !fnmatch('*/tests/*', $file->getPathname()) && $file->getBasename() != 'BundlerPackCommand.php') { $path = $into . '/' . ltrim(str_replace($directory->getPathname(), '', $file->getPathname()), '/'); $this->addFile($file, $path); } } }