You are here

protected function BaseValidatorForm::scanAllDirs in Advanced CSS/JS Aggregation 8.3

Same name and namespace in other branches
  1. 8.4 advagg_validator/src/Form/BaseValidatorForm.php \Drupal\advagg_validator\Form\BaseValidatorForm::scanAllDirs()
  2. 8.2 advagg_validator/src/Form/BaseValidatorForm.php \Drupal\advagg_validator\Form\BaseValidatorForm::scanAllDirs()

Recursively scan the drupal webroot for files matching the given extension.

Parameters

string $ext: Usually css or js.

Return value

array An array of files.

1 call to BaseValidatorForm::scanAllDirs()
BaseValidatorForm::generateForm in advagg_validator/src/Form/BaseValidatorForm.php
Generate a hierarchical form sorted by path from asset files.

File

advagg_validator/src/Form/BaseValidatorForm.php, line 218

Class

BaseValidatorForm
Base form for all advagg validator options.

Namespace

Drupal\advagg_validator\Form

Code

protected function scanAllDirs($ext) {
  $options = [
    'nodirmask' => '/(\\.git|.*\\/files*)/',
  ];
  $output = $this
    ->scanDirectory(\Drupal::root(), '/.*\\.' . $ext . '$/', $options);
  $files = [];
  foreach ($output as $values) {
    $files[] = str_replace(\Drupal::root() . '/', '', $values->uri);
  }
  return $files;
}