class PhpFileLoader in Zircon Profile 8
Same name in this branch
- 8 vendor/symfony/routing/Loader/PhpFileLoader.php \Symfony\Component\Routing\Loader\PhpFileLoader
- 8 vendor/symfony/translation/Loader/PhpFileLoader.php \Symfony\Component\Translation\Loader\PhpFileLoader
- 8 vendor/symfony/dependency-injection/Loader/PhpFileLoader.php \Symfony\Component\DependencyInjection\Loader\PhpFileLoader
Same name and namespace in other branches
- 8.0 vendor/symfony/translation/Loader/PhpFileLoader.php \Symfony\Component\Translation\Loader\PhpFileLoader
PhpFileLoader loads translations from PHP files returning an array of translations.
@author Fabien Potencier <fabien@symfony.com>
Hierarchy
- class \Symfony\Component\Translation\Loader\ArrayLoader implements LoaderInterface
- class \Symfony\Component\Translation\Loader\PhpFileLoader
Expanded class hierarchy of PhpFileLoader
1 file declares its use of PhpFileLoader
- PhpFileLoaderTest.php in vendor/
symfony/ translation/ Tests/ Loader/ PhpFileLoaderTest.php
1 string reference to 'PhpFileLoader'
- TranslatorTest::getTransFileTests in vendor/
symfony/ translation/ Tests/ TranslatorTest.php
File
- vendor/
symfony/ translation/ Loader/ PhpFileLoader.php, line 23
Namespace
Symfony\Component\Translation\LoaderView source
class PhpFileLoader 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 = (require $resource);
$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. | |
PhpFileLoader:: |
public | function |
Loads a locale. Overrides ArrayLoader:: |