* Switched to Composer to manage "dev" dependencies
* Fixed READMEs
* Excluded vendor in phpunit.xml.dist files
* Fixed message in bootstrap.php files
* Added autoloader for the component itself
Commits
-------
94bee7a [Filesystem] symlink() creates target directories
Discussion
----------
[Filesystem] symlink() creates target directories
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes [![Build Status](https://secure.travis-ci.org/michal-pipa/symfony.png?branch=symlink-fix)](http://travis-ci.org/michal-pipa/symfony)
Fixes the following tickets: #3967
Todo: -
Changed symlink() method behavior to recursively create target directory if it does not exist. It makes Filesystem component methods more consistent since copy() does the same. It is also more convenient.
Also mirror() fails to create symlink in non-existent directory (if we don't want to change symlink(), than we need to fix mirror()).
Fixes: #3967
Commits
-------
efad5d5 [Filesystem] Prevented infiite loop on windows while calling mirror on symlink. Added test for mirroring symlinks.
Discussion
----------
[Filesystem] Prevented infinite loop on windows while mirrorring symlinks
First check for filetype in *mirror()* method is:
if (is_link($file)) {
$this->symlink($file, $target);
later we see:
} elseif (is_file($file) || ($copyOnWindows && is_link($file))) {
$this->copy($file, $target, isset($options['override']) ? $options['override'] : false);
The later check for links on windows (*$copyOnWindows && is_link($file)*) won't ever get called. Calling *symlink()* in *mirror()* on windows would lead to calling *mirror()* again.
Note that I didn't actually try running it on windows platform. I added a test for mirroring symlinks (non-windows test). I think it'd be good if someone added some windows specific tests to this class.
I also modified the target path:
$target = $targetDir.'/'.str_replace($originDir.DIRECTORY_SEPARATOR, '', $file->getPathname());
It didn't use DIRECTORY_SEPARATOR and is equivalent to:
$target = str_replace($originDir, $targetDir, $file->getPathname());
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: ~
Todo: ~