<?php
$expected=['p/logic/Nutrition.php'=>'824b19d4ca6a3d3eced4c228edb88c4bdab081477897472b3a753b01bf12765f','p/logic/NutritionTime.php'=>'40da145b0fff9daa733872e6ffb3eeb9958de55ca66f6d87336efce8d2461c04'];
$lock=json_decode(file_get_contents(__DIR__.'/private-source-lock.json'),true);
foreach($expected as $f=>$sha){if(hash_file('sha256',__DIR__.'/source/application/'.$f)!==$sha)throw new RuntimeException('Actual Root SHA mismatch');$lock[$f]=$sha;}
if(!is_file(__DIR__.'/private-original-source-lock.json'))rename(__DIR__.'/private-source-lock.json',__DIR__.'/private-original-source-lock.json');
file_put_contents(__DIR__.'/private-source-lock.json',json_encode($lock,JSON_PRETTY_PRINT));chmod(__DIR__.'/private-source-lock.json',0600);echo "Root sources locked\n";
