Example #1
0
 /**
  * Get all the languages files in a particular path
  *
  * @param   string      $path             Path
  * @param   null|string $language         Language tag
  * @param   bool        $recursive        If a recursive search should be applied
  * @param   bool        $ignoreJoomlaCore If Joomla core languages files should be ignored
  *
  * @return array
  */
 protected static function getLanguageFilesInPath($path, $language = null, $recursive = true, $ignoreJoomlaCore = true)
 {
     if (NenoHelper::endsWith($path, '/')) {
         $path = substr($path, 0, mb_strlen($path) - 1);
     }
     jimport('joomla.filesystem.folder');
     if (is_null($language)) {
         $filter = '\\.ini$';
     } else {
         $filter = '^' . $language . '.*\\.ini$';
     }
     NenoLog::log('Looking for language files in [' . $language . '] inside: ' . $path, 3);
     // Load list
     $files = JFolder::files($path, $filter, $recursive, true);
     // Remove Joomla core files if needed
     if ($ignoreJoomlaCore === true && !empty($files)) {
         $files = self::removeCoreLanguageFilesFromArray($files, $language);
     }
     // Debug
     if (!empty($files)) {
         foreach ($files as $file) {
             NenoLog::log('Found file: ' . $file, 3);
         }
     }
     return $files === false ? array() : $files;
 }