diff --git a/www/extern/egg/RemoteSource.php b/www/extern/egg/RemoteSource.php index 6e248b9..7a01e61 100644 --- a/www/extern/egg/RemoteSource.php +++ b/www/extern/egg/RemoteSource.php @@ -329,7 +329,7 @@ abstract class StandardGitConnection implements IRemoteSource $json = $this->queryCommits($repo->Name, $branch->Name, $next_sha[0]); } - $this->logger->proclog("HEAD pointer in Branch: [" . $this->name . "|" . $repo->Name . "|" . $branch->Name . "] no longer matches. Re-query all " . count($newcommits) . " commits (old HEAD := {".substr($branch->Head, 0, 8)."}, missing: [" . join(", ", array_map(function($p){return substr($p, 0, 8);}, $next_sha)) . "] )"); + $this->logger->proclog("HEAD pointer in Branch: [" . $this->name . "|" . $repo->Name . "|" . $branch->Name . "] no longer matches. Re-query all " . count($newcommits) . " commits (old HEAD := {".substr($branch->Head ?? 'NULL', 0, 8)."}, missing: [" . join(", ", array_map(function($p){return substr($p ?? 'NULL', 0, 8);}, $next_sha)) . "] )"); $db->deleteAllCommits($branch); diff --git a/www/internals/modules.php b/www/internals/modules.php index df79928..38acd0e 100644 --- a/www/internals/modules.php +++ b/www/internals/modules.php @@ -81,7 +81,7 @@ class Modules public function ExtendedGitGraph(): MikescherGitGraph { - if ($this->extendedgitgraph === null) { require_once 'modules/mikeschergitgraph.php'; $this->extendedgitgraph = new MikescherGitGraph($this->site); } + if ($this->extendedgitgraph === null) { require_once 'modules/mikeschergitgraph.php'; $this->extendedgitgraph = new MikescherGitGraph($this->site->config['extendedgitgraph']); } return $this->extendedgitgraph; } diff --git a/www/internals/modules/mikeschergitgraph.php b/www/internals/modules/mikeschergitgraph.php index 06220c7..cf2c66f 100644 --- a/www/internals/modules/mikeschergitgraph.php +++ b/www/internals/modules/mikeschergitgraph.php @@ -1,29 +1,30 @@ extgitgraph = new ExtendedGitGraph2($site->config['extendedgitgraph']); + $this->extgitgraph = new ExtendedGitGraph2($egh_conf); } - public function getPathRenderedData() + public function getPathRenderedData(): string { return __DIR__ . '/../../dynamic/egg/cache_fullrenderer.html'; } - public function update() + public function update(): bool { return $this->extgitgraph->update(); } - public function updateCache() + public function updateCache(): ?string { return $this->extgitgraph->updateCache(); } @@ -31,14 +32,14 @@ class MikescherGitGraph implements IWebsiteModule /** * @return string|null */ - public function get() + public function get(): ?string { $d = $this->extgitgraph->loadFromCache(); if ($d === null) return ""; return $d; } - public function checkConsistency() + public function checkConsistency(): array { $p = $this->getPathRenderedData(); diff --git a/www/shell/.htaccess b/www/shell/.htaccess new file mode 100644 index 0000000..14249c5 --- /dev/null +++ b/www/shell/.htaccess @@ -0,0 +1 @@ +Deny from all \ No newline at end of file diff --git a/www/shell/extendedgitgraph_refresh.php b/www/shell/extendedgitgraph_refresh.php new file mode 100644 index 0000000..64b037d --- /dev/null +++ b/www/shell/extendedgitgraph_refresh.php @@ -0,0 +1,52 @@ +#!/usr/bin/php + +update(); +if (!$r1) +{ + echo "EGG::update failed.\n"; + exit(99); +} + +echo "\n"; +echo "============================= Start Update-Cache =============================\n"; +echo "\n"; + +$r2 = $egg->updateCache(); +if (!$r2) +{ + echo "EGG::updateCache failed."; + exit(99); +} + +echo "\n"; +echo "==============================================================================\n"; +echo "\n"; + +echo "Done.\n"; +exit(0); \ No newline at end of file