MyBuilder\Conductor\Conductor::symlinkPackages PHP Метод

symlinkPackages() публичный Метод

public symlinkPackages ( $rootPath )
    public function symlinkPackages($rootPath)
    {
        $finder = new Finder();
        $finder->files()->name('replace_with_symlink.path');
        foreach ($finder->in($rootPath) as $file) {
            $this->symlinkPackageToVendor(file_get_contents($file), dirname($file));
        }
    }

Usage Example

Пример #1
0
 public function test_it_should_symlink_packages()
 {
     $tempDir = $this->createTempDir();
     $this->fs->mirror(__DIR__ . '/fixtures/symlink', $tempDir);
     $this->fs->dumpFile($tempDir . '/package-b/package-a/replace_with_symlink.path', $tempDir . '/package-a/');
     $this->conductor->symlinkPackages($tempDir);
     $link = $tempDir . '/package-b/package-a';
     $this->assertTrue(is_link($link), $link . ' should be a symlink');
     $this->assertEquals('../package-a/', readlink($link), 'It should have a relative symlink');
 }