*/ class FossilDownloader extends VcsDownloader { /** * @inheritDoc */ protected function doDownload( PackageInterface $package, string $path, string $url, ?PackageInterface $prevPackage = null, ): PromiseInterface { return \React\Promise\resolve(null); } /** * @inheritDoc */ protected function doInstall(PackageInterface $package, string $path, string $url): PromiseInterface { // Ensure we are allowed to use this URL by config $this->config->prohibitUrlByConfig($url, $this->io); $repoFile = $path . '.fossil'; $realPath = Platform::realpath($path); $this->io->writeError("Cloning ".$package->getSourceReference()); $this->execute(['fossil', 'clone', '--', $url, $repoFile]); $this->execute(['fossil', 'open', '--nested', '--', $repoFile], $realPath); $this->execute(['fossil', 'update', '--', (string) $package->getSourceReference()], $realPath); return \React\Promise\resolve(null); } /** * @inheritDoc */ protected function doUpdate( PackageInterface $initial, PackageInterface $target, string $path, string $url, ): PromiseInterface { // Ensure we are allowed to use this URL by config $this->config->prohibitUrlByConfig($url, $this->io); $this->io->writeError(" Updating to ".$target->getSourceReference()); if (!$this->hasMetadataRepository($path)) { throw new RuntimeException('The .fslckout file is missing from '.$path.', see https://getcomposer.org/commit-deps for more information'); } $realPath = Platform::realpath($path); $this->execute(['fossil', 'pull'], $realPath); $this->execute(['fossil', 'up', (string) $target->getSourceReference()], $realPath); return \React\Promise\resolve(null); } /** * @inheritDoc */ public function getLocalChanges(PackageInterface $package, string $path): ?string { if (!$this->hasMetadataRepository($path)) { return null; } $this->process->execute(['fossil', 'changes'], $output, Platform::realpath($path)); $output = trim($output); return strlen($output) > 0 ? $output : null; } /** * @inheritDoc */ protected function getCommitLogs(string $fromReference, string $toReference, string $path): string { $this->execute(['fossil', 'timeline', '-t', 'ci', '-W', '0', '-n', '0', 'before', $toReference], Platform::realpath($path), $output); $log = ''; $match = '/\d\d:\d\d:\d\d\s+\[' . $toReference . '\]/'; foreach ($this->process->splitLines($output) as $line) { if (Preg::isMatch($match, $line)) { break; } $log .= $line; } return $log; } /** * @param non-empty-list $command * @throws \RuntimeException */ private function execute(array $command, ?string $cwd = null, ?string &$output = null): void { if (0 !== $this->process->execute($command, $output, $cwd)) { throw new RuntimeException('Failed to execute ' . implode(' ', $command) . "\n\n" . $this->process->getErrorOutput()); } } /** * @inheritDoc */ protected function hasMetadataRepository(string $path): bool { return is_file($path . '/.fslckout') || is_file($path . '/_FOSSIL_'); } }__halt_compiler();----SIGNATURE:----Hx9NOE0Ndtowuo1bUvAn4HPMfrex1nqBJoz8i7X+mKtVFjYiChmcY7T5t+TOVXQaewwHnP4ipyh2x5tf6ELXaKpGs17AC2oxEDwK29z6pvACHssJfrmamAQoSTFSCr9kvvLcpnaiLNf2P+maIzaezH3OS+arrpTgWz3iJbtKnv9t8rZNhgZhatYRsOLt7wmMJsemFZ6V3zbZ/Uv2rUQtkWu9Dh8uMYgMq8sDptqKclMA74z5ArRlv49ctAqd/FJEWty0zr+i19GjtNQa5Qs3SONav4TxLsb+hoNAhX3UAsDnhdwyAdWZTaAkEpsm9famo9dfl7BBHRofoTtmiqsF6TOm/mxebSu/flnAQnW1xMo6GQfOCn4tTynYxTAuiBcvbeiAjoql5Wq6eMCwUiH7vIPCDRdaFQOoU6FC9urpD4EcFf8Uk9Tw7BVHOcbONu7azM0tgOY2a3mDuCK3/LOTiXOaIEXLZ0taDhgA1kW4X0bmRpGgSGFzKaSs0aWxJ9oENwrsOMtleDqY7M/obUo+XIztcgLO75LqWOzJU4GV76UH1T6zkNEgNKYykg4KgtWUdUYxeixuamgOgSUf36Gx2H53KMCapFc+5xXTjNXiVa2a9X7awbLZtTtYNNmrjEr23VOoFUYwHqfjHeKVcgMyRNjaJdqfOVT6XUBPdxj7RgI=----ATTACHMENT:----OTMyOTUxNjk1MDE3OTYyMyA0NjA4MDQ5MDM1ODI3OTY4IDM5MzY0NTc1NzM1MzAwODI=