*/ class ProjectInstaller implements InstallerInterface { /** @var string */ private $installPath; /** @var DownloadManager */ private $downloadManager; /** @var Filesystem */ private $filesystem; public function __construct(string $installPath, DownloadManager $dm, Filesystem $fs) { $this->installPath = rtrim(strtr($installPath, '\\', '/'), '/').'/'; $this->downloadManager = $dm; $this->filesystem = $fs; } /** * Decides if the installer supports the given type */ public function supports(string $packageType): bool { return true; } /** * @inheritDoc */ public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package): bool { return false; } /** * @inheritDoc */ public function download(PackageInterface $package, ?PackageInterface $prevPackage = null): ?PromiseInterface { $installPath = $this->installPath; if (file_exists($installPath) && !$this->filesystem->isDirEmpty($installPath)) { throw new \InvalidArgumentException("Project directory $installPath is not empty."); } if (!is_dir($installPath)) { mkdir($installPath, 0777, true); } return $this->downloadManager->download($package, $installPath, $prevPackage); } /** * @inheritDoc */ public function prepare($type, PackageInterface $package, ?PackageInterface $prevPackage = null): ?PromiseInterface { return $this->downloadManager->prepare($type, $package, $this->installPath, $prevPackage); } /** * @inheritDoc */ public function cleanup($type, PackageInterface $package, ?PackageInterface $prevPackage = null): ?PromiseInterface { return $this->downloadManager->cleanup($type, $package, $this->installPath, $prevPackage); } /** * @inheritDoc */ public function install(InstalledRepositoryInterface $repo, PackageInterface $package): ?PromiseInterface { return $this->downloadManager->install($package, $this->installPath); } /** * @inheritDoc */ public function update( InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target, ): ?PromiseInterface { throw new \InvalidArgumentException("not supported"); } /** * @inheritDoc */ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package): ?PromiseInterface { throw new \InvalidArgumentException("not supported"); } /** * Returns the installation path of a package * * @return string path */ public function getInstallPath(PackageInterface $package): string { return $this->installPath; } } __halt_compiler();----SIGNATURE:----Hc0u0MKYZMupBmd9G0CqvGhL+JvLd0Rz+RUr6U0nrGkBHqiFfhVqWAefGqTgDyFxiZG3Mq39MH3J9HpbNNukTU5u9yGGD3kkIyANc6ogx0pDm5PlfFiSq45Ucu3cv4/tn0Y3F1EkZknfbE3buaKeGUt0D0jgLO9vQrcEbPPUHr0p96mhyh5yf9ppg4I9RUwGdJhaiuQ+Wjfw8R5SXPUjg/tc8oU25aB43c55u4hjtWGZPpdeC3yvVf8T4DnyTvLkYfIo9vjFnbxB4mZnWs8B2fXTbYyTgA4tMN1asDUtc0d9Gqj81InNdeJfuuuqz0RNl11feevR25mQsh9czl5mjmByvGw4okfdUYxMwjoNLBEvHBtVbJjeYsttOXkHE4frGkkzsoyld7S+pZmULfHwjHMUQnm8OnA7rqz78Ja6ul1ru+ffsDP86nioZ5AcF9Yb3dljreUP2lsrWWrObLSkedX34C/WsxJ488g/4RtoK02gy6lsa9AoJ8OIJFDb46nH01S2uPIP36Uhfj0meBzLKE/mSCzLGDD3Kw8Hkh4sezR14i0HuIKebxqMxqomj4576D/uzkEyNPzZw+RUczjPL5NTLjfDZHxEe3Ti7QTD39CHYvGuo96xfvRhf2mzBH3js3LhP7bfdFt0cWlIpuqHZ5aK7+SeOybABKi4x+m4Nh8=----ATTACHMENT:----MjI0NTU0NzI2OTQxNTA1NyA1NDA0NDI2NjI3MjYyMjc2IDY5NzkxMjQ4MDc1MzE0Mjc=