<?php
$files=['p/logic/NutritionTime.php'=>['40da145b0fff9daa733872e6ffb3eeb9958de55ca66f6d87336efce8d2461c04','cd7efdf847ed2c4ee9acdc4504875fa51cc63e38dca167855660bb8a99bb47b3'],'p/logic/Nutrition.php'=>['8a53cfd449a77b60461cd316e922a71aac6e28e1407ee25c4038abcffeab7837','42e491f372cd78ece0921fb1157364e9bad8dc321f75ba406550c32655f416b4']];$lock=json_decode(file_get_contents(__DIR__.'/private-source-lock.json'),true);if(is_file(__DIR__.'/private-source-lock-original.json'))throw new RuntimeException('Pin no replay');foreach($lock as $file=>$sha)if(hash_file('sha256',__DIR__.'/source/application/'.$file)!==$sha)throw new RuntimeException('Source drift before pin');foreach($files as $file=>$sha){if($lock[$file]!==$sha[0]||hash_file('sha256',__DIR__.'/candidate/'.basename($file))!==$sha[1])throw new RuntimeException('Approved exact two-file pin');}copy(__DIR__.'/private-source-lock.json',__DIR__.'/private-source-lock-original.json');chmod(__DIR__.'/private-source-lock-original.json',0600);foreach($files as $file=>$sha){copy(__DIR__.'/candidate/'.basename($file),__DIR__.'/source/application/'.$file);$lock[$file]=$sha[1];}file_put_contents(__DIR__.'/private-source-lock.json',json_encode($lock,JSON_PRETTY_PRINT));chmod(__DIR__.'/private-source-lock.json',0600);echo json_encode(['passed'=>true,'files'=>$files,'HTTP'=>0,'DML'=>0,'DDL'=>0]),"\n";
