[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.147.53.214: ~ $
#!/usr/bin/env php
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

require __DIR__.'/src/Symfony/Component/Filesystem/Exception/ExceptionInterface.php';
require __DIR__.'/src/Symfony/Component/Filesystem/Exception/IOExceptionInterface.php';
require __DIR__.'/src/Symfony/Component/Filesystem/Exception/IOException.php';
require __DIR__.'/src/Symfony/Component/Filesystem/Filesystem.php';

use Symfony\Component\Filesystem\Filesystem;

/**
 * Links dependencies of a project to a local clone of the main symfony/symfony GitHub repository.
 *
 * @author Kévin Dunglas <dunglas@gmail.com>
 */

$copy = false !== $k = array_search('--copy', $argv, true);
$copy && array_splice($argv, $k, 1);
$rollback = false !== $k = array_search('--rollback', $argv, true);
$rollback && array_splice($argv, $k, 1);
$pathToProject = $argv[1] ?? getcwd();

if (!is_dir("$pathToProject/vendor/symfony")) {
    echo 'Links dependencies of a project to a local clone of the main symfony/symfony GitHub repository.'.PHP_EOL.PHP_EOL;
    echo "Usage: $argv[0] /path/to/the/project".PHP_EOL;
    echo '       Use `--copy` to copy dependencies instead of symlink'.PHP_EOL.PHP_EOL;
    echo '       Use `--rollback` to rollback'.PHP_EOL.PHP_EOL;
    echo "The directory \"$pathToProject\" does not exist or the dependencies are not installed, did you forget to run \"composer install\" in your project?".PHP_EOL;
    exit(1);
}

$sfPackages = array('symfony/symfony' => __DIR__);

$filesystem = new Filesystem();
$braces = array('Bundle', 'Bridge', 'Component', 'Component/Security');
$directories = call_user_func_array('array_merge', array_values(array_map(function ($part) {
    return glob(__DIR__.'/src/Symfony/'.$part.'/*', GLOB_ONLYDIR | GLOB_NOSORT);
}, $braces)));

foreach ($directories as $dir) {
    if ($filesystem->exists($composer = "$dir/composer.json")) {
        $sfPackages[json_decode(file_get_contents($composer))->name] = $dir;
    }
}

foreach (glob("$pathToProject/vendor/symfony/*", GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
    $package = 'symfony/'.basename($dir);

    if (!isset($sfPackages[$package])) {
        continue;
    }

    if ($rollback) {
        $filesystem->remove($dir);
        echo "\"$package\" has been rollback from \"$sfPackages[$package]\".".PHP_EOL;
        continue;
    }

    if (!$copy && is_link($dir)) {
        echo "\"$package\" is already a symlink, skipping.".PHP_EOL;
        continue;
    }

    $sfDir = ('\\' === DIRECTORY_SEPARATOR || $copy) ? $sfPackages[$package] : $filesystem->makePathRelative($sfPackages[$package], dirname(realpath($dir)));

    $filesystem->remove($dir);

    if ($copy) {
        $filesystem->mirror($sfDir, $dir);
        echo "\"$package\" has been copied from \"$sfPackages[$package]\".".PHP_EOL;
    } else {
        $filesystem->symlink($sfDir, $dir);
        echo "\"$package\" has been linked to \"$sfPackages[$package]\".".PHP_EOL;
    }
}

foreach (glob("$pathToProject/var/cache/*", GLOB_NOSORT) as $cacheDir) {
    $filesystem->remove($cacheDir);
}

if ($rollback) {
    echo PHP_EOL."Rollback done, do not forget to run \"composer install\" in your project \"$pathToProject\".".PHP_EOL;
}

Filemanager

Name Type Size Permission Actions
.composer Folder 0755
.github Folder 0755
src Folder 0755
.appveyor.yml File 3.94 KB 0644
.editorconfig File 286 B 0644
.gitignore File 121 B 0644
.php_cs.dist File 1.79 KB 0644
.travis.yml File 12.96 KB 0644
CHANGELOG-3.0.md File 43.92 KB 0644
CHANGELOG-3.1.md File 36.48 KB 0644
CHANGELOG-3.2.md File 49.99 KB 0644
CHANGELOG-3.3.md File 59.02 KB 0644
CHANGELOG-3.4.md File 120.02 KB 0644
CODE_OF_CONDUCT.md File 3.36 KB 0644
CONTRIBUTING.md File 1015 B 0644
CONTRIBUTORS.md File 60.99 KB 0644
LICENSE File 1.04 KB 0644
README.md File 2.88 KB 0644
UPGRADE-3.0.md File 52.05 KB 0644
UPGRADE-3.1.md File 6.15 KB 0644
UPGRADE-3.2.md File 7.75 KB 0644
UPGRADE-3.3.md File 13.73 KB 0644
UPGRADE-3.4.md File 17.62 KB 0644
UPGRADE-4.0.md File 36.87 KB 0644
composer.json File 5.21 KB 0644
link File 3.27 KB 0644
phpunit File 1.26 KB 0644
phpunit.xml.dist File 3.33 KB 0644