Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nicholascar/php-connegp
https://github.com/nicholascar/php-connegp
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nicholascar/php-connegp
- Owner: nicholascar
- License: gpl-3.0
- Created: 2019-10-28T23:38:40.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-02T07:26:10.000Z (about 5 years ago)
- Last Synced: 2024-04-13T21:07:49.961Z (7 months ago)
- Language: PHP
- Size: 41 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP ConnegP
A library of functions for HTTP Content Negotiation by Profile (https://www.w3.org/TR/dx-prof-conneg/).This code is online at .
All functions are in [src/functions.php](src/ConnegP.php) while [src/test_functions.php](src/test_functions.php) contains unit tests for most of them. The functions are documented in place but basically serve the following 3 purposes:
1. supports the *list profiles* function
* by creating a `Link` header with Alternate Representation information, as per the [HTTP *list profile*](https://w3c.github.io/dxwg/conneg-by-ap/#http-listprofiles) part of the ConnegP specification
* see `make_header_list_profiles()`
2. supports returning a *Content-Profile* header
* see `make_header_content_profile()`
* requires that the URI of the profile that the returned representation conforms to has been calculated
3. supports *get resource by profile*
* by assisting with parsing `Accept-Profile` HTTP request header: `get_profiles_requested()`
* by checking if the requested profile matches a supported profile: `get_profile_to_return()`
* same for Media Types: `get_mediatypes_requested()` & `get_mediatype_to_return()`## License & Rights
This code was developed by Nicholas Car to assist with the Content Negotiation by Profile W3C Recommendation.### Rights
© Nicholas J. Car, 2019### License
GNU GPL 3 (see [LICENSE](LICENSE) for the deed).## Contact
Author:
**Nicholas Car**
*Data System Architect*
[SURROUND Australia Pty Ltd](https://surroundaustralia.com)
[[email protected]](mailto:[email protected])