Code Monkey home page Code Monkey logo

laminas-httphandlerrunner's Introduction

laminas-httphandlerrunner

Build Status

🇷🇺 Русским гражданам

Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги как в России, так и в Украине. Некоторые из нас родились в России. Некоторые из нас живут в России. У некоторых бабушки и дедушки сражались с фашистами во Второй мировой войне. Здесь никто не поддерживает фашизм.

У одного из нас есть украинская родственница, которая спаслась из дома вместе с сыном. Поезд задержался из-за бомбежки на дороге впереди. У нас есть друзья, которые прячутся в бомбоубежищах. Мы с тревогой ждем весточки от них после воздушных налетов, которые беспорядочно наносят удары и попадают по больницам, школам, детским садам и домам. Мы не берем это из каких-либо СМИ. Мы наблюдаем это напрямую.

Вы доверяете нам достаточно, чтоб использовать наши программы, и мы просим вас довериться нам вновь. Мы нуждаемся в помощи. Выходите и протестуйте против этой бесполезной войны. Остановите кровопролитие. Скажите "Нет войне!"

🇺🇸 To Citizens of Russia

We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism.

One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences.

You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!"

This library provides utilities for:

  • Emitting PSR-7 responses.
  • Running PSR-15 server request handlers, which involves marshaling a PSR-7 ServerRequestInterface, handling exceptions due to request creation, and emitting the response returned by the composed request handler.

The RequestHandlerRunner will be used in the bootstrap of your application to fire off the RequestHandlerInterface representing your application.

Installation

Run the following to install this library:

$ composer require laminas/laminas-httphandlerrunner

Documentation

Documentation is in the doc tree, and can be compiled using mkdocs:

$ mkdocs build

You may also browse the documentation online.

laminas-httphandlerrunner's People

Contributors

admad avatar boesing avatar dcabanaw avatar geerteltink avatar ghostwriter avatar gsteel avatar laminas-bot avatar mariusbuescher avatar mauriciofauth avatar michalbundyra avatar nyholm avatar ocramius avatar pine3ree avatar renovate[bot] avatar samsonasik avatar timwolla avatar weierophinney avatar xerkus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laminas-httphandlerrunner's Issues

Unnecessary closure?

Is the closure required here? Can't $serverRequestErrorResponseGenerator be assigned directly to $this->serverRequestErrorResponseGenerator?

$this->serverRequestErrorResponseGenerator =
function (Throwable $exception) use ($serverRequestErrorResponseGenerator) : ResponseInterface {
return $serverRequestErrorResponseGenerator($exception);
};

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: Use matchDepNames instead of matchPackageNames

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • Lock file maintenance

Warning

Renovate failed to look up the following dependencies: Failed to look up packagist package psr/http-message-implementation.

Files affected: composer.json


Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

composer
composer.json
  • php ~8.1.0 || ~8.2.0 || ~8.3.0
  • psr/http-message ^1.0 || ^2.0
  • psr/http-message-implementation ^1.0 || ^2.0
  • psr/http-server-handler ^1.0
  • laminas/laminas-coding-standard ~2.5.0
  • laminas/laminas-diactoros ^3.3.0
  • phpunit/phpunit ^10.5.10
  • psalm/plugin-phpunit ^0.19.0
  • vimeo/psalm ^5.21.1
github-actions
.github/workflows/continuous-integration.yml
.github/workflows/docs-build.yml
.github/workflows/release-on-milestone-closed.yml

  • Check this box to trigger a request for Renovate to run again on this repository

Psalm integration

Feature Request

Q A
QA yes

Summary

As decided during the Technical-Steering-Committee Meeting on August 3rd, 2020, Laminas wants to implement vimeo/psalm in all packages.

Implementing psalm is quite easy.

Required

  • Create a .psalm.xml.dist in the project root
  • Copy and paste the contents from this psalm.xml.dist
  • Run $ composer require vimeo/psalm
  • Run $ vendor/bin/psalm --set-baseline=psalm-baseline.xml
  • Add a composer script static-analysis with the command psalm --shepherd --stats
  • Add a new line to script: in .travis.yml: - if [[ $TEST_COVERAGE == 'true' ]]; then composer static-analysis ; fi
  • Remove phpstan from the project (phpstan.neon.dist, .travis.yml entry, composer.json require-dev and scripts)
