*/ 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 { $this->config->prohibitUrlByConfig($url, $this->io); $url = ProcessExecutor::escape($url); $ref = ProcessExecutor::escape($package->getSourceReference()); $repoFile = $path . '.fossil'; $this->io->writeError("Cloning ".$package->getSourceReference()); $command = sprintf('fossil clone -- %s %s', $url, ProcessExecutor::escape($repoFile)); if (0 !== $this->process->execute($command, $ignoredOutput)) { throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput()); } $command = sprintf('fossil open --nested -- %s', ProcessExecutor::escape($repoFile)); if (0 !== $this->process->execute($command, $ignoredOutput, realpath($path))) { throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput()); } $command = sprintf('fossil update -- %s', $ref); if (0 !== $this->process->execute($command, $ignoredOutput, realpath($path))) { throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput()); } return \React\Promise\resolve(null); } /** * @inheritDoc */ protected function doUpdate( PackageInterface $initial, PackageInterface $target, string $path, string $url, ): PromiseInterface { $this->config->prohibitUrlByConfig($url, $this->io); $ref = ProcessExecutor::escape($target->getSourceReference()); $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'); } $command = sprintf('fossil pull && fossil up %s', $ref); if (0 !== $this->process->execute($command, $ignoredOutput, realpath($path))) { throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput()); } 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, realpath($path)); $output = trim($output); return strlen($output) > 0 ? $output : null; } /** * @inheritDoc */ protected function getCommitLogs(string $fromReference, string $toReference, string $path): string { $command = sprintf('fossil timeline -t ci -W 0 -n 0 before %s', ProcessExecutor::escape($toReference)); if (0 !== $this->process->execute($command, $output, realpath($path))) { throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput()); } $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; } /** * @inheritDoc */ protected function hasMetadataRepository(string $path): bool { return is_file($path . '/.fslckout') || is_file($path . '/_FOSSIL_'); } } __halt_compiler();----SIGNATURE:----Dl5/EfYnQsCtdvOcl4xkVI8an0pOJ2QX3n2/dm3qL5hRh5qEXSrILz1Rwl4nSpgyTtKCGZuO9P2N6lUZ4jRA3S2+sfuuYGwOqX1BjJr9c2lO50GzE6r3zSbmD7Wl2/DTxoOWRaE8MqfUX7+A0HKZVgC5X1G2D8vC7vb5fmdaCAQPi1jkR0FRIOYKWH2t5NrsI7nt46VcjpjXKBousKN3JNXBNU7q4iW3hRPJrefERBAywwt1tvWNUxkpQYs5eZmz4QFnedIELxGNN12BnhAu/UoO+qXUi2X3dvfVkrqmpGFG22ufUpQljB8nT3wzlIPXRRhlRJX4ibK+eyvToKx44Vji+zOBHE2PCa8Zn6cC5SuOViGwaWfZ6xdUoE1JzMgYwNXkyB105WavgKPvsX9HnPCqnZn8ZY28rCBfOVSE760JtLqMRjnX5FUxM/JkKzaFUbQwazbd7i8Z77sa+FZtTdWefp8Lrmap7uoqT5GCVLz52y6Ofmvp8Yy8vg0Id6Jn48uXFNkY/hMR/XmoMlDZHAGAv0L1p0LxWeV9EvAutAL2I8F1eIQnhkEceEmC4V8biJxW2MqndvQ3ifxh6z5sXy0xIESGFMwqQiGvKecOurmFW4y1MwjrVcro3kgRmqL4Z0msGzcUCbcMZfCeh7dKQJkVPQBirWjAWD4asI0N/Ys=----ATTACHMENT:----MzYyMTE1MzA2NjY2MjIxNyA3NTc2MzM4NzAxNTM0MDkxIDIwOTQ3NjgzNzUxOTUzNTU=