class IniFileLoader in Zircon Profile 8
Same name in this branch
- 8 vendor/symfony/translation/Loader/IniFileLoader.php \Symfony\Component\Translation\Loader\IniFileLoader
- 8 vendor/symfony/dependency-injection/Loader/IniFileLoader.php \Symfony\Component\DependencyInjection\Loader\IniFileLoader
Same name and namespace in other branches
- 8.0 vendor/symfony/translation/Loader/IniFileLoader.php \Symfony\Component\Translation\Loader\IniFileLoader
IniFileLoader loads translations from an ini file.
@author stealth35
Hierarchy
- class \Symfony\Component\Translation\Loader\ArrayLoader implements LoaderInterface
- class \Symfony\Component\Translation\Loader\IniFileLoader
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\LoaderView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ArrayLoader:: |
private | function | Flattens an nested array of translations. | |
IniFileLoader:: |
public | function |
Loads a locale. Overrides ArrayLoader:: |