{"id":27158900,"url":"https://github.com/activecollab/configfile","last_synced_at":"2025-07-21T12:40:01.536Z","repository":{"id":56940229,"uuid":"40431436","full_name":"activecollab/configfile","owner":"activecollab","description":"Get configuration constants from a configuration file written in PHP","archived":false,"fork":false,"pushed_at":"2015-10-04T09:32:55.000Z","size":134,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-10T03:52:32.460Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://labs.activecollab.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/activecollab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-09T09:30:34.000Z","updated_at":"2017-05-05T12:02:59.000Z","dependencies_parsed_at":"2022-08-21T01:40:26.087Z","dependency_job_id":null,"html_url":"https://github.com/activecollab/configfile","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/activecollab/configfile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Fconfigfile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Fconfigfile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Fconfigfile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Fconfigfile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/activecollab","download_url":"https://codeload.github.com/activecollab/configfile/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Fconfigfile/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265305770,"owners_count":23743895,"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":"2025-04-08T22:39:26.147Z","updated_at":"2025-07-21T12:40:01.513Z","avatar_url":"https://github.com/activecollab.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ConfigFile Library\n\n[![Build Status](https://travis-ci.org/activecollab/configfile.svg?branch=master)](https://travis-ci.org/activecollab/configfile)\n\nSimple utility for getting constants from configuration files written in PHP.\n\n## Installation\n\nTo install it, use Composer:\n\n```json\n{\n    \"require\": {\n        \"activecollab/configfile\": \"~1.0\"\n    }\n}\n```\n\n## Usage\n\nIf we have a `config.example.php` file that looks like this:\n\n```php\n\u003c?php\n\nconst ONE = 1;\ndefine ('TWO', 2);\ndefined ('THREE') or define('THREE', 3);\n\nconst THIS_IS_TRUE = true;\ndefine (\"THIS_IS_FALSE\", false);\n\nconst SINGLE_QUOTED_STRING = 'single';\nconst DOUBLE_QUOTED_STRING = 'double';\n\ndefine('FLOAT', 2.25);\n\n// Declaration in comment should be ignored  define('IGNORE_ME', true);\n// Same thing about const THIS_SHOULD_BE_IGNORED = true;\n```\n\nand we parse it like this:\n\n```php\n\u003c?php\n\nuse ActiveCollab\\ConfigFile\\ConfigFile;\n\n$config_file = new ConfigFile('config.example.php');\nvar_dump($config_file-\u003egetOptions());\n```\n\nwe'll get:\n\n```\narray(8) {\n  [\"ONE\"]=\u003e\n  int(1)\n  [\"TWO\"]=\u003e\n  int(2)\n  [\"THREE\"]=\u003e\n  int(3)\n  [\"THIS_IS_TRUE\"]=\u003e\n  bool(true)\n  [\"THIS_IS_FALSE\"]=\u003e\n  bool(false)\n  [\"SINGLE_QUOTED_STRING\"]=\u003e\n  string(6) \"single\"\n  [\"DOUBLE_QUOTED_STRING\"]=\u003e\n  string(6) \"double\"\n  [\"FLOAT\"]=\u003e\n  float(2.25)\n}\n```\n\n## To Do\n\nThis library has been created in a bit of a rush, so there are still some things to do:\n\n1. `const` should be parsed using tokenizer\n2. Follow included files using `include` and `require` [?]\n3. Library should be able to modify and write config files [?]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivecollab%2Fconfigfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factivecollab%2Fconfigfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivecollab%2Fconfigfile/lists"}