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); } } }
/** * Prepend a file path with the baseroot and normalize it. * * @param $file the file that shall get rebased * * @return string */ protected function realPath(File $file) { return Util::normalizePath($this->getConfig()->getBasePath() . '/' . $file->getPathname()); }
/** * Apply glob filters on current file. * * @param \Filicious\File $file * * @return bool */ protected function applyGlobFilters(File $file) { foreach ($this->globs as $glob) { if (!fnmatch($glob, $file->getPathname())) { return false; } } return true; }