agent foundation

This commit is contained in:
2026-03-06 00:44:52 +01:00
parent 9819cba733
commit 9a08f96c11
199 changed files with 8522 additions and 1880 deletions

View File

@@ -61,11 +61,14 @@ class SettingCacheService
return false;
}
// Write to a temp file first, then rename — rename is atomic on most filesystems,
// so readers never see a half-written file. LOCK_EX prevents concurrent write corruption.
$tmp = tempnam($dir, 'settings_');
if ($tmp === false) {
return false;
}
// PHP include returns an array — loaded by OPcache on subsequent requests, much faster than DB.
$payload = "<?php\nreturn " . $this->exportValue($settings) . ";\n";
$written = @file_put_contents($tmp, $payload, LOCK_EX);
if ($written === false) {