3

Is there maybe a way to install the PSR-7 HTTP message interfaces using Composer? I can't seem to find any information on the official github page, nor on the web.

Beeing a Composer-beginner, I would also like to ask, if it is possible to install packages from internet (maybe also outside Github) with Composer, even if they don't provide informations regarding installation using Composer.

Thank you very much.

  • 2
    The composer package [psr/http-message](https://packagist.org/packages/psr/http-message) contains the interface definitions, but unless you plan to write your own implementation from scratch you're going to want to use a package that actually contains an implementation that you can use like @DanielO suggested. – Sammitch Nov 25 '17 at 00:36
  • 1
    Thanks, @Sammitch! Actually, I'm almost finished with my own PSR-7 implementation. But until today I didn't use Composer, but my own autoloader. Today I was greatly surprised by the Composer capabilities :-) –  Nov 25 '17 at 00:40

2 Answers2

2

You just have to select and install a PSR-7 implementation like laminas/laminas-diactoros or slim/psr7. You can find all composer packages on https://packagist.org/.

Example:

composer require slim/psr7
odan
  • 4,757
  • 5
  • 20
  • 49
  • I looked for the http message infos into the downloaded Slim package. It was indeed there: `"require: { "psr/http-message": "^1.0" }` :-) And I looked into the packagist.org too. It was there also. You brought me a step further. I appreciate your help! –  Nov 25 '17 at 00:47
2
composer require psr/http-message
rob006
  • 21,383
  • 5
  • 53
  • 74
Weedukind
  • 31
  • 5