'tempo.host-overlay.review.v1', 'activation_authorized' => false, 'installed' => false, 'host_version_preserved' => '0.1.1', 'files' => []]; foreach ($files as $path => $file) { $target = $directory.'/'.$path; if (! is_dir(dirname($target))) { mkdir(dirname($target), 0700, true); } if (is_file($target) && hash_file('sha256', $target) !== $file['after_sha256']) { throw new RuntimeException('Artefacto imutável divergente.'); } file_put_contents($target, $file['contents']); unset($file['contents']); $manifest['files'][$path] = $file; } foreach ($support as $name => $content) { if (is_file($directory.'/'.$name) && hash_file('sha256', $directory.'/'.$name) !== hash('sha256', $content)) { throw new RuntimeException('Artefacto de acesso imutável divergente.'); } file_put_contents($directory.'/'.$name, $content); $manifest['support_files'][$name] = hash('sha256', $content); } file_put_contents($directory.'/manifest.json', json_encode($manifest, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR)); echo json_encode(['directory' => $directory, 'installed' => false], JSON_THROW_ON_ERROR)."\n";