27 throw new \ErrorException(
"Could not find path '$sourcePath'");
52 if (is_link($destPath)) {
53 if (realpath(readlink($destPath)) == realpath($sourcePath)) {
72 if (file_exists($destPath) &&
is_dir($destPath)) {
73 if (basename($sourcePath) === basename($destPath)) {
77 throw new \ErrorException(
"Target $dest already exists (set extra.magento-force to override)");
80 $destPath .=
'/' . basename(
$source);
89 if (file_exists($destPath)) {
93 throw new \ErrorException(
"Target $dest already exists and is not a symlink (set extra.magento-force to override)");
98 if (strtoupper(substr(PHP_OS, 0, 3)) !==
'WIN') {
103 if(
false === symlink($sourcePath, $destPath)) {
104 throw new \ErrorException(
"An error occured while creating symlink" . $sourcePath);
108 if(
false === $destPath = readlink($destPath)){
109 throw new \ErrorException(
"Symlink $destPath points to target $destPath");
126 $from = str_replace(array(
'/./',
'//',
'\\'),
'/', $from);
127 $to = str_replace(array(
'/./',
'//',
'\\'),
'/', $to);
130 $from = dirname($from);
132 $from = rtrim($from,
'/');
135 $dir = explode(
'/', $from);
136 $file = explode(
'/', $to);
138 while ($file && $dir && ($dir[0] == $file[0])) {
143 $relativePath = str_repeat(
'../', count($dir)) . implode(
'/', $file);
getRelativePath($from, $to)
removeTrailingSlash($path)
static rmdirRecursive($dir)
mkdir($pathname, $mode=0777, $recursive=false, $context=null)
createDelegate($source, $dest)