Coder Social home page Coder Social logo

zendframework / zend-httphandlerrunner Goto Github PK

View Code? Open in Web Editor NEW
46.0 16.0 14.0 1.3 MB

Execute PSR-15 RequestHandlerInterface instances and emit responses they generate.

License: BSD 3-Clause "New" or "Revised" License

PHP 100.00%
php php71 psr-15 psr-7 zend-framework

zend-httphandlerrunner's Issues

assertNoPreviousOutput check ?

Hi, in my framework, ofter need output someting with ob content, like a image captcha, then I get this error

`
Uncaught Zend\HttpHandlerRunner\Exception\EmitterException: Output has been emitted previously; cannot emit response

`

so I 'm curious, why do I have to perform a $this->assertNoPreviousOutput(); check?

PHP requirement

composer require zendframework/zend-httphandlerrunner

[InvalidArgumentException]
Package zendframework/zend-httphandlerrunner at version has a PHP requirement incompatible with your PHP version (5.6.40)

composer install fails because http-message-implementaion was not found

I'm not be able to include this package in my project (server is PHP 7.2). I execute "composer require zendframework/zend-httphandlerunner" and here's the error output:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for zendframework/zend-httphandlerrunner ^1.1 -> satisfiable by zendframework/zend-httphandlerrunner[1.1.0].
    - zendframework/zend-httphandlerrunner 1.1.0 requires psr/http-message-implementation ^1.0 -> no matching package found.

Redundant status code emits?

I noticed the HTTP status code gets applied with every individual header() call:

https://github.com/zendframework/zend-httphandlerrunner/blob/master/src/Emitter/SapiEmitterTrait.php#L84-L88

But headers get emitted before the status line:

https://github.com/zendframework/zend-httphandlerrunner/blob/master/src/Emitter/SapiEmitter.php#L28-L29

And the status line gets emitted last, with the status code:

https://github.com/zendframework/zend-httphandlerrunner/blob/master/src/Emitter/SapiEmitterTrait.php#L60-L65

Any reason why it isn't enough to just apply the status code last with emitStatusLine()?

Note that this isn't an issue with the code, merely a bit of a comprehension difficulty.

I'm sure it isn't harmful to apply the status code repeatedly - but unless it's meaningful, it's probably confusing more than it is helpful to a person reading the code?

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.