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);
         }
     }
 }
Exemple #2
0
 /**
  * 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());
 }
Exemple #3
0
 /**
  * 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;
 }