Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 49addbe

Browse filesBrowse files
committed
bug symfony#20676 [ClassLoader] Use only forward slashes in generated class map (nicolas-grekas)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes symfony#20676). Discussion ---------- [ClassLoader] Use only forward slashes in generated class map | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#20655 | License | MIT | Doc PR | - Commits ------- 6d1f1b5 [ClassLoader] Use only forward slashes in generated class map
2 parents ec937cb + 6d1f1b5 commit 49addbe
Copy full SHA for 49addbe

File tree

Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed

‎src/Symfony/Component/ClassLoader/ClassCollectionLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/ClassLoader/ClassCollectionLoader.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static function load($classes, $cacheDir, $name, $autoReload, $adaptive =
6363
throw new \RuntimeException(sprintf('Class Collection Loader was not able to create directory "%s"', $cacheDir));
6464
}
6565
$cacheDir = rtrim(realpath($cacheDir) ?: $cacheDir, '/'.DIRECTORY_SEPARATOR);
66-
$cache = $cacheDir.DIRECTORY_SEPARATOR.$name.$extension;
66+
$cache = $cacheDir.'/'.$name.$extension;
6767

6868
// auto-reload
6969
$reload = false;
@@ -114,7 +114,7 @@ public static function load($classes, $cacheDir, $name, $autoReload, $adaptive =
114114
REGEX;
115115
$dontInlineRegex = str_replace('.', $spacesRegex, $dontInlineRegex);
116116

117-
$cacheDir = explode(DIRECTORY_SEPARATOR, $cacheDir);
117+
$cacheDir = explode('/', str_replace(DIRECTORY_SEPARATOR, '/', $cacheDir));
118118
$files = array();
119119
$content = '';
120120
foreach (self::getOrderedClasses($classes) as $class) {
@@ -126,19 +126,19 @@ public static function load($classes, $cacheDir, $name, $autoReload, $adaptive =
126126
$c = file_get_contents($file);
127127

128128
if (preg_match($dontInlineRegex, $c)) {
129-
$file = explode(DIRECTORY_SEPARATOR, $file);
129+
$file = explode('/', str_replace(DIRECTORY_SEPARATOR, '/', $file));
130130

131131
for ($i = 0; isset($file[$i], $cacheDir[$i]); ++$i) {
132132
if ($file[$i] !== $cacheDir[$i]) {
133133
break;
134134
}
135135
}
136136
if (1 >= $i) {
137-
$file = var_export(implode(DIRECTORY_SEPARATOR, $file), true);
137+
$file = var_export(implode('/', $file), true);
138138
} else {
139139
$file = array_slice($file, $i);
140-
$file = str_repeat('..'.DIRECTORY_SEPARATOR, count($cacheDir) - $i).implode(DIRECTORY_SEPARATOR, $file);
141-
$file = '__DIR__.'.var_export(DIRECTORY_SEPARATOR.$file, true);
140+
$file = str_repeat('../', count($cacheDir) - $i).implode('/', $file);
141+
$file = '__DIR__.'.var_export('/'.$file, true);
142142
}
143143

144144
$c = "\nnamespace {require $file;}";

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.