1
0
Fork 0

Fixed automatic date parsing of versions

pull/316/merge
Jordi Boggiano 2012-02-18 17:05:13 +01:00
parent 230e145053
commit e2199b2b03
2 changed files with 2 additions and 2 deletions

View File

@ -101,7 +101,7 @@ class GitDriver extends VcsDriver implements VcsDriverInterface
if (!isset($composer['time'])) {
$this->process->execute(sprintf('cd %s && git log -1 --format=%%at %s', escapeshellarg($this->tmpDir), escapeshellarg($identifier)), $output);
$date = new \DateTime('@'.$output[0]);
$date = new \DateTime('@'.trim($output));
$composer['time'] = $date->format('Y-m-d H:i:s');
}
$this->infoCache[$identifier] = $composer;

View File

@ -107,7 +107,7 @@ class HgDriver extends VcsDriver implements VcsDriverInterface
if (!isset($composer['time'])) {
$this->process->execute(sprintf('cd %s && hg log --template "{date|rfc822date}" -r %s', escapeshellarg($this->tmpDir), escapeshellarg($identifier)), $output);
$date = new \DateTime($output[0]);
$date = new \DateTime(trim($output));
$composer['time'] = $date->format('Y-m-d H:i:s');
}
$this->infoCache[$identifier] = $composer;