*/ 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:----sdsur6MaHDGYY1uw+kg00IlEaaRSukSYhFDTNhWLGQupm4ugFo5HsJP+tUaQOEMCfzUUJXpckZEUVxgkJQif/Qsjr+tUEMiuj4mKkXsDW7ZVp+6K/9RwtNdvo5Ob2uexCJm3IwMdnmdN/QYT8CfH1l0F4+W2t7St3uzFMt5t/TKZ8/8M4M5Sou3GoGVD9emKeRf79euDo/I61QpYH8IxDhy8bxTqtpO/9pvlMfwAwki9iBLYH6WUNQ12GpEpFc8DWqlDiQyVf0C9WZk1IR56gztXQys/NiO716LN9NpsCpK7cEf9fvyINX7SzgB6zFjEiYMQw0knumcd5iOcNZ60+sogMkz4DEyxU2Ly+U0v/o6V7C3IlbhJ1/AWBVfcU+zDSC85/UjetSeipFyUJNG41IVovMyECaSHIgOJBs8teJCoiUF0ATSnvQNqNHFcJD71GFMPJ4zh+l2qyaCFxJiLUC37XaXVsB7buYvdYWh62LjvhQlA113fptuK1hFUemyiORbvS932jXKM2fcOdFQfrFSPlJJd+RbQHr2WuAS6sAdspQGD9thdkeHlPGONUbkux/4RvgbCZNieF+cqbPmwxVP+SoM/3NzJ5f+QOnBMHdwC0cLloRKOYgf9txduuo30YQ0qUG03ir5I3oHISgLUmLfL39sGCQZ2MNRTpDDERuM=----ATTACHMENT:----MTA0ODg3NDYxNzQ5ODA5MSA1OTM3NTUwMTgwNDg4MDY4IDQwMzQ5NDQwMDYzNzAzNjQ=