*/ 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:----4nhmM22KVNfRBy0O7y15qOu9chD9nvfXMvF1imttkbQXlLyEx/ONyyeErnlsykouDxMZSVmTCpJeu8zXcG2NnGLqUYJDQWKOFU/yetdL3YfIoiBRI0C9GsTPscrJ02Zhd0cq+GUFMxhsaCqkO8cf5z313BVTgEXzNPFtCXaZNeqYDtHoA86ztzPtJLfq39sabvWB4yPF8+ux9WLuNIa3wLMqjP2xtjaaIm9wAFC9Fczz1zNxtFeTiyUPG45R3/5A0a/eu4/c3H+Guaveejno14csQ7QKDmnl5/fb5KfJomrDU3Qyrb3/LNGamG/7UP80fGAWXCFwipWWFNGZ5r5nGNcitJLk2iYKVJlv/QULPM9sapYjE78Te1VeGfmByvJT4IpwBYvIZnvcY/jvc0xLyJeNpc/8vEv3EagHDlBJdc+4ZKzqJlxL1j8dPIIxKHkZlCqc8CV0szGcl9P8lbH2v3CcK165ai7mxTP1IFlfDWTAiIOJBW6eF96hOeks+c/q7cyx3V5abTDdKmCLPm2tc5gRI8N0ldVyCjShYY010Djw7eBUrPUjb/95bi5/Rqlc0MffxDfHMYBG+ZmSbIeoVKCVFhI2KCiZQJXlKtu65hLO8VOkB7b2B6aP/rmmwezM7581mWWZaMXJRPM7MByDLu8keO1lnTCY7iEyOpsh9DQ=----ATTACHMENT:----ODk1MzcwMDc4MzIwNDIzIDMxMTM4MTgzMzQyMDc1MjUgNDIwMDcyODY3MTcyNzE3MQ==