8000 minor #10160 [Translation] [Loader] Add INI_SCANNER_RAW to parse ini … · symfony/symfony@7c3a3e1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7c3a3e1

Browse files
committed
minor #10160 [Translation] [Loader] Add INI_SCANNER_RAW to parse ini files (TeLiXj)
This PR was merged into the 2.5-dev branch. Discussion ---------- [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 Commits ------- 5ef60f1 [Translation] [Loader] Add INI_SCANNER_RAW to parse ini files
2 parents d61f492 + 5ef60f1 commit 7c3a3e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Translation/Loader/IniFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function load($resource, $locale, $domain = 'messages')
3535
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
3636
}
3737

38-
$messages = parse_ini_file($resource, true);
38+
$messages = parse_ini_file($resource, true, INI_SCANNER_RAW);
3939

4040
$catalogue = parent::load($messages, $locale, $domain);
4141
$catalogue->addResource(new FileResource($resource));

0 commit comments

Comments
 (0)
0