Merge pull request #1 from SamsonIT/FilesystemExceptions

[FileSystem] explain possible failure of symlink creation in windows
This commit is contained in:
Romain Neutron 2012-06-19 01:12:41 -07:00
commit a20fc68b10

View File

@ -275,6 +275,12 @@ class Filesystem
if (!$ok) {
if (true !== @symlink($originDir, $targetDir)) {
$report = error_get_last();
if (is_array($report)) {
if (defined('PHP_WINDOWS_VERSION_MAJOR') && false !== strpos($report['message'], 'error code(1314)')) {
throw new IOException('Unable to create symlink due to error code 1314: \'A required privilege is not held by the client\'. Do you have the required Administrator-rights?');
}
}
throw new IOException(sprintf('Failed to create symbolic link from %s to %s', $originDir, $targetDir));
}
}