moved dev mode constant
This commit is contained in:
parent
10c8ab92ef
commit
c24b7d228e
@ -4,6 +4,7 @@
|
|||||||
define('LOG_WRITE_CURRENT_FILE', 'ManiaControl.log'); // Write current log to extra file in base dir
|
define('LOG_WRITE_CURRENT_FILE', 'ManiaControl.log'); // Write current log to extra file in base dir
|
||||||
define('LOG_NAME_USE_DATE', true); // Use current date as suffix for log file name in logs folder
|
define('LOG_NAME_USE_DATE', true); // Use current date as suffix for log file name in logs folder
|
||||||
define('LOG_NAME_USE_PID', true); // Use current process id as suffix for log file name in logs folder
|
define('LOG_NAME_USE_PID', true); // Use current process id as suffix for log file name in logs folder
|
||||||
|
define('DEV_MODE', false); // Development mode to not send error reports etc.
|
||||||
|
|
||||||
// Define base dir
|
// Define base dir
|
||||||
define('ManiaControlDir', __DIR__ . DIRECTORY_SEPARATOR);
|
define('ManiaControlDir', __DIR__ . DIRECTORY_SEPARATOR);
|
||||||
|
@ -58,7 +58,7 @@ class ErrorHandler {
|
|||||||
$logMessage = $message . PHP_EOL . 'Class: ' . $exceptionClass . PHP_EOL . 'Trace:' . PHP_EOL . $traceString;
|
$logMessage = $message . PHP_EOL . 'Class: ' . $exceptionClass . PHP_EOL . 'Trace:' . PHP_EOL . $traceString;
|
||||||
$this->maniaControl->log($logMessage);
|
$this->maniaControl->log($logMessage);
|
||||||
|
|
||||||
if (!ManiaControl::DEV_MODE) {
|
if (!DEV_MODE) {
|
||||||
$error = array();
|
$error = array();
|
||||||
$error['Type'] = 'Exception';
|
$error['Type'] = 'Exception';
|
||||||
$error['Message'] = $message;
|
$error['Message'] = $message;
|
||||||
@ -224,7 +224,7 @@ class ErrorHandler {
|
|||||||
}
|
}
|
||||||
$this->maniaControl->log($logMessage);
|
$this->maniaControl->log($logMessage);
|
||||||
|
|
||||||
if (!ManiaControl::DEV_MODE && !$userError && !$suppressed) {
|
if (!DEV_MODE && !$userError && !$suppressed) {
|
||||||
$error = array();
|
$error = array();
|
||||||
$error['Type'] = 'Error';
|
$error['Type'] = 'Error';
|
||||||
$error['Message'] = $message;
|
$error['Message'] = $message;
|
||||||
@ -335,7 +335,7 @@ class ErrorHandler {
|
|||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
private function shouldStopExecution($errorNumber) {
|
private function shouldStopExecution($errorNumber) {
|
||||||
return ($errorNumber & E_ERROR || $errorNumber & E_USER_ERROR || $errorNumber & E_FATAL);
|
return ($errorNumber & E_FATAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,7 +53,6 @@ class ManiaControl implements CommandListener, TimerListener {
|
|||||||
const OS_UNIX = 'Unix';
|
const OS_UNIX = 'Unix';
|
||||||
const OS_WIN = 'Windows';
|
const OS_WIN = 'Windows';
|
||||||
const SCRIPT_TIMEOUT = 10;
|
const SCRIPT_TIMEOUT = 10;
|
||||||
const DEV_MODE = false;
|
|
||||||
const URL_WEBSERVICE = 'http://ws.maniacontrol.com/';
|
const URL_WEBSERVICE = 'http://ws.maniacontrol.com/';
|
||||||
const SETTING_PERMISSION_SHUTDOWN = 'Shutdown ManiaControl';
|
const SETTING_PERMISSION_SHUTDOWN = 'Shutdown ManiaControl';
|
||||||
const SETTING_PERMISSION_RESTART = 'Restart ManiaControl';
|
const SETTING_PERMISSION_RESTART = 'Restart ManiaControl';
|
||||||
|
@ -46,7 +46,7 @@ class UsageReporter implements TimerListener {
|
|||||||
* @param float $time
|
* @param float $time
|
||||||
*/
|
*/
|
||||||
public function reportUsage($time) {
|
public function reportUsage($time) {
|
||||||
if (ManiaControl::DEV_MODE || !$this->maniaControl->settingManager->getSettingValue($this, self::SETTING_REPORT_USAGE)) {
|
if (DEV_MODE || !$this->maniaControl->settingManager->getSettingValue($this, self::SETTING_REPORT_USAGE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user