{"id":19307517,"url":"https://github.com/tabbi89/configserviceprovider","last_synced_at":"2025-08-02T02:11:55.355Z","repository":{"id":12073122,"uuid":"14660361","full_name":"tabbi89/ConfigServiceProvider","owner":"tabbi89","description":"Basic ConfigServiceProvider for Silex Framework supports PHP, JSON, YAML, TOML","archived":false,"fork":false,"pushed_at":"2013-12-08T20:27:10.000Z","size":328,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-02T02:05:59.411Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tabbi89.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":"2013-11-24T11:54:37.000Z","updated_at":"2014-08-07T20:04:14.000Z","dependencies_parsed_at":"2022-09-22T14:43:24.605Z","dependency_job_id":null,"html_url":"https://github.com/tabbi89/ConfigServiceProvider","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tabbi89/ConfigServiceProvider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabbi89%2FConfigServiceProvider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabbi89%2FConfigServiceProvider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabbi89%2FConfigServiceProvider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabbi89%2FConfigServiceProvider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tabbi89","download_url":"https://codeload.github.com/tabbi89/ConfigServiceProvider/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabbi89%2FConfigServiceProvider/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268326739,"owners_count":24232496,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10T00:11:20.506Z","updated_at":"2025-08-02T02:11:55.331Z","avatar_url":"https://github.com/tabbi89.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ConfigServiceProvider\n\nA config ServiceProvider for [Silex](http://silex.sensiolabs.org) with support\nfor php, json, yaml, and toml. It is based on Igor Wiedler [ConfigServiceProvider](https://github.com/igorw/ConfigServiceProvider).\nThe main diffrence is in usage. It allows now to get config options in \"Laravel way\". Getting config keys is very simple, first define\na folder where you will store all your config files then add all the files into it. The first level of key is file name, next levels depends\non you.\n\nExample:\n\n    # config/database.php\n    return = array(\n        'db_name' =\u003e 'test',\n        'db_password' =\u003e 'password',\n        'db_user' =\u003e 'user',\n        'db_host' =\u003e 'localhost',\n    );\n\nThe getting key will be `database.db_name`.\n## Usage\n\n### Using Yaml\n\nTo use Yaml just pass a file that ends on `.yml` or `.yaml` in add method:\n\n    $app-\u003eregister(new Tabbi\\Silex\\ConfigServiceProvider());\n    $app['config']-\u003eadd(__DIR__.\"/../config/services.yml\");\n    echo $app['config']-\u003eget('services.option.value');\n\nNote, it requires `~2.3` - `symfony/yaml` package.\n\n### Using TOML\n\nTo use [TOML](https://github.com/mojombo/toml) instead of any of the other supported formats,\njust pass a file that ends on `.toml`:\n\n    $app-\u003eregister(new Tabbi\\Silex\\ConfigServiceProvider());\n    $app['config']-\u003eadd(__DIR__.\"/../config/services.toml\");\n    echo $app['config']-\u003eget('services.option.value');\n\nNote, it requires `~0.1` - `jamesmoss/toml` package and you are using\na bleeding edge configuration format, as the spec of TOML is still subject to change.\n\n### Using plain PHP\n\nUse simple php configs that returns the array of config data, and also make sure it ends with `.php`:\n\n    $app-\u003eregister(new Tabbi\\Silex\\ConfigServiceProvider());\n    $app['config']-\u003eadd(__DIR__.\"/../config/services.php\");\n    echo $app['config']-\u003eget('services.option.value');\n\n### Using Json\n\nTo use Json just pass a file that ends on `.json` in add method:\n\n    $app-\u003eregister(new Tabbi\\Silex\\ConfigServiceProvider());\n    $app['config']-\u003eadd(__DIR__.\"/../config/services.json\");\n    echo $app['config']-\u003eget('services.option.value');\n\n### Multiple config files\n\nYou can use multiple config files, e. g. one for a whole application and a\nspecific one for a task by calling `$app['config]-\u003eadd()` several times.\n\n    $app-\u003eregister(new Tabbi\\Silex\\ConfigServiceProvider());\n    $app['config']-\u003eadd(__DIR__.\"/../config/services.php\");\n    $app['config']-\u003eadd(__DIR__.\"/../config/database.php\");\n    $app['config']-\u003eadd(__DIR__.\"/../config/cache.php\");\n    echo $app['config']-\u003eget('services.option.value');\n    echo $app['config']-\u003eget('database.option.value');\n    echo $app['config']-\u003eget('cache.option.value');\n\n### Register order\n\nMake sure you do not register anything with `config` name. You don't have to keep\ncorrect order just remember to add config before its usage.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabbi89%2Fconfigserviceprovider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftabbi89%2Fconfigserviceprovider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabbi89%2Fconfigserviceprovider/lists"}