-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't use server variables in CLI mode #939
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Find below some comments to simplify the if-statements.
lib/Exceptions.php
Outdated
. $_SERVER['QUERY_STRING'] | ||
. "`\nVersion: `" | ||
. "`\nQuery string: `"; | ||
if (isset($_SERVER['QUERY_STRING'])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be a one line if-statement like this (keep the rest like before):
. isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : ''
// Build a GitHub compatible message
$body = 'Error message: `'
. $e->getMessage()
. "`\nQuery string: `"
. (isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '')
. "`\nVersion: `"
. Configuration::getVersion()
. '`';
index.php
Outdated
if (isset($_SERVER['REQUEST_URI'])) | ||
$item['uri'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); | ||
else | ||
$item['uri'] = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can also be a one line if-statement:
$item['uri'] = (isset($_SERVER['REQUEST_URI']) ? parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) : '')
. '?' . http_build_query($params);
Merged, thanks! |
No description provided.