Ejemplo n.º 1
0
 /**
  * Returns the collection of files based on the input and configuration.
  *
  * @param InputInterface $input
  *
  * @return \phpDocumentor\File\Collection
  */
 protected function getFileCollection($input)
 {
     $files = new \phpDocumentor\Fileset\Collection();
     $files->setAllowedExtensions($this->getOption($input, 'extensions', 'parser/extensions/extension', array('php', 'php3', 'phtml'), true));
     $files->setIgnorePatterns($this->getOption($input, 'ignore', 'files/ignore', array(), true));
     $files->setIgnoreHidden($this->getOption($input, 'hidden', 'files/ignore-hidden', 'off') == 'on');
     $files->setFollowSymlinks($this->getOption($input, 'ignore-symlinks', 'files/ignore-symlinks', 'off') == 'on');
     $added_files = $this->getOption($input, 'filename', 'files/file', array(), true);
     foreach ($added_files as &$file) {
         $file = realpath($file);
     }
     $files->addFiles($added_files);
     $added_directories = $this->getOption($input, 'directory', 'files/directory', array(), true);
     foreach ($added_directories as &$dir) {
         $dir = realpath($dir);
     }
     $files->addDirectories($added_directories);
     return $files;
 }
Ejemplo n.º 2
0
 /**
  * Returns the collection of files based on the input and configuration.
  *
  * @param InputInterface $input
  *
  * @return \phpDocumentor\File\Collection
  */
 protected function getFileCollection($input)
 {
     $files = new \phpDocumentor\Fileset\Collection();
     $files->setAllowedExtensions($this->getOption($input, 'extensions', 'parser/extensions/extension', array('php', 'php3', 'phtml'), true));
     $files->setIgnorePatterns($this->getOption($input, 'ignore', 'files/ignore', array(), true));
     $files->setIgnoreHidden($this->getOption($input, 'hidden', 'files/ignore-hidden', 'off') == 'on');
     $files->setFollowSymlinks($this->getOption($input, 'ignore-symlinks', 'files/ignore-symlinks', 'off') == 'on');
     $file_options = $this->getOption($input, 'filename', 'files/file', array(), true);
     $added_files = array();
     foreach ($file_options as $glob) {
         if (!is_string($glob)) {
             continue;
         }
         $matches = glob($glob);
         if (is_array($matches)) {
             foreach ($matches as $file) {
                 if (!empty($file)) {
                     $file = realpath($file);
                     if (!empty($file)) {
                         $added_files[] = $file;
                     }
                 }
             }
         }
     }
     $files->addFiles($added_files);
     $directory_options = $this->getOption($input, 'directory', 'files/directory', array(), true);
     $added_directories = array();
     foreach ($directory_options as $glob) {
         if (!is_string($glob)) {
             continue;
         }
         $matches = glob($glob, GLOB_ONLYDIR);
         if (is_array($matches)) {
             foreach ($matches as $dir) {
                 if (!empty($dir)) {
                     $dir = realpath($dir);
                     if (!empty($dir)) {
                         $added_directories[] = $dir;
                     }
                 }
             }
         }
     }
     $files->addDirectories($added_directories);
     return $files;
 }
Ejemplo n.º 3
0
 /**
  * Returns the collection of files based on the input and configuration.
  *
  * @param InputInterface $input
  *
  * @return \phpDocumentor\File\Collection
  */
 protected function getFileCollection($input)
 {
     $files = new \phpDocumentor\Fileset\Collection();
     $files->setAllowedExtensions((array) $this->getOption($input, 'extensions', 'parser/extensions/extension', array('php', 'php3', 'phtml')));
     $files->setIgnorePatterns((array) $this->getOption($input, 'ignore', 'files/ignore', array()));
     $files->setIgnoreHidden($this->getOption($input, 'hidden', 'files/ignore-hidden', 'off') == 'on');
     $files->setFollowSymlinks($this->getOption($input, 'ignore-symlinks', 'files/ignore-symlinks', 'off') == 'on');
     $files->addFiles((array) $this->getOption($input, 'filename', 'files/file', array()));
     $files->addDirectories((array) $this->getOption($input, 'directory', 'files/directory', array()));
     return $files;
 }