A suggestion if/when PSR-5 is revived

49 views
Skip to first unread message

Alice Wonder

unread,
May 10, 2018, 4:56:18 PM5/10/18
to PHP Framework Interoperability Group
There should be an option phpdoc header for where information on the latest version of the the package/file can be obtained.

It should only appear in the mail file doc comment (that appears before any code except for declaration of stict_types) and my when an automated system makes a call to the url, a GET parameter defining the version of PHP should be standardized when used but not required.

Something like @versioncheck: https://www.example.org/whatever.php

Clients can use that URL to see if they have the most recent version of the package optionally with ?phpv=7.1.16 appended.

The response of the request is beyond the scope of PSR5 but probably should be JSON and if the latest version diffrers for different versions of PHP, the response JSON should be an array of latest versions unless a GET was provided in which case the response may only include what is applicable to that version.

Where such a phpdoc header is potentially useful is when plugins are installed in a framework that are not part of a repository updated by the framework itself. It would make a uniform easy mechanism by which such extensions/plugins could be checked to see if they are at the latest version, potentially increasing security when third party plugins are used.
Reply all
Reply to author
Forward
0 new messages