From 5ef60f14945f31e2805ed3fede5c775b54d2e758 Mon Sep 17 00:00:00 2001 From: TeLiXj Date: Wed, 29 Jan 2014 22:47:07 +0100 Subject: [PATCH] [Translation] [Loader] Add INI_SCANNER_RAW to parse ini files | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | yes | Deprecations? | no | Tests pass? | no | Fixed tickets | | License | MIT | Doc PR | INI_SCANNER_RAW change the default scanner mode of parse_ini_files to parse all values without evaluate. This allow values with single quotes, "no" and "false" and raise an error if you use the deprecated "#" as comment character. This change is specially good for shared translations, because a translator haven't to know that he can't use a few restricted terms. And has a residual improvement: it's twice fast that use the default value (INI_SCANNER_NORMAL) in my tests --- src/Symfony/Component/Translation/Loader/IniFileLoader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Translation/Loader/IniFileLoader.php b/src/Symfony/Component/Translation/Loader/IniFileLoader.php index 616fa7e0e775f..b4907280397a2 100644 --- a/src/Symfony/Component/Translation/Loader/IniFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/IniFileLoader.php @@ -35,7 +35,7 @@ public function load($resource, $locale, $domain = 'messages') throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); } - $messages = parse_ini_file($resource, true); + $messages = parse_ini_file($resource, true, INI_SCANNER_RAW); $catalogue = parent::load($messages, $locale, $domain); $catalogue->addResource(new FileResource($resource)); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy