<?php header('Content-Type: application/json');$data=json_decode(file_get_contents('php://input'),true);if(!isset($data['setting'])||!isset($data['value'])){echo json_encode(['status'=>'error','message'=>'Paramètres manquants']);exit;}$settingsFile=__DIR__.'/settings.json';$settings=[];if(file_exists($settingsFile)){$settings=json_decode(file_get_contents($settingsFile),true);}$settings[$data['setting']]=$data['value'];if(file_put_contents($settingsFile,json_encode($settings,JSON_PRETTY_PRINT))){echo json_encode(['status'=>'success']);}else{echo json_encode(['status'=>'error','message'=>'Erreur d\'écriture']);}?>