示例#1
0
 /**
  * Accumulate all static view files in the application and record all found areas, themes and languages
  *
  * Returns an array of areas and files with meta information
  *
  * @param array $requestedLocales
  * @return array
  */
 private function collectAppFiles($requestedLocales)
 {
     $areas = [];
     $locales = [];
     $files = $this->filesUtil->getStaticPreProcessingFiles();
     foreach ($files as $info) {
         list($area, $themePath, $locale) = $info;
         if ($themePath) {
             $areas[$area][$themePath] = $themePath;
         }
         if ($locale) {
             $locales[$locale] = $locale;
         }
     }
     foreach ($requestedLocales as $locale) {
         unset($locales[$locale]);
     }
     if (!empty($locales)) {
         $langList = implode(', ', $locales);
         $this->logger->logMessage("WARNING: there were files for the following languages detected in the file system: {$langList}." . ' These languages were not requested, so the files will not be populated.');
     }
     return [$areas, $files];
 }