Permalink
Browse files

[FileSystem] explains possible failure of symlink creation in windows

  • Loading branch information...
1 parent bd4799b commit ba54074358bce2daff738614b435d1ca35b27e8a @ErikTrapman ErikTrapman committed Jun 18, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 Filesystem.php
View
6 Filesystem.php
@@ -275,6 +275,12 @@ public function symlink($originDir, $targetDir, $copyOnWindows = false)
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));
}
}

0 comments on commit ba54074

Please sign in to comment.