1
0
Fork 0

Filesystem/autoload fixes for windows, refs #2304, #2342, #2365

pull/2376/head
Jordi Boggiano 2013-10-28 11:01:17 +01:00
parent a2a70380c1
commit 50fbfe4d63
2 changed files with 5 additions and 5 deletions

View File

@ -43,7 +43,7 @@ class AutoloadGenerator
$filesystem = new Filesystem();
$filesystem->ensureDirectoryExists($config->get('vendor-dir'));
$basePath = $filesystem->normalizePath(getcwd());
$basePath = $filesystem->normalizePath(realpath(getcwd()));
$vendorPath = $filesystem->normalizePath(realpath($config->get('vendor-dir')));
$useGlobalIncludePath = (bool) $config->get('use-include-path');
$prependAutoloader = $config->get('prepend-autoloader') === false ? 'false' : 'true';

View File

@ -223,11 +223,11 @@ class Filesystem
}
$commonPath = $to;
while (strpos($from.'/', $commonPath.'/') !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath) && '\\' !== $commonPath) {
$commonPath = dirname($commonPath);
while (strpos($from.'/', $commonPath.'/') !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath)) {
$commonPath = strtr(dirname($commonPath), '\\', '/');
}
if (0 !== strpos($from, $commonPath) || '/' === $commonPath || '\\' === $commonPath) {
if (0 !== strpos($from, $commonPath) || '/' === $commonPath) {
return $to;
}
@ -262,7 +262,7 @@ class Filesystem
$commonPath = $to;
while (strpos($from.'/', $commonPath.'/') !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath) && '.' !== $commonPath) {
$commonPath = dirname($commonPath);
$commonPath = strtr(dirname($commonPath), '\\', '/');
}
if (0 !== strpos($from, $commonPath) || '/' === $commonPath || '.' === $commonPath) {