{"id":20080019,"url":"https://github.com/php-lights/data-url","last_synced_at":"2025-05-05T23:30:57.127Z","repository":{"id":37004614,"uuid":"307258633","full_name":"neoncitylights/php-data-url","owner":"neoncitylights","description":"PHP library for dealing with data URLs","archived":false,"fork":false,"pushed_at":"2024-06-24T01:36:23.000Z","size":122,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-08-08T19:14:42.260Z","etag":null,"topics":["data-url","php","rfc-2397"],"latest_commit_sha":null,"homepage":"https://neoncitylights.github.io/php-data-url/","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/neoncitylights.png","metadata":{"funding":{"github":"neoncitylights"},"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}},"created_at":"2020-10-26T04:12:02.000Z","updated_at":"2024-04-15T18:31:33.000Z","dependencies_parsed_at":"2024-04-22T02:47:40.939Z","dependency_job_id":null,"html_url":"https://github.com/neoncitylights/php-data-url","commit_stats":{"total_commits":43,"total_committers":3,"mean_commits":"14.333333333333334","dds":"0.18604651162790697","last_synced_commit":"d45010f833c295fc833d17cd4b2d5ccf381d8c97"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neoncitylights%2Fphp-data-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neoncitylights%2Fphp-data-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neoncitylights%2Fphp-data-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neoncitylights%2Fphp-data-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neoncitylights","download_url":"https://codeload.github.com/neoncitylights/php-data-url/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224473292,"owners_count":17317148,"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":["data-url","php","rfc-2397"],"created_at":"2024-11-13T15:25:44.200Z","updated_at":"2025-05-05T23:30:57.120Z","avatar_url":"https://github.com/neoncitylights.png","language":"PHP","funding_links":["https://github.com/sponsors/neoncitylights"],"categories":[],"sub_categories":[],"readme":"# DataUrl\n[![Packagist][packagist-badge]][packagist-url]\n[![License][license-badge]][license-url]\n[![Docs][docs-badge]][docs-url]\n[![CI][ci-badge]][ci-url]\n[![Code coverage][codecov-badge]][codecov-url]\n\n[packagist-badge]: https://img.shields.io/packagist/v/neoncitylights/data-url?style=flat-square\n[packagist-url]: https://packagist.org/packages/neoncitylights/data-url\n[license-badge]: https://img.shields.io/badge/License-MIT-blue?style=flat-square\n[license-url]: #license\n[docs-badge]: https://img.shields.io/github/deployments/php-lights/data-url/github-pages?label=docs\u0026style=flat-square\n[docs-url]: https://php-lights.github.io/data-url/\n[ci-badge]: https://img.shields.io/github/actions/workflow/status/php-lights/php-data-url/.github/workflows/php.yml?style=flat-square\n[ci-url]: https://github.com/php-lights/php-data-url/actions/workflows/php.yml\n[codecov-badge]: https://img.shields.io/codecov/c/github/php-lights/data-url?style=flat-square\n[codecov-url]: https://app.codecov.io/gh/php-lights/data-url\n\nA small PHP library for dealing with data URLs, which contain a media type and an encoded base64 string.\n\nThis library fully conforms to [RFC 2397](https://datatracker.ietf.org/doc/html/rfc2397).\n\n## Install\nThis requires a minimum PHP version of v8.2.\n\n```\ncomposer require neoncitylights/data-url\n```\n\n## Usage\n```php\n\u003c?php\n\nuse Neoncitylights\\DataUrl\\DataUrlParser;\nuse Neoncitylights\\MediaType\\MediaTypeParser;\n\n$dataUrlParser = new DataUrlParser( new MediaTypeParser() );\n$dataUrl = $dataUrlParser-\u003eparseOrNull( 'data:text/plain;base64,VGhlIGZpdmUgYm94aW5nIHdpemFyZHMganVtcCBxdWlja2x5Lg==' );\n\nprint( $dataUrl-\u003egetMediaType()-\u003egetEssence() );\n// 'text/plain'\n\nprint( $dataUrl-\u003egetData() );\n// `VGhlIGZpdmUgYm94aW5nIHdpemFyZHMganVtcCBxdWlja2x5Lg==`\n\nprint( $dataUrl-\u003egetDecodedValue() );\n// 'The five boxing wizards jump quickly.'\n```\n\n## License\nThis software is licensed under the MIT license ([`LICENSE`](./LICENSE) or\n\u003chttps://opensource.org/license/mit/\u003e).\n\n### Contribution\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the MIT license, shall be\nlicensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-lights%2Fdata-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-lights%2Fdata-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-lights%2Fdata-url/lists"}