{"id":20540570,"url":"https://github.com/utopia-php/dsn","last_synced_at":"2025-04-14T08:37:43.544Z","repository":{"id":62103312,"uuid":"557473412","full_name":"utopia-php/dsn","owner":"utopia-php","description":"Lite \u0026 fast micro PHP library for handling Data Source Names (DSNs) that is **easy to use**.","archived":false,"fork":false,"pushed_at":"2024-05-07T02:02:00.000Z","size":37,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-27T22:11:08.028Z","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/utopia-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-10-25T18:52:50.000Z","updated_at":"2025-03-25T06:57:22.000Z","dependencies_parsed_at":"2022-10-26T12:30:38.381Z","dependency_job_id":"6af29098-26ac-4f42-b049-ab7bf9bc0656","html_url":"https://github.com/utopia-php/dsn","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"17a5935eab1b89fb4b95600db50a1b6d5faa6cea"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fdsn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fdsn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fdsn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fdsn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/utopia-php","download_url":"https://codeload.github.com/utopia-php/dsn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248847030,"owners_count":21171078,"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-16T01:16:17.262Z","updated_at":"2025-04-14T08:37:43.511Z","avatar_url":"https://github.com/utopia-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Utopia DSN\n\n![Total Downloads](https://img.shields.io/packagist/dt/utopia-php/dsn.svg)\n[![Discord](https://img.shields.io/discord/564160730845151244)](https://appwrite.io/discord)\n\nUtopia DSN library is simple and lite library for parsing and managing Data Source Names or DSNs. This library aims to be as simple and easy to learn and use as possible. This library is maintained by the [Appwrite team](https://appwrite.io).\n\nAlthough the library was built for the [Utopia Framework](https://github.com/utopia-php/framework) project, it is completely independent, **dependency-free** and can be used with any other PHP project or framework.\n\n## Getting Started\n\nInstall using composer:\n```bash\ncomposer require utopia-php/dsn\n```\n\n```php\n\u003c?php\n\nrequire_once '../vendor/autoload.php';\n\n$dsn = new DSN('mariadb://user:password@localhost:3306/database?charset=utf8\u0026timezone=UTC');\n$scheme = $dsn-\u003egetScheme(); // mariadb\n$user = $dsn-\u003egetUser(); // user\n$password = $dsn-\u003egetPassword(); // password\n$host = $dsn-\u003egetHost(); // localhost\n$port = $dsn-\u003egetPort(); // 3306\n$path = $dsn-\u003egetPath(); // database\n$query = $dsn-\u003egetQuery(); // charset=utf8\u0026timezone=UTC\n$charset = $dsn-\u003egetParam('charset') // utf8\n$timezone = $dsn-\u003egetParam('timezone') // UTC\n```\n\n## Tests\n\nTo run all unit tests, use the following Docker command:\n\n```bash\ndocker run --rm -v $(pwd):$(pwd):rw -w $(pwd) php:8.0-cli-alpine sh -c \"vendor/bin/phpunit --configuration phpunit.xml tests\"\n```\n\nTo run the linter, use the following composer command:\n\n```bash\ncomposer lint\n\n# Or if you do not have composer installed\ndocker run --rm -v $(pwd):$(pwd):rw -w $(pwd) composer  sh -c \"composer lint\"\n```\n\nTo fix the errors raised by the linter, use the following command:\n\n```php\ncomposer format\n\n# Or if you do not have composer installed\ndocker run --rm -v $(pwd):$(pwd):rw -w $(pwd) composer  sh -c \"composer format\"\n```\n\n## System Requirements\n\nUtopia DSN requires PHP 8.0 or later. We recommend using the latest PHP version whenever possible.\n\n## Copyright and license\n\nThe MIT License (MIT) [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futopia-php%2Fdsn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futopia-php%2Fdsn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futopia-php%2Fdsn/lists"}