You are here

protected function AbstractFileExtractor::extractFiles in Plug 7

Parameters

string|array $resource files, a file or a directory:

Return value

array

File

lib/Symfony/translation/Extractor/AbstractFileExtractor.php, line 26

Class

AbstractFileExtractor
Base class used by classes that extract translation messages from files.

Namespace

Symfony\Component\Translation\Extractor

Code

protected function extractFiles($resource) {
  if (is_array($resource) || $resource instanceof \Traversable) {
    $files = array();
    foreach ($resource as $file) {
      if ($this
        ->canBeExtracted($file)) {
        $files[] = $this
          ->toSplFileInfo($file);
      }
    }
  }
  elseif (is_file($resource)) {
    $files = $this
      ->canBeExtracted($resource) ? array(
      $this
        ->toSplFileInfo($resource),
    ) : array();
  }
  else {
    $files = $this
      ->extractFromDirectory($resource);
  }
  return $files;
}