core: Don't use server variables in CLI mode (#939)
This commit is contained in:
parent
6e9c188a72
commit
263e8872ea
2 changed files with 7 additions and 4 deletions
|
@ -260,7 +260,8 @@ try {
|
||||||
$item['title'] = 'Bridge returned error ' . $e->getCode() . '! (' . $params['_error_time'] . ')';
|
$item['title'] = 'Bridge returned error ' . $e->getCode() . '! (' . $params['_error_time'] . ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
$item['uri'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) . '?' . http_build_query($params);
|
$item['uri'] = (isset($_SERVER['REQUEST_URI']) ? parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) : '')
|
||||||
|
. '?' . http_build_query($params);
|
||||||
$item['timestamp'] = time();
|
$item['timestamp'] = time();
|
||||||
$item['content'] = buildBridgeException($e, $bridge);
|
$item['content'] = buildBridgeException($e, $bridge);
|
||||||
|
|
||||||
|
@ -273,7 +274,8 @@ try {
|
||||||
// Create "new" error message every 24 hours
|
// Create "new" error message every 24 hours
|
||||||
$params['_error_time'] = urlencode((int)(time() / 86400));
|
$params['_error_time'] = urlencode((int)(time() / 86400));
|
||||||
|
|
||||||
$item['uri'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) . '?' . http_build_query($params);
|
$item['uri'] = (isset($_SERVER['REQUEST_URI']) ? parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) : '')
|
||||||
|
. '?' . http_build_query($params);
|
||||||
$item['title'] = 'Bridge returned error ' . $e->getCode() . '! (' . $params['_error_time'] . ')';
|
$item['title'] = 'Bridge returned error ' . $e->getCode() . '! (' . $params['_error_time'] . ')';
|
||||||
$item['timestamp'] = time();
|
$item['timestamp'] = time();
|
||||||
$item['content'] = buildBridgeException($e, $bridge);
|
$item['content'] = buildBridgeException($e, $bridge);
|
||||||
|
|
|
@ -77,7 +77,7 @@ function buildBridgeException($e, $bridge){
|
||||||
$body = 'Error message: `'
|
$body = 'Error message: `'
|
||||||
. $e->getMessage()
|
. $e->getMessage()
|
||||||
. "`\nQuery string: `"
|
. "`\nQuery string: `"
|
||||||
. $_SERVER['QUERY_STRING']
|
. (isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '')
|
||||||
. "`\nVersion: `"
|
. "`\nVersion: `"
|
||||||
. Configuration::getVersion()
|
. Configuration::getVersion()
|
||||||
. '`';
|
. '`';
|
||||||
|
@ -116,7 +116,8 @@ function buildTransformException($e, $bridge){
|
||||||
$body = 'Error message: `'
|
$body = 'Error message: `'
|
||||||
. $e->getMessage()
|
. $e->getMessage()
|
||||||
. "`\nQuery string: `"
|
. "`\nQuery string: `"
|
||||||
. $_SERVER['QUERY_STRING'] . '`';
|
. (isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '')
|
||||||
|
. '`';
|
||||||
|
|
||||||
$link = buildGitHubIssueQuery($title, $body, 'bug report', $bridge->getMaintainer());
|
$link = buildGitHubIssueQuery($title, $body, 'bug report', $bridge->getMaintainer());
|
||||||
$header = buildHeader($e, $bridge);
|
$header = buildHeader($e, $bridge);
|
||||||
|
|
Loading…
Reference in a new issue