public function changeManifest($moduleName, $setting, $newValue) { requirePermission("editModuleConfigs"); $filePath = "application/modules/" . $moduleName . "/manifest.json"; $manifest = json_decode(file_get_contents($filePath), true); // Replace the setting with the newValue $manifest[$setting] = $newValue; $prettyJSON = new PrettyJSON($manifest); // Rewrite the file with the new data $fileHandle = fopen($filePath, "w"); fwrite($fileHandle, $prettyJSON->get()); fclose($fileHandle); }