8000 Problem in phar by betzholz · Pull Request #25579 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Problem in phar #25579

New issue

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

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Problem in phar
If packed into phar the old version creates path like 'file:///phar%3A/'.
  • Loading branch information
Boris Nikolaus Betzholz authored Dec 22, 2017
commit de7b348dddce2d2f2c5984c9af573501a491e49c
Original file line number Diff line number Diff line change
Expand Up @@ -599,16 +599,19 @@ public function validateSchema(\DOMDocument $dom)
$imports = '';
foreach ($schemaLocations as $namespace => $location) {
$parts = explode('/', $location);
$locationstart= 'file:///';
if (0 === stripos($location, 'phar://')) {
$tmpfile = tempnam(sys_get_temp_dir(), 'symfony');
if ($tmpfile) {
copy($location, $tmpfile);
$tmpfiles[] = $tmpfile;
$parts = explode('/', str_replace('\\', '/', $tmpfile));
}
array_shift($parts);
$locationstart='phar:///';
}
$drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
$location = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts));
$location = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts));

$imports .= sprintf(' <xsd:import namespace="%s" schemaLocation="%s" />'."\n", $namespace, $location);
}
Expand Down
0