$this->setConnection(new mysqli(
getenv('DB_HOST'),
getenv('DB_USERNAME'),
getenv('DB_PASSWORD'),
getenv('DB_DATABASE')
));
parent::__construct();
}
//ini_set('error_log' , '/home/solomono/web/solomono.net/sites/dev/php.log');
error_reporting(E_ALL);
set_error_handler(function ($level, $message, $file = '', $line = 0) {
$this->handleError($level, $message, $file, $line);
});
set_exception_handler(function ($e) {
$this->handleException($e);
});
$this->setConnection(new mysqli(
getenv('DB_HOST'),
getenv('DB_USERNAME'),
getenv('DB_PASSWORD'),
getenv('DB_DATABASE')
));
parent::__construct();
}
*/
public static function getInstance()
{
if (!self::$instance) { // If no instance then make one
self::$instance = new self();
}
return self::$instance;
}
}
require_once __DIR__ . '/../classes/Database/Mysqli/Connector.php';
function DB(): mysqli
{
return Connector::getInstance()->getConnection();
}
function tep_db_connect()
{
$link = DB();
return Connector::getInstance()->getConnection();
}
function tep_db_connect()
{
$link = DB();
if(getenv('SET_NAMES')!=false){
$link->query("SET NAMES '".getenv('SET_NAMES')."'");
}
$link->query("SET SESSION sql_mode=''");
$timeZoneArray = explode(' ', DB_TIME_ZONE);
require_once __DIR__ . '/configure.php';
require_once __DIR__ . '/filenames.php';
require_once __DIR__ . '/database_tables.php';
require_once DIR_WS_FUNCTIONS . 'database.php';
tep_db_connect() or die('Unable to connect to database server!');
$configurations = FileCacheHelper::remember(
'config',
fn() => tep_db_query(
'select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION
define('PAGE_PARSE_START_TIME', microtime(true));
define("SECONDS_PER_WEEK", 604800);
header("Content-Security-Policy: default-src data: * 'unsafe-inline' 'unsafe-eval'; frame-ancestors 'none';");
$saveDbPrepareInput = [];
require_once __DIR__ . "/application_main.php";
//redirect to a new domain name
if(getConstantValue('DOMEN_URL','') != '' && getConstantValue('DOMEN_URL') != $_SERVER['HTTP_HOST']){
header('Location: http://' . getConstantValue('DOMEN_URL'));
exit();
}
use JsonLd\Container;
use JsonLd\Product;
use JsonLd\ProductReview;
require('includes/application_top.php');
includeLanguages(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
// define current template constants:
$productAvailable = false;
$productReviewsArr = [];
ErrorException
|
---|
ErrorException: mysqli::__construct(): (HY000/2002): Permission denied at /mnt/test_sites/sites_new/newagriservices.com/includes/classes/Database/Mysqli/Connector.php:28 at Bootstrap\HandleExceptions->handleError() (/home/solomono/web/solomono.net/sites/demo/bootstrap/HandleExceptions.php:32) at Bootstrap\HandleExceptions->Bootstrap\{closure}() at mysqli->__construct() (/mnt/test_sites/sites_new/newagriservices.com/includes/classes/Database/Mysqli/Connector.php:28) at Connector->__construct() (/mnt/test_sites/sites_new/newagriservices.com/includes/classes/Database/Mysqli/Connector.php:41) at Connector::getInstance() (/mnt/test_sites/sites_new/newagriservices.com/includes/functions/database.php:9) at DB() (/mnt/test_sites/sites_new/newagriservices.com/includes/functions/database.php:14) at tep_db_connect() (/mnt/test_sites/sites_new/newagriservices.com/includes/application_main.php:25) at require_once('/mnt/test_sites/sites_new/newagriservices.com/includes/application_main.php') (/mnt/test_sites/sites_new/newagriservices.com/includes/application_top.php:8) at require('/mnt/test_sites/sites_new/newagriservices.com/includes/application_top.php') (/mnt/test_sites/sites_new/newagriservices.com/product_info.php:8) |