{"id":20846647,"url":"https://github.com/yohn/config","last_synced_at":"2026-02-03T01:39:21.634Z","repository":{"id":253589214,"uuid":"843956467","full_name":"Yohn/Config","owner":"Yohn","description":"Simple way to load multiple config files in a dircetory into an easy callable static class","archived":false,"fork":false,"pushed_at":"2025-11-15T15:18:20.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-15T17:26:50.174Z","etag":null,"topics":["config","php-config","php-config-parser","simple-config","simpleconfig"],"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/Yohn.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-17T23:45:54.000Z","updated_at":"2025-11-15T15:16:02.000Z","dependencies_parsed_at":"2024-11-18T02:17:20.141Z","dependency_job_id":"c856d557-d4b7-4acc-89d7-eaadeb4d03b3","html_url":"https://github.com/Yohn/Config","commit_stats":null,"previous_names":["yohn/config"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Yohn/Config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohn%2FConfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohn%2FConfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohn%2FConfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohn%2FConfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yohn","download_url":"https://codeload.github.com/Yohn/Config/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohn%2FConfig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29026418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T00:53:18.321Z","status":"ssl_error","status_checked_at":"2026-02-03T00:51:45.186Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["config","php-config","php-config-parser","simple-config","simpleconfig"],"created_at":"2024-11-18T02:17:16.480Z","updated_at":"2026-02-03T01:39:21.605Z","avatar_url":"https://github.com/Yohn.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yohns\\Core\\Config\n\n## [Config](docs/Config.md)\nBase configuration class that stores the value from returning arrays in php files.\n### Methods\n\n| Name | Description |\n|------|-------------|\n|[__construct](docs/#config__construct)|Config constructor.|\n|[get](docs/#configget)|Retrieves a configuration value.|\n|[getAll](docs/#configgetall)|Retrieve all configuration values for file.|\n|[getCustom](docs/#configgetcustom)|Retrieves a custom configuration value.|\n|[reload](docs/#configreload)|Reloads configurations from a specified directory.|\n|[set](docs/#configset)|Sets a configuration value.|\n\n## [ConfigEditor](docs/ConfigEditor.md)\n\u003e [!TIP]\n\u003e  Add, Edit, and Create Configs\n\u003e * Create new config files (for new repos that may get added?),\n\u003e * Add new key =\u003e value pairs to a config file already found.\n\u003e * ~~Edit values for predefined configs, you have~~\n\u003e   * ~~You have to set the allow override option to true, default is false~~\n\u003e Removed editing because it doubles up the same key.\n\n### Methods\n\n| Name | Description |\n|------|-------------|\n|[addToConfig](docs/#configeditoraddtoconfig)|Adds key-value pairs to a configuration array if they do not already exist in the specified configuration file. If the file does not exist, it creates a new configuration file with the provided data.|\n\n---\n---\n\nPut all config files in 1 directory and then call that directory and it'll load all the config files to the variable\n\nCheck out the [Example File](Example.php)\n\nUse composers autoload or include path to the Core/Config.php file\n\n### Example using Config\n```php\nuse Yohns\\Core\\Config;\n\ninclude('vendor/autoload.php');\n\n$dir = __DIR__.'/lib/Config';\n\n// Initialize Config with a specific directory\nnew Config($dir);\n\n// Get a configuration value\necho Config::get('users', 'db_tables').PHP_EOL;\n\n// Set a custom configuration value\nConfig::set('api_key', '12345');\n\n// Retrieve a custom configuration value\necho Config::getCustom('api_key').PHP_EOL;\n```\n### Example ConfigEditor\n```php\nuse Yohns\\Core\\Config;\nuse Yohns\\Core\\ConfigEditor;\n\ninclude('vendor/autoload.php');\n\n$dir = __DIR__.'/lib/Config';\n\n// Initialize Config with a specific directory\nnew Config($dir);\n\n// Editor class allows us to append key=\u003evalues to the config files, or create a new config file if not found.\nConfigEditor::addToConfig(\n\t['add-new' =\u003e 'value'],\n\t'default',\n\t// only set to true if you want to \"edit\" the value if found in config file already.\n\t// default is false.\n\ttrue);\nConfig::reload($dir);\n\n// get from the 'default' configs do not need to mention the file in get()\necho Config::get('add-new').PHP_EOL;\n```\n\nExample code uses the config/ directory found in this repo.\n\n# config/default.php:\n\n```php\n\u003c?php\nreturn [\n\t'siteName' =\u003e 'Testing'\n];\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyohn%2Fconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyohn%2Fconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyohn%2Fconfig/lists"}