getCode().'] occurred in ['.$e->getFile().'] at line ['.$e->getLine().']: ['.trim(strip_tags($e->getMessage())).']'; } else { if (APPLICATION_ENV == 'testing') { echo $e->getMessage().PHP_EOL; return; } error_log($e->getMessage()); if (defined('BB_MODE_API')) { $code = $e->getCode() ? $e->getCode() : 9998; $result = ['result' => null, 'error' => ['message' => $e->getMessage(), 'code' => $code]]; echo json_encode($result); return false; } if (defined('BB_DEBUG') && BB_DEBUG && file_exists(BB_PATH_VENDOR)) { /** * If advanced debugging is enabled, print Whoops instead of our error page. * flip/whoops documentation: https://github.com/filp/whoops/blob/master/docs/API%20Documentation.md. */ $whoops = new \Whoops\Run(); $prettyPage = new \Whoops\Handler\PrettyPageHandler(); $prettyPage->setPageTitle('An error ocurred'); $prettyPage->addDataTable('FOSSBilling environment', [ 'PHP Version' => phpversion(), 'Error code' => $e->getCode(), ]); $whoops->pushHandler($prettyPage); $whoops->allowQuit(false); $whoops->writeToOutput(false); echo $whoops->handleException($e); } else { $page = "
%s
', $e->getMessage()); echo sprintf('Powered by FOSSBilling
composer install\" in order to install them. For detailed instruction, you can see Composer's getting started guide.Please use the example config as reference here. You may need to manually restore a old config file or fix your existing one.
"); throw new Exception($msg, 101); } // 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')) { throw new Exception('For safety reasons, you have to delete the /install directory to start using FOSSBilling.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']); define('BB_URL', $config['url']); define('BB_SEF_URLS', $config['sef_urls']); define('BB_PATH_CACHE', $config['path_data'].'/cache'); define('BB_PATH_LOG', $config['path_data'].'/log'); define('BB_SSL', ('https' === substr($config['url'], 0, 5))); if ($config['sef_urls']) { define('BB_URL_API', $config['url'].'api/'); } else { define('BB_URL_API', $config['url'].'index.php?_url=/api/'); } if ($config['debug']) { error_reporting(E_ALL); ini_set('display_errors', '1'); ini_set('display_startup_errors', '1'); } else { error_reporting(E_RECOVERABLE_ERROR); ini_set('display_errors', '0'); ini_set('display_startup_errors', '0'); } ini_set('log_errors', '1'); ini_set('html_errors', false); ini_set('error_log', BB_PATH_LOG.'/php_error.log');