Skip to content

Navigation Menu

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 8eca661

Browse filesBrowse files
author
Erik Trapman
committed
[FileSystem] explains possible failure of symlink creation in windows
1 parent b1f8744 commit 8eca661
Copy full SHA for 8eca661

File tree

1 file changed

+6
-0
lines changed
Filter options

1 file changed

+6
-0
lines changed

‎src/Symfony/Component/Filesystem/Filesystem.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Filesystem/Filesystem.php
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,12 @@ public function symlink($originDir, $targetDir, $copyOnWindows = false)
275275

276276
if (!$ok) {
277277
if (true !== @symlink($originDir, $targetDir)) {
278+
$report = error_get_last();
279+
if (is_array($report)) {
280+
if (defined('PHP_WINDOWS_VERSION_MAJOR') && false !== strpos($report['message'], 'error code(1314)')) {
281+
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?');
282+
}
283+
}
278284
throw new IOException(sprintf('Failed to create symbolic link from %s to %s', $originDir, $targetDir));
279285
}
280286
}

0 commit comments

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