Optional
  • Fix as many psalm errors as possible.

Move `EmitterInterface` into another project

RFC

Q A
Proposed Version(s) 3.0.0
BC Break? Yes

Goal

Allow users to use implementations of EmitterInterface without requiring laminas-httphandlerrunner be installed.

Background,

  • Library authors may want to provide different implementations of EmitterInterface for different use cases.
  • Implementations of EmitterInterface could be created that do not require all of laminas-httphandlerrunner.

Note: There are several forks of laminas-httphandlerrunner (See non-exhaustive list) some of which contain only a copy of EmitterInterface

Considerations

Users will have to implement the interface from PHP Contrib instead of [laminas/laminas-httphandlerrunner](https://github.com/laminas/laminas-httphandlerrunner/). Since the interface will not change, users will only need to composer require php-contrib/http-emitter or composer require laminas/http-emitter, then update the use statements in their projects.

Proposal(s)

I am proposing that EmitterInterface be moved either to PHP Contrib or to a separate project in laminas.

Appendix

List of Copies of EmitterInterface

php version (8.2.2) does not satisfy that requirement

Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laminas/laminas-httphandlerrunner 1.2.0 requires php ^7.1 -> your php version (8.2.2) does not satisfy that requirement.
    - laminas/laminas-httphandlerrunner[1.3.0, ..., 1.4.0] require php ^7.3 || ~8.0.0 -> your php version (8.2.2) does not satisfy that requirement.
    - laminas/laminas-httphandlerrunner 1.5.0 requires php ^7.3 || ~8.0.0 || ~8.1.0 -> your php version (8.2.2) does not satisfy that requirement.
    - flarum/core v1.6.3 requires laminas/laminas-httphandlerrunner ^1.2.0 -> satisfiable by laminas/laminas-httphandlerrunner[1.2.0, 1.3.0, 1.4.0, 1.5.0].
    - Root composer.json requires flarum/core ^1.6 -> satisfiable by flarum/core[v1.6.0, v1.6.1, v1.6.2, v1.6.3].

PHP 8.0 support

Feature Request

Q A
New Feature yes

Summary

To be prepared for the december release of PHP 8.0, this repository has some additional TODOs to be tested against the new major version.

In order to make this repository compatible, one has to follow these steps:

  • Modify composer.json to provide support for PHP 8.0 by adding the constraint ~8.0.0
  • Modify composer.json to drop support for PHP less than 7.3
  • Modify composer.json to implement phpunit 9.3 which supports PHP 7.3+
  • Modify .travis.yml to ignore platform requirements when installing composer dependencies (simply add --ignore-platform-reqs to COMPOSER_ARGS env variable)
  • Modify .travis.yml to add PHP 8.0 to the matrix (NOTE: Do not allow failures as PHP 8.0 has a feature freeze since 2020-08-04!)
  • Modify source code in case there are incompatibilities with PHP 8.0

SapiStreamEmitter that does not consider Content-Range

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

SapiStreamEmitter::emit considers the header Content-Range and emits only the relevant range when only a single range is requested and the range unit is bytes. This seems very nice and convenient at first glance.

If the application wants to support multi-range requests or range units other than bytes, however, populating the response with the correct content range(s) must be done by the application, and SapiStreamEmitter will emit the entire provided response body.

This seems very asymmetrical to me. Who should actually be in charge of ensuring that the response body is correct? The one who populates the response body or the one who emits it?

My application would have to populate the final response body in the case of multi-range or non-byte unit, but populate the entire file into the response body in the case of single byte range, and then let SapiStreamEmitter handle the range-stuff. I would like the option to let SapiStreamEmitter just output the whole response body that I have provided, regardless of the Content-Range range header.

I actually don't think the Content-Range functionality has anything to do in the emitter, so I would prefer to just remove it. But such a change in functionality might warrant a new major version. The behavior could also be set in a constructor argument. Or there could be a separate class.

If the Content-Range functionality has anything to do in the emitter, why isn't it also a part of the SapiEmitter. In my opinion, exchanging the one for the other should not lead to different output.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.