{"id":18794551,"url":"https://github.com/effectra/config","last_synced_at":"2026-04-29T20:08:15.771Z","repository":{"id":165338713,"uuid":"640682877","full_name":"effectra/config","owner":"effectra","description":"Effectra Config is library simplifies configuration management in PHP applications, providing classes for files, drivers, cookies, db and editor configurations.","archived":false,"fork":false,"pushed_at":"2023-06-19T11:08:11.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-12-29T16:34:02.717Z","etag":null,"topics":["config","config-server","configeditor","configuration-files","cookies","database","db","driver","php","php8"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/effectra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-05-14T22:04:34.000Z","updated_at":"2023-05-25T10:28:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"50aa85e6-16f6-4117-85a8-03b6c52fb101","html_url":"https://github.com/effectra/config","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Fconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Fconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Fconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Fconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/effectra","download_url":"https://codeload.github.com/effectra/config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239718692,"owners_count":19685795,"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":["config","config-server","configeditor","configuration-files","cookies","database","db","driver","php","php8"],"created_at":"2024-11-07T21:29:44.988Z","updated_at":"2025-12-29T18:30:12.835Z","avatar_url":"https://github.com/effectra.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Effectra\\Config\n\nThe `Effectra\\Config` library provides a set of classes and interfaces for managing and working with configuration settings in PHP applications.\n\n## Features\n\n- Configuration file handling: Read and manipulate configuration settings stored in files.\n- Driver configuration: Define and manage driver-related settings such as host, port, username, and password.\n- Cookie configuration: Create and manage HTTP cookies with various attributes.\n- Editor configuration: Parse and retrieve settings from EditorConfig files.\n\n## Installation\n\nInstall the library using [Composer](https://getcomposer.org/):\n\n```bash\ncomposer require effectra/config\n```\n\n## Usage\n\n1. Include the necessary classes or interfaces in your PHP files:\n\n```php\nuse Effectra\\Config\\ConfigFile;\nuse Effectra\\Config\\ConfigDriver;\nuse Effectra\\Config\\ConfigCookie;\nuse Effectra\\Config\\ConfigEditor;\n```\n\n2. Use the provided classes to handle configuration settings based on your application's requirements.\n\n### Example 1: Reading and Manipulating Configuration Files\n\n```php\nuse Effectra\\Config\\ConfigFile;\n\n// Create a ConfigFile instance with the path to your configuration file\n$configFile = new ConfigFile('/path/to/config.ini');\n\n// Read the configuration settings from the file\n$config = $configFile-\u003eread();\n\n// Access specific sections and settings\n$databaseConfig = $configFile-\u003egetSection('database');\n$host = $databaseConfig['host'];\n$username = $databaseConfig['username'];\n\n// Modify a setting and write the changes back to the file\n$config['app']['debug'] = true;\n$configFile-\u003esetFile('/path/to/config.ini')-\u003ewrite($config);\n```\n\n### Example 2: Creating and Managing ConfigDriver\n\n```php\nuse Effectra\\Config\\ConfigDriver;\n\n// Create a ConfigDriver instance with initial settings\n$driver = new ConfigDriver('mysql', 'localhost', 3306, 'username', 'password');\n\n// Get the current driver details\n$driverName = $driver-\u003egetDriver();\n$host = $driver-\u003egetHost();\n\n// Update the driver settings\n$driver = $driver-\u003ewithHost('newhost')-\u003ewithPort(8888);\n\n// Get the updated driver details\n$newHost = $driver-\u003egetHost();\n$newPort = $driver-\u003egetPort();\n```\n\n### Example 3: Creating and Modifying ConfigCookie\n\n```php\nuse Effectra\\Config\\ConfigCookie;\n\n// Create a ConfigCookie instance with initial attributes\n$cookie = new ConfigCookie('session', 'abc123', 3600, '/', 'example.com', true, true);\n\n// Get the cookie attributes\n$name = $cookie-\u003egetName();\n$secure = $cookie-\u003egetSecure();\n\n// Create a new cookie instance with updated attributes\n$newCookie = $cookie-\u003ewithExpireOrOptions(7200)-\u003ewithSecure(false);\n\n// Get the updated cookie attributes\n$newExpire = $newCookie-\u003egetExpireOrOptions();\n$newSecure = $newCookie-\u003egetSecure();\n```\n\n### Example 4: Parsing EditorConfig File\n\n```php\nuse Effectra\\Config\\ConfigEditor;\n\n// Create a ConfigEditor instance with the path to an EditorConfig file\n$editorConfig = new ConfigEditor('/path/to/.editorconfig');\n\n// Get the root value from the EditorConfig file\n$root = $editorConfig-\u003egetRoot();\n\n// Get the indent_size and end_of_line settings\n$indentSize = $editorConfig-\u003egetIndentSize();\n$endOfLine = $editorConfig-\u003egetEndOfLine();\n\n// Check if a charset setting is defined\nif ($editorConfig-\u003ehasSection('charset')) {\n    $charsetSettings = $editorConfig-\u003egetSection('charset');\n    // Process the charset settings\n} else {\n    // Handle the case when charset settings are not present\n}\n```\n\nFeel free to adjust the examples according to your specific needs and use cases.\n\n## Contributing\n\nContributions are welcome! Fork the repository, make your enhancements, and submit a pull request.\n\n## License\n\nThis library is licensed under the [MIT License](LICENSE).\n\n## Credits\n\nThe `Effectra\\Config` library is developed and maintained by [Effectra].\n\nFeel free to update and customize the content based on your specific library details. Don't forget to replace `[link-to-documentation]` and `[Effectra]` with appropriate links and information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feffectra%2Fconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feffectra%2Fconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feffectra%2Fconfig/lists"}