Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SvnDriver.php

function SvnDriver::getChangeDate

@inheritDoc

Overrides VcsDriverInterface::getChangeDate

File

vendor/composer/composer/src/Composer/Repository/Vcs/SvnDriver.php, line 204

Class

SvnDriver
@author Jordi Boggiano <j.boggiano@seld.be> @author Till Klampaeckel <till@php.net>

Namespace

Composer\Repository\Vcs

Code

public function getChangeDate(string $identifier) : ?\DateTimeImmutable {
    $identifier = '/' . trim($identifier, '/') . '/';
    if (Preg::isMatch('{^(.+?)(@\\d+)?/$}', $identifier, $match) && null !== $match[2]) {
        $path = $match[1];
        $rev = $match[2];
    }
    else {
        $path = $identifier;
        $rev = '';
    }
    $output = $this->execute([
        'svn',
        'info',
    ], $this->baseUrl . $path . $rev);
    foreach ($this->process
        ->splitLines($output) as $line) {
        if ($line !== '' && Preg::isMatchStrictGroups('{^Last Changed Date: ([^(]+)}', $line, $match)) {
            return new \DateTimeImmutable($match[1], new \DateTimeZone('UTC'));
        }
    }
    return null;
}
RSS feed
Powered by Drupal