try {if ($database == "master") {if (!empty($this->connections['master'])) {return true;}$this->connections['master'] = new \PDO('mysql:host=' . DATABASE_MASTER_HOST . ';dbname=' . DATABASE_MASTER_DATABASE . ";charset=utf8",DATABASE_MASTER_USERNAME,DATABASE_MASTER_PASSWORD,$databaseOptions);} else {if (!empty($this->connections["$database"])) {
SQLSTATE[HY000] [1045] Access denied for user 'admin'@'172.31.12.116' (using password: YES)
-rw-rw-r-- 1002 1002 19.21KB Oct 03 17:48 /home/users/panda/framework.panda/Panda/Database.php
try {if ($database == "master") {if (!empty($this->connections['master'])) {return true;}$this->connections['master'] = new \PDO('mysql:host=' . DATABASE_MASTER_HOST . ';dbname=' . DATABASE_MASTER_DATABASE . ";charset=utf8",DATABASE_MASTER_USERNAME,DATABASE_MASTER_PASSWORD,$databaseOptions);} else {if (!empty($this->connections["$database"])) {
if (!empty($return) && !is_array($return)) {return $return;}}$this->logQuery($database, [$query, $vars]);$this->connect($database);$prepared = $this->connections["$database"]->prepare($query);if (!$prepared) {return;}$prepared->execute($vars);$row = $prepared->fetchAll(\PDO::FETCH_ASSOC);
if (preg_match("/insert /i", $query) || preg_match("/update /i", $query) || preg_match("/replace /i", $query)) {$options['master'] = 1;}if (empty($options['master']) && empty($options['force']) && empty($options['parent'])) {return $this->single("masterReplica",$query,$vars,$options);}return $this->single("master",$query,$vars,$options);}/*** master_multi function.*
if ($ip == "localhost") {$ip = "127.0.0.1";return [];}$query = "select info from ipCache where ip = ? and timestamp > ?";$info = $this->db->master_single($query, [$ip, max(GEO_IP_UPDATE_TIME, (time() - (time() % 3600)) - 30 * 86400)], ['cached' => true]);if (!empty($info) && is_string($info)) {$info = json_decode($info, true);return $info;}
$this->mobileDetect = new \Mobile_Detect();// contry code setting$this->countryCode = null; // $_SERVER['HTTP_CF_IPCOUNTRY'] ?? $_SERVER['HTTP_X_GEO'] ?? null;$this->regionCode = null; // $_SERVER['HTTP_CF_IPREGION'] ?? $_SERVER['HTTP_X_GEO_REGION'] ?? null;if (empty($this->countryCode)) {\Panda\Template::data("setIP", $this->ip());$temp = $this->ipInfo();if (!empty($temp['country']['iso_code'])) {$this->countryCode = $temp['country']['iso_code'];}if (!empty($temp['subdivisions'][0]['iso_code'])) {$this->regionCode = $temp['subdivisions'][0]['iso_code'];}}
*/public static function init() {#echo "maintenance";#exit;if (null === self::$instance) {self::$instance = new self();# make sure this only ever happens onceself::$instance->doConstruct();}return self::$instance;}/**
* @return void*/public function __construct() {# Twig constructor moved to doProcessif (!self::$twig) {# let's set some defaults$main = \Panda\Main::init();if (!empty($main->domain)) {$this->setVar("domain", $main->domain);}if (!empty($main->primaryDomain)) {$this->setVar("primaryDomain", $main->primaryDomain);
** @access public* @static* @return the singleton copy of \Panda\Main*/public static function init() {if (null === self::$instance) {self::$instance = new self();}return self::$instance;}/**
* @return void*/public static function data($var = null, $value = null) {if (!$var) {return;}$self = \Panda\Template::init();$data = $self->getVar("data");if (empty($data)) {$data = [];}if (is_array($var)) {
if ($res['elapsed'] > 4 && php_sapi_name() !== 'cli') {if (!defined("PANDACUB") || \Panda\Template::get("viewDev") || \Panda\Template::getData("viewDev")) {// $query = "insert into randomLog(event,timestamp,data) values(?,?,?)";// $main = \Panda\Main::init();// $main->db->master_do($query, ['longrequest', microtime(true), json_encode(['server' => $_SERVER, 'fields' => \Panda\Query::fields(null, true),'debug' => $res], JSON_PRETTY_PRINT)]);}}\Panda\Template::data("pandaDebug", $res);return $res;}public static function reset($resetStart = false) {$self = \Panda\Debug::init();$self->events = [];$self->subEvent = null;
}$self->lastTime = null;}public static function log($event) {$self = \Panda\Debug::init();$self->_log($event);return $self->output();}public static function sub($event) {$self = \Panda\Debug::init();if (empty($self->events)) {return $self->_log($event);}
if ($_SERVER['SERVER_NAME'] == "api.pandacub.tech" || $_SERVER['SERVER_NAME'] == "api.cubpanda.com") {require_once(dirname(__FILE__) . "/../api.panda.tech/index.php");exit;}}require_once(dirname(__FILE__) . "/../framework.panda/loader.php");\Panda\Debug::log("ROUTER START");use \Panda\Main;use \Panda\Router;use \Panda\Template;# create main object$main = \Panda\Main::init();
<?phprequire_once(dirname(__FILE__) . "/../index.php");
-rw-rw-r-- 1002 1002 2.7KB Sep 22 09:01 /home/users/panda/router.panda.tech/index.php