mysqli::__construct(): (HY000/2002): Connection refused
/mnt/devel/Atrium/atriumstudio/vendor/Onion/Database/MySQL.php
http://www.atriumarchitekti.loc/en/cookies (GET)
Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0
209 }210211 /**212 * Pripojenie k databázovému serveru213 *214 * @return void215 */216 private function connect()217 {218 $hash = sha1($this->host.$this->user.$this->password.$this->database);219220 if (isset($this->connections[$hash]) === true) {221 $this->mysqli = $this->connections[$hash];222223 if (@$this->mysqli->ping() === true) {224 return;225 }226 }227228 $mysqli = new \mysqli($this->host, $this->user, $this->password, $this->database, $this->port, $this->socket);229230 if ($mysqli->connect_error === false) {231 throw new \Onion\Database\DatabaseException($mysqli->connect_error, $mysqli->connect_errno);232 }233234 if ($mysqli->set_charset('utf8') === false) {235 throw new \Onion\Database\DatabaseException($mysqli->connect_error, $mysqli->connect_errno);236 }237238 $this->mysqli = $mysqli;
209 }210211 /**212 * Pripojenie k databázovému serveru213 *214 * @return void215 */216 private function connect()217 {218 $hash = sha1($this->host.$this->user.$this->password.$this->database);219220 if (isset($this->connections[$hash]) === true) {221 $this->mysqli = $this->connections[$hash];222223 if (@$this->mysqli->ping() === true) {224 return;225 }226 }227228 $mysqli = new \mysqli($this->host, $this->user, $this->password, $this->database, $this->port, $this->socket);229230 if ($mysqli->connect_error === false) {231 throw new \Onion\Database\DatabaseException($mysqli->connect_error, $mysqli->connect_errno);232 }233234 if ($mysqli->set_charset('utf8') === false) {235 throw new \Onion\Database\DatabaseException($mysqli->connect_error, $mysqli->connect_errno);236 }237238 $this->mysqli = $mysqli;
array ( 0 => '127.0.0.1', 1 => 'web', 2 => 'webpasswd', 3 => 'atrium', 4 => '3306', 5 => '', )
233234 if ($mysqli->set_charset('utf8') === false) {235 throw new \Onion\Database\DatabaseException($mysqli->connect_error, $mysqli->connect_errno);236 }237238 $this->mysqli = $mysqli;239240 $this->connections[$hash] = $mysqli;241 }242243 /**244 * Nastavenie mena tabuľky s ktorou sa bude pracovať a nastavenie jej väzieb245 * s inými tabuľkami a jej stĺpcov a zresetovanie ostatných parametrov objektu246 *247 * @param string meno tabuľky248 * @return object Database pre fluent interface249 */250 public function table($table)251 {252 $this->connect();253254 $this->table = $table;255256 if ($this->relations === null) {257 $this->relations = $this->getRelations();258 }259260 if (isset($this->relations[$table]) === true) {261 $this->tableRelations = $this->relations[$table];262
array ( )
23 namespace onionCMS\Core\Libs;45 class Configuration6 {7 private $db;8910 private $keys;111213 private $indexModuleGroupKey = array();141516 public function __construct($db)17 {18 $this->db = $db;1920 $this->keys = $this->db21 ->table('configuration')22 ->orderBy('module', 'ASC')23 ->orderBy('group', 'ASC')24 ->orderBy('order', 'ASC')25 ->columns(26 'module as module_id',27 'module.name as module',28 'group',29 'key',30 'value',31 'type',
array ( 0 => 'configuration', )
51 $arg = $this->services->getService($parts[0]);52 if (count($parts) > 1) {53 eval('$arg = $arg->'.$parts[1].';');54 }55 } elseif (substr($dep, 0, 8) === 'factory@') {56 $arg = $this->services->getService($dep);5758 } else {59 $arg = $dep;60 }61 $arguments[] = $arg;62 } else {63 $arguments[] = $dep;64 }65 }6667 if (method_exists($this->class, '__construct') === false) {68 $object = new $this->class;69 } else {70 $object = $rc->newInstanceArgs($arguments);71 }7273 foreach ($this->properties as $property => $value) {74 if ($dep instanceof ServiceBuilder) {75 $value = $value->create();7677 } elseif (is_string($value) === true) {78 if (isset($dep[0]) === true79 AND $dep[0] === '@') {80
array ( 0 => array ( 0 => 'object (Onion\\Database\\MySQL)', ), )
69 }707172 public function getService($name, $deps = null)73 {74 if (substr($name, 0, 8) === 'factory@') {75 $name = substr($name, 8);76 return $this->factory[$name];77 }7879 if (isset($this->objects[$name]) === false) {80 throw new \InvalidArgumentException('Service "'.$name.'" is not registered!');81 }8283 if (is_array($deps) === true) {84 return call_user_func_array(array($this->factory[$name], 'create'), $deps);85 }8687 if ($this->objects[$name] instanceof \Onion\DI\Factory) {88 $this->objects[$name] = $this->objects[$name]->create();89 }9091 return $this->objects[$name];92 }939495 public function serviceExists($name)96 {97 return isset($this->objects[$name]);98 }
array ( )
84 return call_user_func_array(array($this->factory[$name], 'create'), $deps);85 }8687 if ($this->objects[$name] instanceof \Onion\DI\Factory) {88 $this->objects[$name] = $this->objects[$name]->create();89 }9091 return $this->objects[$name];92 }939495 public function serviceExists($name)96 {97 return isset($this->objects[$name]);98 }99100101 public function __get($name)102 {103 return $this->getService($name);104 }105 }
array ( 0 => 'configuration', )
402403 $_SESSION['logged_as_admin'] = true;404 }405406 if ($this->app->user->isLoggedIn() === false407 or $this->app->user->isInGroup($this->app->currentRoute->groups) === false) {408409 $this->app->actionName = 'form';410 if ($this->isAdminUrl === true) {411 $this->app->controllerName = '\onionCMS\Core\Controllers\AdminLoginController';412 } else {413 $this->app->controllerName = 'Login';414 }415 }416 }417418419 public function loadConfiguration()420 {421 foreach ($this->services->configuration->getKeys() as $key) {422 $i = array();423 $i[] = strtolower($key['module']);424 if (empty($key['group']) === false) {425 $i[] = $key['group'];426 }427 $i[] = $key['key'];428 $i = implode('.', $i);429430 $this->app->configuration[$i] = $key['value'];431 }
array ( 0 => 'configuration', )
23 public $commonAssets;2425 public $printAssets;2627 public $modulesLibs = array();2829 public function __construct($services)30 {31 $this->services = $services;32 $this->app = $services->app;3334 $this->cache = $services->cache;3536 spl_autoload_register(array($this, 'loader'));37 }383940 public function init()41 {42 $this->loadConfiguration();4344 // Nastavenie hlavičky pre IE45 $this->app->response->addHeader('X-UA-Compatible', 'IE=edge,chrome=1');4647 $this->languages = $this->services->db48 ->table('languages')49 ->where('show', true)50 ->select()51 ->fetchAssoc('code');52
array ( )
392393 if ($hook[0][0] === '@') {394 $serviceName = substr($hook[0], 1);395 $hook[0] = $this->container->$serviceName;396397 } else {398 $hook[0] = new $hook[0]($this);399 }400 }401402 $parameters = (array) $this->parameters;403 if (empty($hook[2]) === false) {404 $parameters = array_merge((array) $hook[2], $parameters);405 }406407 if (is_string($hook) === true) {408 call_user_func_array($hook, $parameters);409410 } else {411 call_user_func_array(array($hook[0], $hook[1]), $parameters);412 }413 }414 }415416417 /**418 * Presmerovanie požiadavky419 *420 * @param string|null adresa kam presmerovať, ak je null presmeruje sa na aktuálnu adresu421 * @param int HTTP kód
array ( 0 => array ( 0 => 'object (onionCMS\\Core\\Libs\\onionCMS)', 1 => 'init', ), 1 => array ( ), )
99 $this->container->addService('router', '\Onion\Application\Router', array($this->request, $routeFactory));100 $this->router = $this->container->getFactory('router')->create();101102 $this->configure($configuration);103 $this->container->addService('app', $this);104105 $escape = new \Onion\Templating\Escape;106 $this->container->addService('escape', $escape);107 $view = new \Onion\Templating\View($this->container);108 $this->container->addService('view', $view);109110 $this->container->addServices($configuration['system.services']);111 }112113 /**114 * Spustenie aplikácie115 */116 public function run()117 {118 $this->runHooks('system.hooks.onStart');119120 $this->currentRoute = $this->router->findCurrentRoute();121122 if ($this->currentRoute === null) {123 $this->notFound('Not found!');124 }125126 $this->startSession();127128 $this->runHooks('system.hooks.beforeCreateController');
array ( 0 => array ( 0 => array ( 0 => '\\Utils\\Importer', 1 => 'init', ), 1 => array ( 0 => '@onionCMS', 1 => 'init', ), ), )
132 WWW_DIR.'/js/vendor/cookie.js',133 WWW_DIR.'/js/vendor/scroll-top.js',134 ),135 'less' => array(136 )137 ),138 'after' => array(139 'js' => array(140 WWW_DIR.'/js/main.js',141 ),142 'less' => array(143 WWW_DIR.'/less/main.less'144 )145 )146 )147 );148149 $app = new \Onion\Application($configuration);150151 $app->run();152 exit;
array ( )
13 // absolute filesystem path to the libraries14 define('LIBS_DIR', realpath(WWW_DIR.'/../vendor'));1516 // absolute filesystem path to the web root17 define('ONION_DIR', LIBS_DIR.'/Onion');1819 // absolute filesystem path to the application root20 define('APP_DIR', WWW_DIR.'/../app');2122 // absolute filesystem path to the temporary files23 define('TEMP_DIR', realpath(WWW_DIR.'/../temp'));2425 // absolute filesystem path to the cache26 define('CACHE_DIR', realpath(WWW_DIR.'/../cache'));2728 define('ONIONCMS_DIR', realpath(ONION_DIR.'/../onionCMS'));2930 // load bootstrap file31 if ($_SERVER["SERVER_ADDR"] === "127.0.0.1") {32 require ONIONCMS_DIR.'/bootstrap.dev.php';33 } else {34 require ONIONCMS_DIR.'/bootstrap.php';35 }
array ( 0 => '/mnt/devel/Atrium/atriumstudio/vendor/onionCMS/bootstrap.dev.php', )
array ( 'REDIRECT_STATUS' => '200', 'HTTP_HOST' => 'www.atriumarchitekti.loc', 'HTTP_USER_AGENT' => 'Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0', 'HTTP_ACCEPT' => '*/*', 'HTTP_ACCEPT_LANGUAGE' => 'sk,cs;q=0.8,en-US;q=0.5,en;q=0.3', 'HTTP_ACCEPT_ENCODING' => 'gzip, deflate', 'HTTP_CONNECTION' => 'keep-alive', 'HTTP_PRIORITY' => 'u=4', 'PATH' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'SERVER_SIGNATURE' => '<address>Apache/2.4.38 (Debian) Server at www.atriumarchitekti.loc Port 80</address> ', 'SERVER_SOFTWARE' => 'Apache/2.4.38 (Debian)', 'SERVER_NAME' => 'www.atriumarchitekti.loc', 'SERVER_ADDR' => '127.0.0.1', 'SERVER_PORT' => '80', 'REMOTE_ADDR' => '127.0.0.1', 'DOCUMENT_ROOT' => '/mnt/devel/Atrium/atriumstudio/www_root', 'REQUEST_SCHEME' => 'http', 'CONTEXT_PREFIX' => '', 'CONTEXT_DOCUMENT_ROOT' => '/mnt/devel/Atrium/atriumstudio/www_root', 'SERVER_ADMIN' => 'webmaster@localhost', 'SCRIPT_FILENAME' => '/mnt/devel/Atrium/atriumstudio/www_root/index.php', 'REMOTE_PORT' => '50050', 'REDIRECT_URL' => '/en/cookies', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'REQUEST_METHOD' => 'GET', 'QUERY_STRING' => '', 'REQUEST_URI' => '/en/cookies', 'SCRIPT_NAME' => '/index.php', 'PHP_SELF' => '/index.php', 'REQUEST_TIME_FLOAT' => 1728626655.372, 'REQUEST_TIME' => 1728626655, )