You are here

protected function ContentExport::readDirectory in Content Export YAML 8

2 calls to ContentExport::readDirectory()
ContentExport::load_entity_config_list in src/ContentExport.php
ContentExport::load_entity_config_list_with_path in src/ContentExport.php
Get one Entity exported

File

src/ContentExport.php, line 173

Class

ContentExport
Created by PhpStorm. User: USER Date: 11/13/18 Time: 2:04 PM

Namespace

Drupal\content_export_yaml

Code

protected function readDirectory($directory) {
  $path_file = [];
  if (is_dir(DRUPAL_ROOT . $directory)) {
    $it = scandir(DRUPAL_ROOT . $directory);
    if (!empty($it)) {
      foreach ($it as $fileinfo) {
        if ($fileinfo && strpos($fileinfo, '.yml') !== FALSE) {
          $file = DRUPAL_ROOT . $directory . "/" . $fileinfo;
          if (file_exists($file)) {
            $path_file[] = DRUPAL_ROOT . $directory . "/" . $fileinfo;
          }
        }
      }
    }
  }
  return $path_file;
}