[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_admin/postinstall/ -> languageaccess340.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_admin
   6   *
   7   * @copyright   (C) 2015 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   *
  10   * This file contains post-installation message handling for the checks if the installation is
  11   * affected by the issue with content languages access in 3.4.0
  12   */
  13  
  14  use Joomla\CMS\Factory;
  15  
  16  // phpcs:disable PSR1.Files.SideEffects
  17  \defined('_JEXEC') or die;
  18  // phpcs:enable PSR1.Files.SideEffects
  19  
  20  /**
  21   * Checks if the installation is affected by the issue with content languages access in 3.4.0
  22   *
  23   * @link    https://github.com/joomla/joomla-cms/pull/6172
  24   * @link    https://github.com/joomla/joomla-cms/pull/6194
  25   *
  26   * @return  boolean
  27   *
  28   * @since   3.4.1
  29   */
  30  function admin_postinstall_languageaccess340_condition()
  31  {
  32      $db    = Factory::getDbo();
  33      $query = $db->getQuery(true)
  34          ->select($db->quoteName('access'))
  35          ->from($db->quoteName('#__languages'))
  36          ->where($db->quoteName('access') . ' = ' . $db->quote('0'));
  37      $db->setQuery($query);
  38      $db->execute();
  39      $numRows = $db->getNumRows();
  40  
  41      if (isset($numRows) && $numRows != 0) {
  42          // We have rows here so we have at minimum one row with access set to 0
  43          return true;
  44      }
  45  
  46      // All good the query return nothing.
  47      return false;
  48  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer