evought / data-uri
A convenient class for working with Data URIs in PHP.
Installs: 8 111
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.4.0
Requires (Dev)
- phpunit/phpunit: 4.3.*
This package is not auto-updated.
Last update: 2024-11-09 18:01:11 UTC
README
README.md
Eric Vought
2015-01-25 DataURI PHP library
#What This Project Is#
The DataUri class provides a convenient way to access and construct data URIs, but should not be relied upon for enforcing RFC 2397 standards.
This class will not:
- Validate the media-type provided/parsed
- Validate the encoded data provided/parsed
Examples of how to use the class are in FlyingTopHat's blog post, "Using Data URI's in PHP".
#Source and History#
DataURI is a class originally written by FlyTopHat and was used as an example in a 2012 blog post and as a Gist.
In 2014, I forked the Gist in order to package it as a micro-library for use by Composer as a dependency in other projects. Using a Gist-based micro-library in composer requires creating a custom VCS-based repository in your composer.json. This is clunky but acceptable in an application but becomes difficult if the host project is itself used as a Composer-dependency because the custom repository definition is not (by design) included in the host project. The repository definition and package requirement must be repeated in each enclosing project--- effectively defeating the purpose of automatic dependency management.
So, in 2015, I forked my fork of DataURI, this time to move it to a full-fledged GitHub repository so that it could be made into an actual composer-managed library in the Packagist repository and the extra machinery needed to turn it into a production component could be added.
#Licensing#
All components are under an MIT license. FlyingTopHat added an MIT license to the original GIST on 2 February 2015 to clarify original license.