Link Search Menu Expand Document

PHP Libraries

This document outlines the various PHP libraries that could be of use to this project, which ones were choosen, and why.

Topics

If possible, libraries should be used for:

  • Content negotiation
  • CORS Header management
  • Crypto / Certificates
  • File converter (CSV / JSON / TSV / XML)
  • HTTP Request/Response
  • JSON Security (JOSE, JWA, JWE, JWK, JWS, JWT)
  • OAuth2
  • OpenID
  • RDF (Turtle, JSON-LD, RDFa, …)
  • SPARQL
  • Vocabulary (Dublin core, Schema.org, Owl, FoaF, …)
  • WebID
  • WSS

Requirements / Criteria

Besides being compatible with the license Nextcloud requires (AGPLv3+ or compatible), there are several other criteria a library must meet if we are to use it.

As the world is not a perfect place, deviation from these criteria is possible. In such a case, the reasoning as to why to deviate will be documented

Healthy open-source

Besides being open-source, in order to be healthy, a library also needs to:

  • Be actively maintained So there is convidence the library will remain supported)

  • Be well documented So the learning curve is less steep

  • Have somewhat of a community So answers to questions are already out there

It would be helpful if projects adhere to current FOSS best practices, but not required.

PHP Standard recommendations

There are several standard recommendations for PHP (PSR) that are relevant to this project. They are:

  • PSR-7 for HTTP messages
  • PSR-11 for dependency injection container
  • PSR-15 for HTTP server middleware
  • PSR-17 for HTTP message factory
  • PSR-18 for HTTP client requests

Whenever a choice needs to be made, libraries that adhere to PSR have preference over those that do not.

Standards

Besides the PSR conventions, there are also various other standards that are of importance.

Whenever a choice needs to be made, libraries that adhere to these have preference over those that do not.

Libraries

The following libraries are available.

Crypto / Certificates

HTTP Request/Response

JSON Security (JOSE, JWA, JWE, JWK, JWS, JWT)

OAuth2

OpenID

OpenID Connect (OIDC)

RDF (Turtle, JSON-LD, RDFa, …)

  • Easyrdf “EasyRdf is a PHP library designed to make it easy to consume and produce RDF.”
  • semsol/arc2 “ARC RDF Classes for PHP”

Copyright © 2020-2021 PDS Interop. Distributed under a MIT license.