Git Product home page Git Product logo

Comments (7)

xrstf avatar xrstf commented on May 25, 2024

I would suggest the more readable PHP_SAPI === 'cli' approach to check for the CLI environment. :-)
Not that I'm in charge of something here. ;-)

from sentry-php.

dcramer avatar dcramer commented on May 25, 2024

@xrstf PHP_SAPI isnt accurate in all cases (I think we used to use that)

from sentry-php.

xrstf avatar xrstf commented on May 25, 2024

Can you give an example on when PHP_SAPI is incorrect? I really can't think of any and checking for some random key in $_SERVER seems so hackish to me :-/

from sentry-php.

dcramer avatar dcramer commented on May 25, 2024

Unfortunately we seem to be awful about recording this kind of stuff, but the commit that changed it is

f27fd0a

And originally we introduced PHP_SAPI in

9fdff4b

On Wednesday, September 11, 2013 at 8:01 PM, Christoph wrote:

Can you give an example on when PHP_SAPI is incorrect? I really can't think of any and checking for some random key in $_SERVER seems so hackish to me :-/


Reply to this email directly or view it on GitHub (https://github.com/getsentry/raven-php/issues/113#issuecomment-24230936).

from sentry-php.

dcramer avatar dcramer commented on May 25, 2024

Actually whats the issue here? It's only using this to check for HTTP data AFAIK.

from sentry-php.

manavo avatar manavo commented on May 25, 2024

The problem is that checking for REQUEST_URI, doesn't guarantee that it is running from the command line. So when running a command line script, and raven catches an error, it ends up trying to reconstruct the request URL, tries to read HTTP_HOST, which in turns throws a new error (because it isn't defined).

from sentry-php.

stayallive avatar stayallive commented on May 25, 2024

Looks like this was fixed in c27fe51, if the problem persists please open a new issue.

from sentry-php.

Related Issues (20)

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.