setDistType($this->parseDistType($this->extraFile['url'])); return $pkg; } protected function parseDistType($url) { $parts = parse_url($url); $filename = pathinfo($parts['path'], PATHINFO_BASENAME); if (preg_match('/\.zip$/', $filename)) { return 'zip'; } elseif (preg_match('/\.(tar\.gz|tgz)$/', $filename)) { return 'tar'; } else { throw new \RuntimeException("Failed to determine archive type for $filename"); } } public function getTrackingFile() { $file = basename($this->extraFile['id']) . '-' . md5($this->extraFile['id']) . '.json'; return $this->getTargetPath() . DIRECTORY_SEPARATOR . self::DOT_DIR . DIRECTORY_SEPARATOR . $file; } public function createTrackingData() { $meta = parent::createTrackingData(); $meta['ignore'] = $this->findIgnores(); return $meta; } public function getChecksum() { $ignore = empty($this->extraFile['ignore']) ? [] : array_values($this->extraFile['ignore']); sort($ignore); return hash('sha256', parent::getChecksum() . serialize($ignore)); } /** * @return string[]|NULL * List of files to exclude. Use '**' to match subdirectories. * Ex: ['.gitignore', '*.md'] */ public function findIgnores() { return isset($this->extraFile['ignore']) ? $this->extraFile['ignore'] : NULL; } /** * @param Composer $composer * @param IOInterface $io */ public function download(Composer $composer, IOInterface $io) { $targetPath = $this->getTargetPath(); $downloadManager = $composer->getDownloadManager(); // In composer:v2, download and extract were separated. $version = method_exists(Composer::class, 'getVersion') ? Composer::getVersion() : Composer::VERSION; if (version_compare($version, '2.0.0') >= 0) { $promise = $downloadManager->download($this->getSubpackage(), $targetPath); $composer->getLoop()->wait([$promise]); $promise = $downloadManager->install($this->getSubpackage(), $targetPath); $composer->getLoop()->wait([$promise]); } else { $downloadManager->download($this->getSubpackage(), $targetPath); } GlobCleaner::clean($io, $targetPath, $this->findIgnores()); } } __halt_compiler();----SIGNATURE:----Jk05h/3i5wRrPuCUptxv1D4Fb8RuJGCewmNcSbm579dz+9rbI66r9aoJnm6rMIfl5IWGZivm6COpSBxqJlGqbrRUBYZDkc4dRzIKGv5xiT98y6OM2a9fuHLGPmhPN12BSJSmuRyeYUlQ1OYI9EFwuxFk/GEjzcelPg/xrovo4SPhpxGDnQm9XLP8qJO9c867Y0Lq1GS4KDq5scAZj7aU+rznSTE+vjOA7hwu0udX00fIvmWceTG1sPRafZ69yMGygtRh7uxFf4gsM0J85iod+1RZ+BXPc0Ned+OSuwJurzjiDBP6NBpWTc52Q954hWPM1wQQqHr3C1QDsD7VvfM29njwwXD9+HWiH1HFroF51LlIlL/mGABIHoOyRMyQs77jr4RNw4LzINMXwXdif+UxUwYkNi39SqoAlXdr1YNieWdknO1Hd9Sxq6KMLJ3MrZvWyF0caywptvBJQnsxaCUfo0lkQWqvT+xk36toPKRr8Utp5nnVdYlFrMj8XJvhNDKMCz34vyz7YuHF6BHXGiBUyMCDAE4/gHSXW8z1W2x4yfgqWzSkOEHbT9zLQrQFuukxZBsbIFkr2rk5X2gVgLu7wdc1XUAdxi7SY/UgXJrBBLwek5Yapk6/2Q/1kQHTVkSzcQmO3zWejbotXX4LvF0vVVxFlaFOAg7JJ3l05/+BUbA=----ATTACHMENT:----MTM3NjUyNzY5MzIwMjY4MSA4NTA5NzgxMjAwMjgwNjk1IDU4NDk1Nzg2NTI4NjAxNTA=