You are here

class IniFileLoader in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/translation/Loader/IniFileLoader.php \Symfony\Component\Translation\Loader\IniFileLoader
  2. 8 vendor/symfony/dependency-injection/Loader/IniFileLoader.php \Symfony\Component\DependencyInjection\Loader\IniFileLoader
Same name and namespace in other branches
  1. 8.0 vendor/symfony/translation/Loader/IniFileLoader.php \Symfony\Component\Translation\Loader\IniFileLoader

IniFileLoader loads translations from an ini file.

@author stealth35

Hierarchy

Expanded class hierarchy of IniFileLoader

1 file declares its use of IniFileLoader
IniFileLoaderTest.php in vendor/symfony/translation/Tests/Loader/IniFileLoaderTest.php
1 string reference to 'IniFileLoader'
TranslatorTest::getTransFileTests in vendor/symfony/translation/Tests/TranslatorTest.php

File

vendor/symfony/translation/Loader/IniFileLoader.php, line 23

Namespace

Symfony\Component\Translation\Loader
View source
class IniFileLoader extends ArrayLoader {

  /**
   * {@inheritdoc}
   */
  public function load($resource, $locale, $domain = 'messages') {
    if (!stream_is_local($resource)) {
      throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
    }
    if (!file_exists($resource)) {
      throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
    }
    $messages = parse_ini_file($resource, true);
    $catalogue = parent::load($messages, $locale, $domain);
    if (class_exists('Symfony\\Component\\Config\\Resource\\FileResource')) {
      $catalogue
        ->addResource(new FileResource($resource));
    }
    return $catalogue;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ArrayLoader::flatten private function Flattens an nested array of translations.
IniFileLoader::load public function Loads a locale. Overrides ArrayLoader::load