/** * @param $targetDir * @param \PhotoOrganize\Domain\Ports\Filesystem $fs * @return string */ public function createSymlink($targetDir, Filesystem $fs) { $dir = $this->getDatePath(); $fs->mkdir("{$targetDir}/{$dir}"); $fs->symlink($this->file->getRealPath(), "{$targetDir}/{$this->getSymlinkTarget()}", true); return "{$targetDir}/{$this->getSymlinkTarget()}"; }
/** * @param Path $source original file * @param Path $target new file */ public function createLink(Path $source, Path $target) { $this->fs->symlink($source->getValue(), $target->getValue(), true); }