mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -07:00
Minor improvements (#824)
This commit is contained in:
parent
9e7038c3f8
commit
a9e0a975dc
2 changed files with 9 additions and 11 deletions
|
@ -86,7 +86,7 @@ ini_set('display_startup_errors', 1); // Show startup php errors
|
||||||
define('MYSQLI_ERROR_REPORTING', MYSQLI_REPORT_ERROR); // MySQL error reporting mode | https://www.php.net/manual/mysqli-driver.report-mode.php
|
define('MYSQLI_ERROR_REPORTING', MYSQLI_REPORT_ERROR); // MySQL error reporting mode | https://www.php.net/manual/mysqli-driver.report-mode.php
|
||||||
ini_set('log_errors', 1); // php native logging
|
ini_set('log_errors', 1); // php native logging
|
||||||
ini_set('error_log', LOG_DIR . '/php_errors.log'); // path to log file enabled only if log_errors == 1 (native)
|
ini_set('error_log', LOG_DIR . '/php_errors.log'); // path to log file enabled only if log_errors == 1 (native)
|
||||||
define('WHOOPS_LOG_FILE', LOG_DIR . '/php_whoops.log'); // log file enabled only if log_errors == 1 (whoops)
|
define('WHOOPS_LOG_FILE', LOG_DIR . '/php_whoops.log'); // log file enabled only if log_errors == 1 and APP_DEBUG == true (whoops)
|
||||||
|
|
||||||
// Triggers
|
// Triggers
|
||||||
define('BB_ENABLED', TRIGGERS_DIR . '/$on');
|
define('BB_ENABLED', TRIGGERS_DIR . '/$on');
|
||||||
|
|
18
src/Dev.php
18
src/Dev.php
|
@ -43,21 +43,11 @@ class Dev
|
||||||
*/
|
*/
|
||||||
public static function initDebug(): void
|
public static function initDebug(): void
|
||||||
{
|
{
|
||||||
global $bb_cfg;
|
|
||||||
|
|
||||||
self::$envType = env('APP_ENV', 'local');
|
self::$envType = env('APP_ENV', 'local');
|
||||||
|
|
||||||
if (self::$envType === 'production') {
|
if (self::$envType === 'production') {
|
||||||
if (!$bb_cfg['bugsnag']['enabled']) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
self::getBugsnag();
|
self::getBugsnag();
|
||||||
} else {
|
} else {
|
||||||
if (!APP_DEBUG) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
self::getWhoops();
|
self::getWhoops();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,6 +61,10 @@ class Dev
|
||||||
{
|
{
|
||||||
global $bb_cfg;
|
global $bb_cfg;
|
||||||
|
|
||||||
|
if (!$bb_cfg['bugsnag']['enabled']) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$bugsnag = Client::make($bb_cfg['bugsnag']['api_key']);
|
$bugsnag = Client::make($bb_cfg['bugsnag']['api_key']);
|
||||||
Handler::register($bugsnag);
|
Handler::register($bugsnag);
|
||||||
}
|
}
|
||||||
|
@ -82,6 +76,10 @@ class Dev
|
||||||
*/
|
*/
|
||||||
private static function getWhoops(): void
|
private static function getWhoops(): void
|
||||||
{
|
{
|
||||||
|
if (!APP_DEBUG) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$whoops = new Run;
|
$whoops = new Run;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue