Browse Source

repo.php: rename newestTimestamp(), info() includes timestamp

master
Stephan Bösch-Plepelits 6 years ago
parent
commit
e7e29197d5
  1. 2
      repo.php
  2. 4
      src/RepositoryDir.php
  3. 4
      src/RepositoryGit.php

2
repo.php

@ -33,7 +33,7 @@ if (!array_key_exists($repoId, $allRepositories)) {
$repo = getRepo($repoId, $allRepositories[$repoId]);
$cacheDir = null;
$ts = $repo->newestTimestamp($path);
$ts = $repo->timestamp($path);
if (isset($config['cache'])) {
$cacheDir = "{$config['cache']}/repo";
@mkdir($cacheDir);

4
src/RepositoryDir.php

@ -14,10 +14,12 @@ class RepositoryDir {
}
}
$ret['timestamp'] = Date(DATE_ISO8601, $this->timestamp());
return $ret;
}
function newestTimestamp () {
function timestamp () {
$ts = 0;
$d = opendir($this->path);
while ($f = readdir($d)) {

4
src/RepositoryGit.php

@ -14,10 +14,12 @@ class RepositoryGit {
}
}
$ret['timestamp'] = Date(DATE_ISO8601, $this->timestamp());
return $ret;
}
function newestTimestamp () {
function timestamp () {
$ts = (int)shell_exec("cd " . escapeShellArg($this->path) . "; git log -1 --pretty=format:%ct");
return $ts;

Loading…
Cancel
Save