{"id":20331162,"url":"https://github.com/comcast/compare-ini-files","last_synced_at":"2025-04-11T21:07:32.795Z","repository":{"id":138469575,"uuid":"68388548","full_name":"Comcast/compare-ini-files","owner":"Comcast","description":"Compare an arbitrary number of .ini files based on logical sections and key/value pairs.","archived":false,"fork":false,"pushed_at":"2021-02-04T22:48:19.000Z","size":16,"stargazers_count":10,"open_issues_count":0,"forks_count":6,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-11T21:07:11.037Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Comcast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-16T14:49:45.000Z","updated_at":"2024-08-27T21:59:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f1f22b8-188d-4367-acca-2ac56c46974c","html_url":"https://github.com/Comcast/compare-ini-files","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fcompare-ini-files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fcompare-ini-files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fcompare-ini-files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fcompare-ini-files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Comcast","download_url":"https://codeload.github.com/Comcast/compare-ini-files/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480434,"owners_count":21110937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T20:19:01.917Z","updated_at":"2025-04-11T21:07:32.788Z","avatar_url":"https://github.com/Comcast.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compare Ini Files\n\nThe problem: You have multiple copies of an \"ini\" file (https://en.wikipedia.org/wiki/INI_file) \nin use by an app (possibly an app deployed in multiple datacenters...), and you want to compare them/diff them.  Or worse yet: the stanzas and key-value pairs are in different orders in each file, and sorting through them would be a manual process that takes hours and is prone to error.\n\nSolution: This script.  The syntax is simple: \n```\ncompare-ini-files filename1 filename2 [filename3 [filename4 [... ] ] ]\n```\n\nAfter loading the contents of the specified files into memory, this script\nthen checks to make sure all stanzas exist in each file, then does a key-by-key\ncomparison on each stanza, and reports any differences between the files.\n\n\n## Installation\n\n```\nbrew tap comcast/opensource https://github.com/Comcast/homebrew-opensource.git\nbrew install compare-ini-files\n```\n\n\n## Testing out the script\n\nClone this repo, and run `./compare-ini-files test/*` on the command line.\nThe output should resemble this:\n\n```\n#\n# Starting config file audit of the following files:\n#\n#\ttest/file1.conf\n#\ttest/file2.conf\n#\ttest/file3.conf\n#\n#\n# Loading files...\n#\n#\n# Comparing contents...\n#\nFile: 'test/file3.conf' is missing the following stanzas:\n\t[this stanza is found in file 1 and 2]\n\nStanza: [common in all files]\n\n\tKey: 'specific to file3' found with multiple values:\n\n\t\tValue 'somevalue' found in files:\n\n\t\t\ttest/file3.conf\n\n\t\tThese files did NOT contain the key:\n\n\t\t\ttest/file1.conf\n\t\t\ttest/file2.conf\n\n\n```\n\n\n## Requirements\n\n- A relatively recent version of PHP should be installed.\n- Read access to the files in question\n\n\n## Development\n\nDevelopment can be done in Docker:\n\n`docker build -t compare-ini-files . \u0026\u0026 docker run -it -v $(pwd):/mnt compare-ini-files test/*`\n\nThat command builds an image locally and runs the `compare-ini-files` script inside of a \nDocker container.\n\n\n## Author\n\u003ca name=\"author\"\u003e\u003c/a\u003e\n\nDouglas Muth \u003cdouglas_muth@cable.comcast.com\u003e\n\nBugs can be filed here or emailed directly to me.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomcast%2Fcompare-ini-files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomcast%2Fcompare-ini-files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomcast%2Fcompare-ini-files/lists"}