From f777d037fe667353ce1723e1083deded47a42f92 Mon Sep 17 00:00:00 2001 From: Fordnox Date: Wed, 13 Jul 2022 13:36:13 +0300 Subject: [PATCH] Do not show warning about install directory if debug mode is on --- src/bb-load.php | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/bb-load.php b/src/bb-load.php index 57b26ac32..dd4fb7aa7 100644 --- a/src/bb-load.php +++ b/src/bb-load.php @@ -76,15 +76,15 @@ function handler_exception($e) } else { $page = " - + - + An error ocurred - + @@ -93,17 +93,17 @@ function handler_exception($e) -webkit-box-sizing: border-box; box-sizing: border-box; } - + body { padding: 0; margin: 0; } - + #error { position: relative; height: 100vh; } - + #error .error { position: absolute; left: 50%; @@ -112,14 +112,14 @@ function handler_exception($e) -ms-transform: translate(-50%, -50%); transform: translate(-50%, -50%); } - + .error { max-width: 560px; width: 100%; padding-left: 160px; line-height: 1.1; } - + .error .error-container { position: absolute; left: 0; @@ -130,7 +130,7 @@ function handler_exception($e) background-image: url('/bb-themes/boxbilling/assets/images/box.png'); background-size: cover; } - + .error .error-container:before { content: ''; position: absolute; @@ -143,7 +143,7 @@ function handler_exception($e) background-color: #f2f5f8; z-index: -1; } - + .error h1 { font-family: 'Nunito', sans-serif; font-size: 65px; @@ -153,7 +153,7 @@ function handler_exception($e) color: #151723; text-transform: uppercase; } - + .error h2 { font-family: 'Nunito', sans-serif; font-size: 21px; @@ -162,13 +162,13 @@ function handler_exception($e) text-transform: uppercase; color: #151723; } - + .error p { font-family: 'Nunito', sans-serif; color: #999fa5; font-weight: 400; } - + .error a { font-family: 'Nunito', sans-serif; display: inline-block; @@ -177,7 +177,7 @@ function handler_exception($e) text-decoration: none; color: #388dbc; } - + @media only screen and (max-width: 767px) { .error .error-container { width: 110px; @@ -197,7 +197,7 @@ function handler_exception($e) padding: 2px; font-size: 90%; } - + @@ -217,7 +217,7 @@ function handler_exception($e) echo sprintf('

Look for detailed error explanation

', urlencode($e->getMessage())); echo '

Powered by BoxBilling

- + '; } } @@ -265,14 +265,14 @@ function handler_exception($e) throw new Exception($msg, 101); } +$config = require_once $configPath; +require BB_PATH_VENDOR.'/autoload.php'; + // Try to check if /install directory still exists, even after the installation was completed -if (file_exists($configPath) && 0 !== filesize($configPath) && file_exists(BB_PATH_ROOT.'/install/index.php')) { +if ($config['debug'] == false && file_exists($configPath) && 0 !== filesize($configPath) && file_exists(BB_PATH_ROOT.'/install/index.php')) { throw new Exception('For safety reasons, you have to delete the /install directory to start using BoxBilling.

Please delete the /install directory from your web server.', 102); } -$config = require_once $configPath; -require BB_PATH_VENDOR.'/autoload.php'; - date_default_timezone_set($config['timezone']); define('BB_DEBUG', $config['debug']);