{"id":25257514,"url":"https://github.com/czproject/configuration","last_synced_at":"2025-07-04T19:35:01.075Z","repository":{"id":56960990,"uuid":"66110333","full_name":"czproject/configuration","owner":"czproject","description":"Helper for processing of configurations.","archived":false,"fork":false,"pushed_at":"2018-12-27T16:37:23.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-08T08:41:36.755Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/czproject.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-19T20:29:58.000Z","updated_at":"2018-12-27T16:37:24.000Z","dependencies_parsed_at":"2022-08-21T09:20:52.927Z","dependency_job_id":null,"html_url":"https://github.com/czproject/configuration","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/czproject/configuration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czproject%2Fconfiguration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czproject%2Fconfiguration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czproject%2Fconfiguration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czproject%2Fconfiguration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/czproject","download_url":"https://codeload.github.com/czproject/configuration/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czproject%2Fconfiguration/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263607168,"owners_count":23487747,"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-02-12T06:40:16.596Z","updated_at":"2025-07-04T19:35:01.054Z","avatar_url":"https://github.com/czproject.png","language":"PHP","funding_links":["https://www.patreon.com/bePatron?u=9680759","https://www.paypal.me/janpecha/1eur"],"categories":[],"sub_categories":[],"readme":"\n# CzProject\\Configuration\n\n[![Build Status](https://travis-ci.org/czproject/configuration.svg?branch=master)](https://travis-ci.org/czproject/configuration)\n\nHelper for processing of configurations.\n\n\u003ca href=\"https://www.patreon.com/bePatron?u=9680759\"\u003e\u003cimg src=\"https://c5.patreon.com/external/logo/become_a_patron_button.png\" alt=\"Become a Patron!\" height=\"35\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.paypal.me/janpecha/1eur\"\u003e\u003cimg src=\"https://buymecoffee.intm.org/img/button-paypal-white.png\" alt=\"Buy me a coffee\" height=\"35\"\u003e\u003c/a\u003e\n\n\n## Installation\n\n[Download a latest package](https://github.com/czproject/configuration/releases) or use [Composer](http://getcomposer.org/):\n\n```\ncomposer require czproject/configuration\n```\n\n`CzProject\\Configuration` requires PHP 5.4.0 or later.\n\n\n## Usage\n\n``` php\nuse CzProject\\Configuration\\Configurator;\n\n$configurator = new Configurator;\n$configurator-\u003eaddConfig(array(\n\t'database' =\u003e array(\n\t\t'host' =\u003e 'localhost',\n\t),\n));\n\n$configurator-\u003eaddConfig(array(\n\t'database' =\u003e array(\n\t\t'user' =\u003e 'user123',\n\t\t'password' =\u003e 'password123',\n\t),\n));\n\n$config = $configurator-\u003egetConfig();\n\n/* Returns:\n[\n\tdatabase =\u003e [\n\t\thost =\u003e 'localhost',\n\t\tuser =\u003e 'user123',\n\t\tpassword =\u003e 'password123',\n\t]\n]\n*/\n```\n\n\n### Config files\n\n``` php\nuse CzProject\\Configuration\\Configurator;\nuse CzProject\\Configuration\\ConfigLoader;\nuse CzProject\\Configuration\\Adapters;\n\n$loader = new ConfigLoader;\n$loader-\u003eaddAdapter('json', new Adapters\\JsonAdapter);\n$loader-\u003eaddAdapter('php', new Adapters\\PhpAdapter);\n$loader-\u003eaddAdapter('neon', new Adapters\\NeonAdapter);\n\n$configurator = new Configurator($loader);\n$configurator-\u003eaddConfig('config.json');\n$configurator-\u003eaddConfig('config.local.php');\n\n$config = $configurator-\u003egetConfig();\n```\n\n\n### Parameters \u0026 placeholders\n\n``` php\nuse CzProject\\Configuration\\Configurator;\n\n$configurator = new Configurator;\n$configurator-\u003eaddConfig(array(\n\t'parameters' =\u003e array(\n\t\t'database' =\u003e array(\n\t\t\t'host' =\u003e 'localhost',\n\t\t\t'driver' =\u003e 'mysql',\n\t\t),\n\t),\n\n\t'messages' =\u003e array(\n\t\t'user' =\u003e '%database.user%',\n\t),\n));\n\n$configurator-\u003eaddConfig(array(\n\t'parameters' =\u003e array(\n\t\t'database' =\u003e array(\n\t\t\t'user' =\u003e '%database.host%_user123',\n\t\t\t'password' =\u003e 'password123',\n\t\t),\n\t),\n));\n\n$config = $configurator-\u003egetConfigExpandedBy('parameters');\n\n/* Returns:\n[\n\tparameters =\u003e [\n\t\tdatabase =\u003e [\n\t\t\thost =\u003e 'localhost',\n\t\t\tdriver =\u003e 'mysql',\n\t\t\tuser =\u003e 'localhost_user123',\n\t\t\tpassword =\u003e 'password123',\n\t\t]\n\t],\n\n\tmessages =\u003e [\n\t\tuser =\u003e 'localhost_user123',\n\t]\n]\n*/\n```\n\n------------------------------\n\nLicense: [New BSD License](license.md)\n\u003cbr\u003eAuthor: Jan Pecha, https://www.janpecha.cz/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fczproject%2Fconfiguration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fczproject%2Fconfiguration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fczproject%2Fconfiguration/lists"}