diff options
Diffstat (limited to 'index.php')
| -rw-r--r-- | index.php | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -15,6 +15,7 @@ function find_projects(string $path, array $projects = []): array { $directories = glob($path . "/{.[!.],}*", GLOB_ONLYDIR | GLOB_BRACE); if (array_search("$path/.git", $directories) !== false) { + app_log("Found $path"); $projects[] = $path; } else { @@ -24,6 +25,7 @@ function find_projects(string $path, array $projects = []): array { } if (count(array_intersect($scan, ["HEAD", "objects", "refs"])) == 3) { + app_log("Found $path"); $projects[] = $path; } else { @@ -46,10 +48,14 @@ $cache_parse_log = []; function parse_log(string $path): array { global $cache_parse_log; + app_log("Getting log at $path"); + if (isset($cache_parse_log[$path])) { return $cache_parse_log[$path]; } + app_log("Parsing log at $path"); + $proxy = md5(strval(microtime(true))); $process = proc_open( "git -C \"{$path}\" log " . "--pretty=format:'{{$proxy}commit{$proxy}: {$proxy}%H{$proxy}, {$proxy}author{$proxy}: {$proxy}%aN <%aE>{$proxy}, {$proxy}date{$proxy}: {$proxy}%ad{$proxy}, {$proxy}message{$proxy}: {$proxy}%B{$proxy}},'", @@ -81,6 +87,8 @@ function parse_log(string $path): array { * parse git status at $path */ function parse_status(string $path): array { + app_log("Parsing status at $path"); + $process = proc_open( "git -C \"{$path}\" status --porcelain=v2 --branch", [ @@ -232,6 +240,13 @@ function read_object_file(string $path, string $name): string ## + +function app_log(string $message): void +{ + error_log($message); +} + + /** * urlencode whole $url */ |
