From df0853f5387c7fcea9fed0c05a02a2d1791df58f Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Tue, 16 Jun 2026 22:32:27 +0200 Subject: whitespace --- AGENTS.md | 0 index.php | 27 +++++++++++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..e69de29 diff --git a/index.php b/index.php index bb2418f..fb64f51 100644 --- a/index.php +++ b/index.php @@ -45,11 +45,11 @@ $cache_parse_log = []; */ function parse_log(string $path): array { global $cache_parse_log; - + if (isset($cache_parse_log[$path])) { return $cache_parse_log[$path]; } - + $proxy = md5(strval(microtime(true))); $process = proc_open( "git -C \"{$path}\" log " . "--pretty=format:'{%n {$proxy}commit{$proxy}: {$proxy}%H{$proxy},%n {$proxy}author{$proxy}: {$proxy}%aN <%aE>{$proxy},%n {$proxy}date{$proxy}: {$proxy}%ad{$proxy},%n {$proxy}message{$proxy}: {$proxy}%s{$proxy}%n},'", @@ -254,7 +254,7 @@ function template_root(string $content, array $meta = []): string $meta = array_replace_recursive([ "title" => "phpgit - single file git web frontend", ], $meta); - + ob_start(); ?> @@ -291,7 +291,7 @@ function template_root(string $content, array $meta = []): string function template_project(string $project_path, string $content): string { $project_path = trim($project_path, "/"); - + ob_start(); ?> @@ -302,7 +302,7 @@ function template_project(string $project_path, string $content): string
setTimestamp(0); } - + $b_log = parse_log($b); - + if (file_exists(".git/info/web/last-modified")) { $b_date = new DateTime(file_get_contents(".git/info/web/last-modified")); } else if (count($b_log) > 0) { @@ -366,7 +366,7 @@ if ($url["path"] == "/") { } else { $b_date = date_create()->setTimestamp(0); } - + return $b_date <=> $a_date; }); @@ -400,7 +400,7 @@ if ($url["path"] == "/") { if (count($log) > 0) { $date = new DateTime($log[0]["date"]); - echo "" . $date->format("Y-m-d") . ""; + echo "" . $date->format("Y-m-d") . ""; } ?> ">