mirror of
				https://github.com/hauke68/Magallanes.git
				synced 2025-11-04 00:50:18 +01:00 
			
		
		
		
	Remove symfony/filesystem from project depends.
This commit is contained in:
		
							parent
							
								
									e84689934d
								
							
						
					
					
						commit
						2a8beeb864
					
				@ -4,7 +4,6 @@ namespace Mage\Task\BuiltIn\Filesystem;
 | 
				
			|||||||
use Mage\Task\AbstractTask;
 | 
					use Mage\Task\AbstractTask;
 | 
				
			||||||
use Mage\Task\Releases\IsReleaseAware;
 | 
					use Mage\Task\Releases\IsReleaseAware;
 | 
				
			||||||
use Mage\Task\SkipException;
 | 
					use Mage\Task\SkipException;
 | 
				
			||||||
use Symfony\Component\Filesystem\Filesystem;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Class LinkSharedFilesTask
 | 
					 * Class LinkSharedFilesTask
 | 
				
			||||||
@ -75,13 +74,12 @@ class LinkSharedFilesTask extends AbstractTask implements IsReleaseAware
 | 
				
			|||||||
        $sharedFolderPath = $remoteDirectory . $this->getParameter('shared', 'shared');
 | 
					        $sharedFolderPath = $remoteDirectory . $this->getParameter('shared', 'shared');
 | 
				
			||||||
        $releasesDirectoryPath = $remoteDirectory . $this->getConfig()->release('directory', 'releases');
 | 
					        $releasesDirectoryPath = $remoteDirectory . $this->getConfig()->release('directory', 'releases');
 | 
				
			||||||
        $currentCopy = $releasesDirectoryPath . '/' . $this->getConfig()->getReleaseId();
 | 
					        $currentCopy = $releasesDirectoryPath . '/' . $this->getConfig()->getReleaseId();
 | 
				
			||||||
        $fileSystem = new Filesystem();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        foreach ($linkedEntities as $ePath) {
 | 
					        foreach ($linkedEntities as $ePath) {
 | 
				
			||||||
            list($entityPath, $strategy) = $this->getPath($ePath);
 | 
					            list($entityPath, $strategy) = $this->getPath($ePath);
 | 
				
			||||||
            if ($strategy === self::RELATIVE_LINKING) {
 | 
					            if ($strategy === self::RELATIVE_LINKING) {
 | 
				
			||||||
                $dirName = dirname($currentCopy . '/' . $entityPath);
 | 
					                $dirName = dirname($currentCopy . '/' . $entityPath);
 | 
				
			||||||
                $target = $fileSystem->makePathRelative($sharedFolderPath, $dirName) . $entityPath;
 | 
					                $target = $this->makePathRelative($sharedFolderPath, $dirName) . $entityPath;
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                $target = $sharedFolderPath . '/' . $entityPath;
 | 
					                $target = $sharedFolderPath . '/' . $entityPath;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@ -94,6 +92,43 @@ class LinkSharedFilesTask extends AbstractTask implements IsReleaseAware
 | 
				
			|||||||
        return true;
 | 
					        return true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Given an existing path, convert it to a path relative to a given starting path
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param string $endPath Absolute path of target
 | 
				
			||||||
 | 
					     * @param string $startPath Absolute path where traversal begins
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return string Path of target relative to starting path
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @author Fabien Potencier <fabien@symfony.com>
 | 
				
			||||||
 | 
					     * @see https://github.com/symfony/Filesystem/blob/v2.6.1/Filesystem.php#L332
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    private function makePathRelative($endPath, $startPath)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        // Normalize separators on Windows
 | 
				
			||||||
 | 
					        if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
 | 
				
			||||||
 | 
					            $endPath = strtr($endPath, '\\', '/');
 | 
				
			||||||
 | 
					            $startPath = strtr($startPath, '\\', '/');
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        // Split the paths into arrays
 | 
				
			||||||
 | 
					        $startPathArr = explode('/', trim($startPath, '/'));
 | 
				
			||||||
 | 
					        $endPathArr = explode('/', trim($endPath, '/'));
 | 
				
			||||||
 | 
					        // Find for which directory the common path stops
 | 
				
			||||||
 | 
					        $index = 0;
 | 
				
			||||||
 | 
					        while (isset($startPathArr[$index]) && isset($endPathArr[$index]) && $startPathArr[$index] === $endPathArr[$index]) {
 | 
				
			||||||
 | 
					            $index++;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        // Determine how deep the start path is relative to the common path (ie, "web/bundles" = 2 levels)
 | 
				
			||||||
 | 
					        $depth = count($startPathArr) - $index;
 | 
				
			||||||
 | 
					        // Repeated "../" for each level need to reach the common path
 | 
				
			||||||
 | 
					        $traverser = str_repeat('../', $depth);
 | 
				
			||||||
 | 
					        $endPathRemainder = implode('/', array_slice($endPathArr, $index));
 | 
				
			||||||
 | 
					        // Construct $endPath from traversing to the common path, then to the remaining $endPath
 | 
				
			||||||
 | 
					        $relativePath = $traverser . (strlen($endPathRemainder) > 0 ? $endPathRemainder . '/' : '');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return (strlen($relativePath) === 0) ? './' : $relativePath;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * @param array|string $linkedEntity
 | 
					     * @param array|string $linkedEntity
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
 | 
				
			|||||||
@ -6,8 +6,7 @@
 | 
				
			|||||||
    "type": "library",
 | 
					    "type": "library",
 | 
				
			||||||
    "keywords": ["deployment"],
 | 
					    "keywords": ["deployment"],
 | 
				
			||||||
    "require": {
 | 
					    "require": {
 | 
				
			||||||
        "php": ">=5.3",
 | 
					        "php": ">=5.3"
 | 
				
			||||||
        "symfony/filesystem": ">=2.1.0,<=2.6.0"
 | 
					 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "require-dev": {
 | 
					    "require-dev": {
 | 
				
			||||||
        "phpunit/phpunit": "4.3.5"
 | 
					        "phpunit/phpunit": "4.3.5"
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										52
									
								
								composer.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										52
									
								
								composer.lock
									
									
									
										generated
									
									
									
								
							@ -4,56 +4,8 @@
 | 
				
			|||||||
        "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
 | 
					        "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
 | 
				
			||||||
        "This file is @generated automatically"
 | 
					        "This file is @generated automatically"
 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
    "hash": "61974b12f91cf9124bfd75a369d20ff8",
 | 
					    "hash": "a19528b890d301384e45c1ed7d221e26",
 | 
				
			||||||
    "packages": [
 | 
					    "packages": [],
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            "name": "symfony/filesystem",
 | 
					 | 
				
			||||||
            "version": "v2.6.0",
 | 
					 | 
				
			||||||
            "target-dir": "Symfony/Component/Filesystem",
 | 
					 | 
				
			||||||
            "source": {
 | 
					 | 
				
			||||||
                "type": "git",
 | 
					 | 
				
			||||||
                "url": "https://github.com/symfony/Filesystem.git",
 | 
					 | 
				
			||||||
                "reference": "6f7c7e42f20ee200d8ac5d2ec1d2a524138305e0"
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            "dist": {
 | 
					 | 
				
			||||||
                "type": "zip",
 | 
					 | 
				
			||||||
                "url": "https://api.github.com/repos/symfony/Filesystem/zipball/6f7c7e42f20ee200d8ac5d2ec1d2a524138305e0",
 | 
					 | 
				
			||||||
                "reference": "6f7c7e42f20ee200d8ac5d2ec1d2a524138305e0",
 | 
					 | 
				
			||||||
                "shasum": ""
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            "require": {
 | 
					 | 
				
			||||||
                "php": ">=5.3.3"
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            "type": "library",
 | 
					 | 
				
			||||||
            "extra": {
 | 
					 | 
				
			||||||
                "branch-alias": {
 | 
					 | 
				
			||||||
                    "dev-master": "2.6-dev"
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            "autoload": {
 | 
					 | 
				
			||||||
                "psr-0": {
 | 
					 | 
				
			||||||
                    "Symfony\\Component\\Filesystem\\": ""
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            "notification-url": "https://packagist.org/downloads/",
 | 
					 | 
				
			||||||
            "license": [
 | 
					 | 
				
			||||||
                "MIT"
 | 
					 | 
				
			||||||
            ],
 | 
					 | 
				
			||||||
            "authors": [
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    "name": "Symfony Community",
 | 
					 | 
				
			||||||
                    "homepage": "http://symfony.com/contributors"
 | 
					 | 
				
			||||||
                },
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    "name": "Fabien Potencier",
 | 
					 | 
				
			||||||
                    "email": "fabien@symfony.com"
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            ],
 | 
					 | 
				
			||||||
            "description": "Symfony Filesystem Component",
 | 
					 | 
				
			||||||
            "homepage": "http://symfony.com",
 | 
					 | 
				
			||||||
            "time": "2014-11-16 17:28:09"
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    ],
 | 
					 | 
				
			||||||
    "packages-dev": [
 | 
					    "packages-dev": [
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            "name": "doctrine/instantiator",
 | 
					            "name": "doctrine/instantiator",
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user