Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/treetrek.git

Moves initialization

AuthorDave Jarvis <email>
Date2026-02-20 23:50:40 GMT-0800
Commitef7a6e8328cda24f1b8fe4c6d643c0c1d3ce0989
Parent48707a6
File.php
private bool $binary;
- private static ?finfo $finfo = new finfo( FILEINFO_MIME_TYPE );
+ private static ?finfo $finfo = null;
public function __construct(
string $name,
string $sha,
string $mode,
int $timestamp,
int $size,
string $contents = ''
) {
+ self::$finfo ??= new finfo( FILEINFO_MIME_TYPE );
+
$this->name = $name;
$this->sha = $sha;
});
}
-
private function detectMediaType( string $buffer ): string {
Delta3 lines added, 2 lines removed, 1-line increase