Comments (7)
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.
@xrstf PHP_SAPI isnt accurate in all cases (I think we used to use that)
from sentry-php.
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.
Unfortunately we seem to be awful about recording this kind of stuff, but the commit that changed it is
And originally we introduced PHP_SAPI in
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.
Actually whats the issue here? It's only using this to check for HTTP data AFAIK.
from sentry-php.
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.
Looks like this was fixed in c27fe51, if the problem persists please open a new issue.
from sentry-php.
Related Issues (20)
- Allow Symfony 7 HOT 3
- ModuleIntegration: High memory usage HOT 10
- Can't chain `TransactionContext/SpanContext`
- Symfony/Options-resolver issue when Sentry will be initialized HOT 5
- [doc] "ignore" configuration options are missing in doc HOT 1
- Stack traces are missing variadic and not declared arguments HOT 8
- Support for OpenTelemetry HOT 4
- Log entry context parsed incorrectly HOT 3
- Logger tag is missing HOT 3
- @internal marked classes is inaccessible from another namespaces HOT 4
- Document array shapes for parameters and complex `array` structures?
- SpotlightJS - override URL/port for sidecar
- Profiling/Performance not recorded HOT 4
- PHP7 compatibility HOT 5
- Add SAPI used to events
- Add a way to cleanup error and exception handlers HOT 7
- Improve debugging experience
- Add support for `AWS_LAMBDA_FUNCTION_VERSION` env var
- [3.x] Symfony HTTP Client in transport silently upgrades to HTTP/2 and makes HttpTransport fail HOT 1
- Possibility to implement memory limit/hooks for cli / infinite commands HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-php.