{"id":21819357,"url":"https://github.com/dflydev/dflydev-dot-access-configuration","last_synced_at":"2025-04-04T14:05:34.676Z","repository":{"id":3104378,"uuid":"4130221","full_name":"dflydev/dflydev-dot-access-configuration","owner":"dflydev","description":"Given a deep data structure representing a configuration, access configuration by dot notation.","archived":false,"fork":false,"pushed_at":"2023-01-06T20:52:18.000Z","size":38,"stargazers_count":134,"open_issues_count":4,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T13:06:04.467Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dflydev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-04-24T21:56:42.000Z","updated_at":"2023-12-19T23:04:06.000Z","dependencies_parsed_at":"2023-01-13T12:17:26.793Z","dependency_job_id":null,"html_url":"https://github.com/dflydev/dflydev-dot-access-configuration","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-dot-access-configuration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-dot-access-configuration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-dot-access-configuration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-dot-access-configuration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dflydev","download_url":"https://codeload.github.com/dflydev/dflydev-dot-access-configuration/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247189685,"owners_count":20898692,"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-27T16:18:38.296Z","updated_at":"2025-04-04T14:05:34.656Z","avatar_url":"https://github.com/dflydev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dot Access Configuration\n\nGiven a deep data structure representing a configuration, access\nconfiguration by dot notation.\n\nThis library combines [dflydev/dot-access-data](https://github.com/dflydev/dflydev-dot-access-data)\nand [dflydev/placeholder-resolver](https://github.com/dflydev/dflydev-placeholder-resolver)\nto provide a complete configuration solution.\n\n## Requirements\n\n * PHP (5.3+)\n * [dflydev/dot-access-data](https://github.com/dflydev/dflydev-dot-access-data) (^3)\n * [dflydev/placeholder-resolver](https://github.com/dflydev/dflydev-placeholder-resolver) (1.x)\n * [symfony/yaml](https://github.com/symfony/Yaml) (\u003e2,\u003c2.2) *(suggested)*\n\n## Usage\n\nGenerally one will use an implementation of `ConfigurationBuilderInterface`\nto build `ConfigurationInterface` instances. For example, to build a Configuration\nout of a YAML file, one would use the `YamlFileConfigurationBuilder`:\n\n```php\nuse Dflydev\\DotAccessConfiguration\\YamlFileConfigurationBuilder;\n\n$configurationBuilder = new YamlFileConfigurationBuilder('config/config.yml');\n$configuration = $configurationBuilder-\u003ebuild();\n```\n\nOnce created, the Configuration instance behaves similarly to a Data\ninstance from [dflydev/dot-access-data](https://github.com/dflydev/dflydev-dot-access-data).\n\n```php\n$configuration-\u003eset('a.b.c', 'ABC');\n$configuration-\u003eget('a.b.c');\n$configuration-\u003eset('a.b.e', array('A', 'B', 'C'));\n$configuration-\u003eappend('a.b.e', 'D');\n```\n\n## Custom Configurations\n\nConfiguration Builders use Configuration Factories and Placeholder Resolver\nFactories behind the scenes in order to build a working configuration.\n\nUnder normal circumstances one should not need to do anything with the\nPlaceholder Resolver Factory. However, one may wish to extend the\ndefault `Configuration` class or use an entirely different implementation\naltogether.\n\nIn order to build instances of custom `ConfigurationInterface` implementations\nwith the standard builders, one would need to implement\n`ConfigurationFactoryInterface` and inject it into any\n`ConfigurationBuilderInterface`.\n\nIf a Configuration is declared as follows:\n```php\nnamespace MyProject;\n\nuse Dflydev\\DotAccessConfiguration\\Configuration;\n\nclass MyConf extends Configuration\n{\n    public function someSpecialMethod()\n    {\n        // Whatever you want here.\n    }\n}\n```\n\nCreate the following factory:\n```php\nnamespace MyProject;\n\nuse Dflydev\\DotAccessConfiguration\\ConfigurationFactoryInterface;\n\nclass MyConfFactory implements ConfigurationFactoryInterface\n{\n    /**\n     * {@inheritdocs}\n     */\n    public function create()\n    {\n        return new MyConf;\n    }\n}\n```\n\nTo use the factory with any builder, inject it as follows:\n```php\nuse Dflydev\\DotAccessConfiguration\\YamlFileConfigurationBuilder;\nuse MyProject\\MyConfFactory;\n\n$configurationBuilder = new YamlFileConfigurationBuilder('config/config.yml');\n\n// Inject your custom Configuration Factory\n$configurationBuilder-\u003esetConfigurationFactory(new MyConfFactory);\n\n// Will now build instances of MyConfFactory instead of\n// the standard Configuration implementation.\n$configuration = $configurationBuilder-\u003ebuild();\n```\n\n## License\n\nThis library is licensed under the New BSD License - see the LICENSE file\nfor details.\n\n## Community\n\nIf you have questions or want to help out, join us in the\n[#dflydev](irc://irc.freenode.net/#dflydev) channel on irc.freenode.net.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflydev%2Fdflydev-dot-access-configuration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdflydev%2Fdflydev-dot-access-configuration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflydev%2Fdflydev-dot-access-configuration/lists"}