diff --git a/repo.php b/repo.php index 7231a38e..18e1d46a 100644 --- a/repo.php +++ b/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); diff --git a/src/RepositoryDir.php b/src/RepositoryDir.php index bbf74918..e0d19208 100644 --- a/src/RepositoryDir.php +++ b/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)) { diff --git a/src/RepositoryGit.php b/src/RepositoryGit.php index fa22857b..07130acf 100644 --- a/src/RepositoryGit.php +++ b/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;