We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When it is packaged in a phar, it gets upset.
Message: Fail to load language file 'phar:///path/to/my.phar/vendor/vlucas/valitron/lang/en.php' File: phar:///path/to/my.phar/vendor/vlucas/valitron/src/Valitron/Validator.php Line: 113
The lines in question:
if (stream_resolve_include_path($langFile)) { $langMessages = include $langFile; static::$_ruleMessages = array_merge(static::$_ruleMessages, $langMessages); } else { throw new \InvalidArgumentException("Fail to load language file '" . $langFile . "'"); }
It seems as though stream_resolve_include_path returns false when in a phar, because $langDir returns a phar:///path/to/lang/.
stream_resolve_include_path
$langDir
phar:///path/to/lang/
Maybe is_file is a solution?
is_file
The text was updated successfully, but these errors were encountered:
Can you check if it works when you replace
if (stream_resolve_include_path($langFile)) {
with
if (stream_resolve_include_path(realpath($langFile))) {
?
Sorry, something went wrong.
@willemwollebrants you are correct, that'll fix it. But I'm not sure if it's the right way to fix it.
E.g.
$langFile = 'phar:///path/to/my.phar/vendor/vlucas/valitron/lang/en.php'; var_dump(realpath($langFile)); // bool(false) var_dump(stream_resolve_include_path(realpath($langFile)); // string "phar:///path/to/my.phar/vendor/"
No branches or pull requests
When it is packaged in a phar, it gets upset.
The lines in question:
It seems as though
stream_resolve_include_path
returns false when in a phar, because$langDir
returns aphar:///path/to/lang/
.Maybe
is_file
is a solution?The text was updated successfully, but these errors were encountered: