$this->statement = $connection->prepare($query); if (!$this->statement) { throw new PrepareStatementFailureException($this->connection->error, $this->connection->errno); } } /** * Replace named parameters with numbered parameters * @since 2.0.0 * @throws PrepareStatementFailureException */ protected function prepareStatement(string $query): StatementInterface { return new MysqliStatement($this->connection, $query); } /** * Unlocks tables in the database. * $query->setLimit($limit, $offset); $sql = $this->replacePrefix((string) $query); $this->statement = $this->prepareStatement($sql); $this->sql = $query; $this->limit = (int) max(0, $limit); $this->offset = (int) max(0, $offset); $query = $db->getQuery(true) ->select($db->quoteName(['id', 'rules'])) ->from($db->quoteName('#__viewlevels')); // Set the query for execution. $db->setQuery($query); // Build the view levels array. foreach ($db->loadAssocList() as $level) { self::$viewLevels[$level['id']] = (array) json_decode($level['rules']); } if ($this->_authLevels === null) { $this->_authLevels = []; } if (empty($this->_authLevels)) { $this->_authLevels = Access::getAuthorisedViewLevels($this->id); } return $this->_authLevels; } */ public static function getModuleList() { $app = Factory::getApplication(); $itemId = $app->getInput()->getInt('Itemid', 0); $groups = $app->getIdentity()->getAuthorisedViewLevels(); $clientId = (int) $app->getClientId(); // Build a cache ID for the resulting data object $cacheId = implode(',', $groups) . '.' . $clientId . '.' . $itemId; $app->triggerEvent('onPrepareModuleList', [&$modules]); // If the onPrepareModuleList event returns an array of modules, then ignore the default module list creation if (!\is_array($modules)) { $modules = static::getModuleList(); } $app->triggerEvent('onAfterModuleList', [&$modules]); $modules = static::cleanModuleList($modules); public static function &getModules($position) { $position = strtolower($position); $result = []; $input = Factory::getApplication()->getInput(); $modules = &static::load(); $total = \count($modules); for ($i = 0; $i < $total; $i++) { if ($modules[$i]->position === $position) { $result[] = &$modules[$i]; $app = Factory::getApplication(); $user = Factory::getUser(); $frontediting = ($app->isClient('site') && $app->get('frontediting', 1) && !$user->guest); $menusEditing = ($app->get('frontediting', 1) == 2) && $user->authorise('core.edit', 'com_menus'); foreach (ModuleHelper::getModules($position) as $mod) { $moduleHtml = $renderer->render($mod, $params, $content); if ($frontediting && trim($moduleHtml) != '' && $user->authorise('module.edit.frontend', 'com_modules.module.' . $mod->id)) { $displayData = ['moduleHtml' => &$moduleHtml, 'module' => $mod, 'position' => $position, 'menusediting' => $menusEditing]; LayoutHelper::render('joomla.edit.frontediting_modules', $displayData); $cbuffer[$hash] = $tmpdata; $cache->store($cbuffer, 'cbuffer_' . $type); } else { $this->setBuffer($renderer->render($name, $attribs, null), $type, $name, $title); } return parent::$_buffer[$type][$name][$title]; } $replace = []; $with = []; foreach ($this->_template_tags as $jdoc => $args) { $replace[] = $jdoc; $with[] = $this->getBuffer($args['type'], $args['name'], $args['attribs']); } return str_replace($replace, $with, $this->_template); }} if (\array_key_exists('csp_nonce', $params) && $params['csp_nonce'] !== null) { $this->cspNonce = $params['csp_nonce']; } $data = $this->_renderTemplate(); parent::render($caching, $params); return $data; } $this->debug = $params['debug'] ?? false; $this->error = $this->_error; $params['file'] = 'error.php'; return parent::render($cache, $params); } /** * Render the backtrace * 'template' => $template->template, 'directory' => JPATH_THEMES, 'debug' => JDEBUG, 'csp_nonce' => $app->get('csp_nonce'), 'templateInherits' => $template->parent, 'params' => $template->params, ] ); }} // Reset the document object in the factory, this gives us a clean slate and lets everything render properly Factory::$document = $renderer->getDocument(); Factory::getApplication()->loadDocument(Factory::$document); $data = $renderer->render($error); // If nothing was rendered, just use the message from the Exception if (empty($data)) { $data = $error->getMessage(); } * @since 3.10.0 */ public static function handleException(\Throwable $error) { static::logException($error); static::render($error); } /** * Render the error page based on an exception. * ); // Trigger the onError event. $this->triggerEvent('onError', $event); ExceptionHandler::handleException($event->getError()); } // Trigger the onBeforeRespond event. $this->getDispatcher()->dispatch('onBeforeRespond');// Set the application as global app\Joomla\CMS\Factory::$application = $app;// Execute the application.$app->execute(); * define() is used rather than "const" to not error for PHP 5.2 and lower */define('_JEXEC', 1);// Run the application - All executable code should be triggered through this filerequire_once dirname(__FILE__) . '/includes/app.php'; $connectionFlags ); if (!$connected) { throw new ConnectionFailureException( 'Could not connect to database: ' . $this->connection->connect_error, $this->connection->connect_errno ); } * @since 1.0 * @throws \InvalidArgumentException */ public function setQuery($query, $offset = 0, $limit = 0) { $this->connect(); $this->freeResult(); if (\is_string($query)) { $query = $db->getQuery(true) ->select($db->quoteName(['id', 'rules'])) ->from($db->quoteName('#__viewlevels')); // Set the query for execution. $db->setQuery($query); // Build the view levels array. foreach ($db->loadAssocList() as $level) { self::$viewLevels[$level['id']] = (array) json_decode($level['rules']); } if ($this->_authLevels === null) { $this->_authLevels = []; } if (empty($this->_authLevels)) { $this->_authLevels = Access::getAuthorisedViewLevels($this->id); } return $this->_authLevels; } { if (static::$plugins !== null) { return static::$plugins; } $levels = Factory::getUser()->getAuthorisedViewLevels(); /** @var \Joomla\CMS\Cache\Controller\CallbackController $cache */ $cache = Factory::getCache('com_plugins', 'callback'); $loader = function () use ($levels) { * @since 1.5 */ public static function getPlugin($type, $plugin = null) { $result = []; $plugins = static::load(); // Find the correct plugin(s) to return. if (!$plugin) { foreach ($plugins as $p) { // Is this the right plugin? if ($user->guest) { $guestUsergroup = ComponentHelper::getParams('com_users')->get('guest_usergroup', 1); $user->groups = [$guestUsergroup]; } if ($plugin = PluginHelper::getPlugin('system', 'languagefilter')) { $pluginParams = new Registry($plugin->params); $this->setLanguageFilter(true); $this->setDetectBrowser($pluginParams->get('detect_browser', 1) == 1); } * @since 3.2 */ protected function doExecute() { // Initialise the application $this->initialiseApp(); // Mark afterInitialise in the profiler. JDEBUG ? $this->profiler->mark('afterInitialise') : null; // Route the application $this->sanityCheckSystemVariables(); $this->setupLogging(); $this->createExtensionNamespaceMap(); // Perform application routines. $this->doExecute(); // If we have an application document object, render it. if ($this->document instanceof \Joomla\CMS\Document\Document) { // Render the application output. $this->render();// Set the application as global app\Joomla\CMS\Factory::$application = $app;// Execute the application.$app->execute(); * define() is used rather than "const" to not error for PHP 5.2 and lower */define('_JEXEC', 1);// Run the application - All executable code should be triggered through this filerequire_once dirname(__FILE__) . '/includes/app.php';|
[2/2]
PrepareStatementFailureException
|
|---|
Joomla\Database\Exception\PrepareStatementFailureException:
Can't connect to local server through socket '/var/lib/mysql/mysql.sock' (111)
at /home4/cbalicom/public_html/libraries/vendor/joomla/database/src/Mysqli/MysqliStatement.php:141
at Joomla\Database\Mysqli\MysqliStatement->__construct(object(mysqli), 'SELECT `id`,`rules`FROM `j25_viewlevels`')
(/home4/cbalicom/public_html/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:1089)
at Joomla\Database\Mysqli\MysqliDriver->prepareStatement('SELECT `id`,`rules`FROM `j25_viewlevels`')
(/home4/cbalicom/public_html/libraries/vendor/joomla/database/src/DatabaseDriver.php:1900)
at Joomla\Database\DatabaseDriver->setQuery(object(MysqliQuery))
(/home4/cbalicom/public_html/libraries/src/Access/Access.php:952)
at Joomla\CMS\Access\Access::getAuthorisedViewLevels(0)
(/home4/cbalicom/public_html/libraries/src/User/User.php:445)
at Joomla\CMS\User\User->getAuthorisedViewLevels()
(/home4/cbalicom/public_html/libraries/src/Helper/ModuleHelper.php:394)
at Joomla\CMS\Helper\ModuleHelper::getModuleList()
(/home4/cbalicom/public_html/libraries/src/Helper/ModuleHelper.php:373)
at Joomla\CMS\Helper\ModuleHelper::load()
(/home4/cbalicom/public_html/libraries/src/Helper/ModuleHelper.php:88)
at Joomla\CMS\Helper\ModuleHelper::getModules('debug')
(/home4/cbalicom/public_html/libraries/src/Document/Renderer/Html/ModulesRenderer.php:49)
at Joomla\CMS\Document\Renderer\Html\ModulesRenderer->render('debug', array('name' => 'debug', 'style' => 'none'), null)
(/home4/cbalicom/public_html/libraries/src/Document/HtmlDocument.php:565)
at Joomla\CMS\Document\HtmlDocument->getBuffer('modules', 'debug', array('name' => 'debug', 'style' => 'none'))
(/home4/cbalicom/public_html/libraries/src/Document/HtmlDocument.php:833)
at Joomla\CMS\Document\HtmlDocument->_renderTemplate()
(/home4/cbalicom/public_html/libraries/src/Document/HtmlDocument.php:637)
at Joomla\CMS\Document\HtmlDocument->render(false, array('template' => 'shaper_helixultimate', 'directory' => '/home4/cbalicom/public_html/templates', 'debug' => false, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php'))
(/home4/cbalicom/public_html/libraries/src/Document/ErrorDocument.php:139)
at Joomla\CMS\Document\ErrorDocument->render(false, array('template' => 'shaper_helixultimate', 'directory' => '/home4/cbalicom/public_html/templates', 'debug' => false, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php'))
(/home4/cbalicom/public_html/libraries/src/Error/Renderer/HtmlRenderer.php:78)
at Joomla\CMS\Error\Renderer\HtmlRenderer->render(object(ConnectionFailureException))
(/home4/cbalicom/public_html/libraries/src/Exception/ExceptionHandler.php:126)
at Joomla\CMS\Exception\ExceptionHandler::render(object(ConnectionFailureException))
(/home4/cbalicom/public_html/libraries/src/Exception/ExceptionHandler.php:72)
at Joomla\CMS\Exception\ExceptionHandler::handleException(object(ConnectionFailureException))
(/home4/cbalicom/public_html/libraries/src/Application/CMSApplication.php:322)
at Joomla\CMS\Application\CMSApplication->execute()
(/home4/cbalicom/public_html/includes/app.php:61)
at require_once('/home4/cbalicom/public_html/includes/app.php')
(/home4/cbalicom/public_html/index.php:32)
|
|
[1/2]
ConnectionFailureException
|
|---|
Joomla\Database\Exception\ConnectionFailureException:
Could not connect to database: Can't connect to local server through socket '/var/lib/mysql/mysql.sock' (111)
at /home4/cbalicom/public_html/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:321
at Joomla\Database\Mysqli\MysqliDriver->connect()
(/home4/cbalicom/public_html/libraries/vendor/joomla/database/src/DatabaseDriver.php:1854)
at Joomla\Database\DatabaseDriver->setQuery(object(MysqliQuery))
(/home4/cbalicom/public_html/libraries/src/Access/Access.php:952)
at Joomla\CMS\Access\Access::getAuthorisedViewLevels(0)
(/home4/cbalicom/public_html/libraries/src/User/User.php:445)
at Joomla\CMS\User\User->getAuthorisedViewLevels()
(/home4/cbalicom/public_html/libraries/src/Plugin/PluginHelper.php:258)
at Joomla\CMS\Plugin\PluginHelper::load()
(/home4/cbalicom/public_html/libraries/src/Plugin/PluginHelper.php:109)
at Joomla\CMS\Plugin\PluginHelper::getPlugin('system', 'languagefilter')
(/home4/cbalicom/public_html/libraries/src/Application/SiteApplication.php:570)
at Joomla\CMS\Application\SiteApplication->initialiseApp()
(/home4/cbalicom/public_html/libraries/src/Application/SiteApplication.php:226)
at Joomla\CMS\Application\SiteApplication->doExecute()
(/home4/cbalicom/public_html/libraries/src/Application/CMSApplication.php:293)
at Joomla\CMS\Application\CMSApplication->execute()
(/home4/cbalicom/public_html/includes/app.php:61)
at require_once('/home4/cbalicom/public_html/includes/app.php')
(/home4/cbalicom/public_html/index.php:32)
|