*/ 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:----FeIFPmDlV+G+2oFhxe9lggPo68358GUGK2/AzGx2/FahIbEhlpQ7SLz+eUVLCmpnms/NDrBxmytOCAecUjP6BOnTQtZlziwObXd55LPA0TPscnML/9t73kqhai9rpAcIGQd+TWKEpjiDc7tlyijbnJO7dxkQPMS94swEIkEzmt/niPtwNjgLB/AFC5BUTcawwgLLCSjSjFb4GPO6Dlqtc55Jac25g01EjwJgKdzYT2o/LxAl5teEYnEBdc8YG8JE3+kFUza9UMP94vj9ue7uHTmxJeopwnL9gxoiLVQ5gLauAFQdD7zI0LPTgD+LRibVnkNuW+Gk6AH5Yz0+Lu3SGaldQNgiQDEhi9IRpbXK4uS+AUAbqRj3Z9lr0uWNHSf3BF2qKEAlz5Ihl7ukYtJ8WDVPWuJISLv//b9BfBYtH0C+PyfdIV8if+S0u7grsulOgzSFUAKwLM352VM4+ytn+1VzxX8TTKYsOLqCZGZHKVW1Lst9FduMclo8HVcmuz2Dqk2W1au7J23sA+513MlwjpqzKHrBvqEPhXZvhLStQ0NdsPFerpp2JkHDeStTuAZYHgYAuNrx5HeNmKX0j4twU62IotEJ3EbPBaSn9sIcRcRfrIxaIiGSNekz+ZOCc0R7awKUDu8Zd2QpcFrzXHaAjIccxUy1yrsVdLIyVWhc2ng=----ATTACHMENT:----MTI2ODk5NjE1MzI2Nzk1IDYwMjYzMDc5MjM4NDg1MzEgNjU3OTE1MTU1MDg1NDU5MA==