primo commit

This commit is contained in:
2024-12-17 17:34:10 +01:00
commit e650f8df99
16435 changed files with 2451012 additions and 0 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,187 @@
<?php
/**
* @package Conditions
* @version 24.11.1459
*
* @author Peter van Westen <info@regularlabs.com>
* @link https://regularlabs.com
* @copyright Copyright © 2024 Regular Labs All Rights Reserved
* @license GNU General Public License version 2 or later
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory as JFactory;
use Joomla\CMS\Installer\Manifest\PackageManifest as JPackageManifest;
use Joomla\CMS\Language\Text as JText;
if ( ! class_exists('pkg_conditionsInstallerScript'))
{
class pkg_conditionsInstallerScript
{
static $current_version;
static $name;
static $package_name;
static $previous_version;
public function postflight($install_type, $adapter)
{
if ( ! in_array($install_type, ['install', 'update']))
{
return true;
}
self::publishExtensions();
self::recreateNamespaceMap();
self::displayMessages();
return true;
}
public function preflight($install_type, $adapter)
{
$manifest = $adapter->getManifest();
static::$package_name = trim($manifest->packagename);
static::$name = trim($manifest->name);
static::$current_version = trim($manifest->version);
static::$previous_version = self::getPreviousVersion();
return true;
}
private static function recreateNamespaceMap()
{
if (JVERSION < 4)
{
return;
}
// Remove the administrator/cache/autoload_psr4.php file
$filename = JPATH_ADMINISTRATOR . '/cache/autoload_psr4.php';
if (file_exists($filename))
{
self::clearFileInOPCache($filename);
clearstatcache(true, $filename);
@unlink($filename);
}
JFactory::getApplication()->createExtensionNamespaceMap();
}
private static function clearFileInOPCache($file)
{
$hasOpCache = ini_get('opcache.enable')
&& function_exists('opcache_invalidate')
&& (
! ini_get('opcache.restrict_api')
|| stripos(realpath($_SERVER['SCRIPT_FILENAME']), ini_get('opcache.restrict_api')) === 0
);
if ( ! $hasOpCache)
{
return false;
}
return opcache_invalidate($file, true);
}
private static function displayMessages()
{
if (php_sapi_name() == 'cli')
{
return;
}
$msg = self::getInstallationLanguageString();
JFactory::getApplication()->enqueueMessage(
JText::sprintf(
$msg,
'<strong>' . JText::_(static::$name . '_SHORT') . '</strong>',
'<strong>' . static::$current_version . '</strong>'
), 'success'
);
}
private static function getInstallationLanguageString()
{
if ( ! static::$previous_version)
{
return 'PKG_RL_EXTENSION_INSTALLED';
}
if (static::$previous_version == static::$current_version)
{
return 'PKG_RL_EXTENSION_REINSTALLED';
}
return 'PKG_RL_EXTENSION_UPDATED';
}
private static function getPreviousVersion()
{
$xml_file = self::getXmlFile();
if ( ! $xml_file)
{
return '';
}
$manifest = new JPackageManifest($xml_file);
return isset($manifest->version) ? trim($manifest->version) : '';
}
private static function getXmlFile()
{
$xml_file = JPATH_MANIFESTS . '/packages/pkg_' . static::$package_name . '.xml';
if (file_exists($xml_file))
{
return $xml_file;
}
$xml_file = JPATH_LIBRARIES . '/' . static::$package_name . '.xml';
if (file_exists($xml_file))
{
return $xml_file;
}
$xml_file = JPATH_ADMINISTRATOR . '/components/com_' . static::$package_name . '/' . static::$package_name . '.xml';
if (file_exists($xml_file))
{
return $xml_file;
}
return '';
}
private static function publishExtensions()
{
// ignore if this is an update of Conditions
if (static::$package_name == 'conditions' && static::$previous_version)
{
return;
}
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->update('#__extensions')
->set($db->quoteName('enabled') . ' = 1')
->where($db->quoteName('element') . ' IN ('
. $db->quote(static::$package_name)
. ', ' . $db->quote('com_' . static::$package_name)
. ')'
);
$db->setQuery($query);
$db->execute();
}
}
}

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,186 @@
<?php
/**
* JEM Package
* @package JEM.Package
*
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*
* @copyright (C) 2008 - 2013 Kunena Team. All rights reserved.
* @license https://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link https://www.kunena.org
**/
defined ('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Version;
use Joomla\CMS\Table\Table;
use Joomla\CMS\Router\Route;
/**
* JEM package installer script.
*/
class Pkg_JemInstallerScript
{
/**
* List of supported versions. Newest version first!
* @var array
*/
protected $versions = array(
'PHP' => array (
'8.0' => '8.0',
'0' => '8.0' // Preferred version
),
'MySQL' => array (
'8.0' => '8.0',
'5.6' => '5.6',
'0' => '5.6' // Preferred version
),
'Joomla!' => array (
'4.2' => '4.2',
'4.0' => '',
'0' => '4.2' // Preferred version
)
);
/**
* List of required PHP extensions.
* @var array
*/
protected $extensions = array ('gd', 'json', 'pcre', 'ctype', 'SimpleXML' /* iCalCreator */ );
public function install($parent) {
return true;
}
public function discover_install($parent) {
return self::install($parent);
}
public function update($parent) {
return self::install($parent);
}
public function uninstall($parent) {
return true;
}
public function preflight($type, $parent) {
// Prevent installation if requirements are not met.
if (!$this->checkRequirements()){
return false;
}
return true;
}
public function makeRoute($uri) {
return Route::_($uri, false);
}
public function postflight($type, $parent) {
// Clear Joomla system cache.
/** @var JCache|JCacheController $cache */
$cache = Factory::getCache();
$cache->clean('_system');
// Remove all compiled files from APC cache.
if (function_exists('apc_clear_cache')) {
@apc_clear_cache();
}
if ($type == 'uninstall') return true;
$this->enablePlugin('content', 'jem');
$this->enablePlugin('content', 'jemlistevents');
$this->enablePlugin('quickicon', 'jem');
// $this->enablePlugin('finder', 'jem');
// $this->enablePlugin('search', 'jem');
// $this->enablePlugin('jem', 'mailer');
# ajax calendar module doesn't fully work on Joomla! 2.5
if (version_compare(JVERSION, '3', '<')) {
$this->disableModule('mod_jem_calajax');
}
return true;
}
function enablePlugin($group, $element) {
$plugin = Table::getInstance('extension');
if (!$plugin->load(array('type'=>'plugin', 'folder'=>$group, 'element'=>$element))) {
return false;
}
$plugin->enabled = 1;
return $plugin->store();
}
function disableModule($element) {
$module = Table::getInstance('extension');
if (!$module->load(array('type'=>'module', 'element'=>$element))) {
return false;
}
$module->enabled = 0;
return $module->store();
}
public function checkRequirements() {
$db = Factory::getContainer()->get('DatabaseDriver');
$pass = $this->checkVersion('PHP', phpversion());
$pass &= $this->checkVersion('Joomla!', JVERSION);
$pass &= $this->checkVersion('MySQL', $db->getVersion ());
$pass &= $this->checkDbo($db->name, array('mysql', 'mysqli'));
$pass &= $this->checkExtensions($this->extensions);
return $pass;
}
// Internal functions
protected function checkVersion($name, $version) {
$app = Factory::getApplication();
$major = $minor = 0;
foreach ($this->versions[$name] as $major=>$minor) {
if (!$major || version_compare($version, $major, '<')) {
continue;
}
if ($minor && version_compare($version, $minor, '>=')) {
return true;
}
break;
}
if (!$major) {
$minor = reset($this->versions[$name]);
}
$recommended = end($this->versions[$name]);
if ($minor) {
$app->enqueueMessage(sprintf("%s %s is not supported. Minimum required version is %s %s, but it is highly recommended to use %s %s or later.", $name, $version, $name, $minor, $name, $recommended), 'notice');
} else {
$app->enqueueMessage(sprintf("%s %s is not supported. It is highly recommended to use %s %s or later.", $name, $version, $name, $recommended), 'notice');
}
return false;
}
protected function checkDbo($name, $types) {
$app = Factory::getApplication();
if (in_array($name, $types)) {
return true;
}
$app->enqueueMessage(sprintf("Database driver '%s' is not supported. Please use MySQL instead.", $name), 'notice');
return false;
}
protected function checkExtensions($extensions) {
$app = Factory::getApplication();
$pass = 1;
foreach ($extensions as $name) {
if (!extension_loaded($name)) {
$pass = 0;
$app->enqueueMessage(sprintf("Required PHP extension '%s' is missing. Please install it into your system.", $name), 'notice');
}
}
return $pass;
}
}

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension type="package" method="upgrade">
<packagename>articles</packagename>
<name>PKG_ARTICLES</name>
<version>4.3.2</version>
<creationDate>October 2024</creationDate>
<author>Regular Labs (Peter van Westen)</author>
<authorEmail>info@regularlabs.com</authorEmail>
<authorUrl>https://regularlabs.com</authorUrl>
<copyright>Copyright © 2024 Regular Labs - All Rights Reserved</copyright>
<license>GNU General Public License version 2 or later</license>
<scriptfile>script.install.php</scriptfile>
<blockChildUninstall>true</blockChildUninstall>
<files folder="packages/j4">
<file type="plugin" group="fields" id="articles">plg_fields_articles</file>
<file type="plugin" group="fields" id="articleslinked">plg_fields_articleslinked</file>
</files>
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.pkg_articles.sys.ini</language>
</languages>
<updateservers>
<server type="extension" priority="1" name="Articles Field">https://download.regularlabs.com/updates.xml?e=articlesfield&amp;type=.xml</server>
</updateservers>
</extension>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<extension type="package" version="2.5.7" method="upgrade">
<name>pkg_attachments</name>
<packagename>attachments</packagename>
<version>3.2.6</version>
<creationDate>March 26, 2018</creationDate>
<copyright>(C) 2007-2018 Jonathan M. Cameron. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL</license>
<author>Jonathan M. Cameron</author>
<authorEmail>jmcameron@jmcameron.net</authorEmail>
<authorUrl>http://joomlacode.org/gf/project/attachments/</authorUrl>
<packager>Jonathan M. Cameron</packager>
<packagerurl>http://joomlacode.org/gf/project/attachments/</packagerurl>
<description>ATTACH_PACKAGE_ATTACHMENTS_FOR_JOOMLA_16PLUS</description>
<files folder="packages">
<file type="plugin" id="attachments" group="content">attachments_plugin.zip</file>
<file type="plugin" id="attachments" group="search">attachments_search.zip</file>
<file type="plugin" id="attachments_plugin_framework" group="attachments">attachments_plugin_framework.zip</file>
<file type="plugin" id="attachments_for_content" group="attachments">attachments_for_content.zip</file>
<file type="plugin" id="show_attachments" group="system">show_attachments_in_editor_plugin.zip</file>
<file type="plugin" id="add_attachment" group="editors-xtd">add_attachment_btn_plugin.zip</file>
<file type="plugin" id="insert_attachments_token" group="editors-xtd">insert_attachments_token_btn_plugin.zip</file>
<file type="plugin" id="attachments" group="quickicon">attachments_quickicon_plugin.zip</file>
<file type="component" id="com_attachments">attachments_component.zip</file>
</files>
<updateservers>
<server type="extension" priority="1" name="Attachments Updates">http://jmcameron.net/attachments/updates/updates.xml</server>
</updateservers>
</extension>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension type="package" method="upgrade">
<packagename>conditionalcontent</packagename>
<name>PKG_CONDITIONALCONTENT</name>
<version>5.2.2</version>
<creationDate>November 2024</creationDate>
<author>Regular Labs (Peter van Westen)</author>
<authorEmail>info@regularlabs.com</authorEmail>
<authorUrl>https://regularlabs.com</authorUrl>
<copyright>Copyright © 2024 Regular Labs - All Rights Reserved</copyright>
<license>GNU General Public License version 2 or later</license>
<scriptfile>script.install.php</scriptfile>
<blockChildUninstall>true</blockChildUninstall>
<files folder="packages/j4">
<file type="plugin" group="system" id="conditionalcontent">plg_system_conditionalcontent</file>
<file type="plugin" group="editors-xtd" id="conditionalcontent">plg_editors-xtd_conditionalcontent</file>
</files>
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.pkg_conditionalcontent.sys.ini</language>
</languages>
<updateservers>
<server type="extension" priority="1" name="Conditional Content">https://download.regularlabs.com/updates.xml?e=conditionalcontent&amp;type=.xml</server>
</updateservers>
</extension>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension type="package" method="upgrade">
<packagename>conditions</packagename>
<name>PKG_CONDITIONS</name>
<version>24.11.1459</version>
<creationDate>November 2024</creationDate>
<author>Regular Labs (Peter van Westen)</author>
<authorEmail>info@regularlabs.com</authorEmail>
<authorUrl>https://regularlabs.com</authorUrl>
<copyright>Copyright © 2024 Regular Labs - All Rights Reserved</copyright>
<license>GNU General Public License version 2 or later</license>
<scriptfile>script.install.php</scriptfile>
<blockChildUninstall>true</blockChildUninstall>
<files folder="packages">
<file type="component" id="com_conditions">com_conditions</file>
<file type="plugin" group="actionlog" id="conditions">plg_actionlog_conditions</file>
</files>
<updateservers>
<server type="extension" priority="1" name="Regular Labs - Conditions">https://download.regularlabs.com/updates.xml?e=conditions&amp;type=.xml</server>
</updateservers>
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.pkg_conditions.sys.ini</language>
</languages>
</extension>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension type="package" method="upgrade">
<name>English (en-GB) Language Pack</name>
<packagename>en-GB</packagename>
<version>5.2.2.1</version>
<creationDate>2024-11</creationDate>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<copyright>(C) 2019 Open Source Matters, Inc.</copyright>
<license>https://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<url>https://github.com/joomla/joomla-cms</url>
<packager>Joomla! Project</packager>
<packagerurl>www.joomla.org</packagerurl>
<description><![CDATA[en-GB language pack]]></description>
<blockChildUninstall>true</blockChildUninstall>
<files>
<folder type="language" client="site" id="en-GB">language/en-GB</folder>
<folder type="language" client="administrator" id="en-GB">administrator/language/en-GB</folder>
<folder type="language" client="api" id="en-GB">api/language/en-GB</folder>
</files>
<updateservers>
<server type="collection" priority="1" name="Accredited Joomla! Translations">
https://update.joomla.org/language/translationlist_5.xml
</server>
</updateservers>
</extension>

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension type="package" method="upgrade">
<name>Italian (it-IT) Language Pack</name>
<packagename>it-IT</packagename>
<version>5.2.2.1</version>
<creationDate>Novembre 2024</creationDate>
<author>Joomla! Project (Italian Translation Team)</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<copyright>(C) 2019 Open Source Matters, Inc.</copyright>
<license>https://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<url>https://github.com/joomla/joomla-cms</url>
<packager>Joomla! Project (Italian Translation Team)</packager>
<packagerurl>www.joomla.org</packagerurl>
<description><![CDATA[<div style="text-align: center;">
<h3>Joomla! 5.1 Full Italian (it-IT) Language Package - Version 5.2.0</h3>
<h3>Pacchetto completo della lingua italiana di Joomla! 5.2 (it-IT) - Versione 5.2.0</h3>
</div>
<div class="alert alert-warning alert-wrapper">
<h4 class="alert-heading">Comunicazione importante</h4>
<div class="alert-message">
<p>Il tool utilizzato per gestire i file di lingua (<a href="https://joomla. crowdin. com/u/projects/18/l/it" target="_blank" rel="noopener noreferrer">CROWDIN</a>), a seguito di unanomalia, ha introdotto diversi errori nelle traduzioni fatte dal team di volontari negli ultimi anni. Il rilascio del pacchetto di lingua Italiana rischiava quindi di essere corrotto e pertanto è stato saltato il suo rilascio per 1 mese durante il quale si è lavorato per correggere tutto.</p>
<p>A grande richiesta pubblichiamo il pacchetto quasi totalmente corretto.</p>
<p>Il team di traduzione sta continuando ad adoperarsi per sistemare questa problematica e fornirvi una traduzione sempre più precisa.</p>
</div>
</div>]]></description>
<blockChildUninstall>true</blockChildUninstall>
<files>
<folder type="language" client="site" id="it-IT">language/it-IT</folder>
<folder type="language" client="administrator" id="it-IT">administrator/language/it-IT</folder>
<folder type="language" client="api" id="it-IT">api/language/it-IT</folder>
</files>
<updateservers>
<server type="collection" priority="1" name="Traduzioni accreditate di Joomla!">
https://update.joomla.org/language/translationlist_5.xml
</server>
</updateservers>
</extension>

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8" ?>
<extension type="package" version="4.4" method="upgrade">
<name>pkg_jem</name>
<packagename>jem</packagename>
<creationDate>October 2024</creationDate>
<copyright>Copyright (C) 2013-2024 joomlaeventmanager.net</copyright>
<license>https://www.gnu.org/licenses/gpl-3.0 GNU/GPL</license>
<author>JEM Community</author>
<authorEmail>info@joomlaeventmanager.net</authorEmail>
<authorUrl>https://www.joomlaeventmanager.net</authorUrl>
<version>4.3.1</version>
<description>PKG_JEM_INSTALLATION_DESCRIPTION</description>
<url>https://www.joomlaeventmanager.net/</url>
<packager>JEM Community</packager>
<packagerurl>https://www.joomlaeventmanager.net</packagerurl>
<scriptfile>pkg_install.php</scriptfile>
<files folder="packages">
<file type="component" id="com_jem">com_jem.zip</file>
<file type="module" id="mod_jem" client="site">mod_jem.zip</file>
<file type="module" id="mod_jem_wide" client="site">mod_jem_wide.zip</file>
<file type="module" id="mod_jem_cal" client="site">mod_jem_cal.zip</file>
<!--file type="module" id="mod_jem_calajax" client="site">mod_jem_calajax.zip</file-->
<file type="module" id="mod_jem_teaser" client="site">mod_jem_teaser.zip</file>
<file type="module" id="mod_jem_banner" client="site">mod_jem_banner.zip</file>
<file type="module" id="mod_jem_jubilee" client="site">mod_jem_jubilee.zip</file>
<file type="plugin" id="jem" group="content">plg_content_jem.zip</file>
<file type="plugin" id="jemlistevents" group="content">plg_content_jemlistevents.zip</file>
<file type="plugin" id="jem" group="search">plg_search_jem.zip</file>
<file type="plugin" id="jem" group="finder">plg_finder_jem.zip</file>
<file type="plugin" id="comments" group="jem">plg_jem_comments.zip</file>
<file type="plugin" id="mailer" group="jem">plg_jem_mailer.zip</file>
<file type="plugin" id="jem" group="quickicon">plg_quickicon_jem.zip</file>
</files>
<languages folder="language">
<language tag="en-GB">en-GB/pkg_jem.sys.ini</language>
</languages>
<updateservers>
<server type="extension" name="JEM Update Site">https://www.joomlaeventmanager.net/updatecheck/update_pkg_jem.xml</server>
</updateservers>
</extension>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<extension type="package" version="3.8" method="upgrade">
<name>jlcontentfieldsfilter</name>
<author>Joomline</author>
<packagename>jlcontentfieldsfilter</packagename>
<creationDate>01.08.2023</creationDate>
<copyright>(C) 2017-2023 Arkadiy Sedelnikov, Sergey Tolkachyov, Joomline. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>sales@joomline.ru</authorEmail>
<packager>JoomLine</packager>
<packagerurl>https://joomline.ru</packagerurl>
<version>3.0.0</version>
<description>PLG_JLCONTENTFIELSDFILTER_DESC_ALL</description>
<files>
<folder type="module" id="mod_jlcontentfieldsfilter" method="upgrade" client="site">mod_jlcontentfieldsfilter</folder>
<folder type="plugin" id="jlcontentfieldsfilter" group="system" method="upgrade" client="site">plg_system_jlcontentfieldsfilter</folder>
<folder type="file" id="file_jlcomponent_ajax" method="upgrade" client="site">file_jlcomponent_ajax</folder>
</files>
<updateservers><server type="extension" priority="1" name="JL Content Fields Filter">https://joomline.net/update.html?extension_id=5.xml</server></updateservers>
</extension>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension type="package" method="upgrade">
<packagename>regularlabs</packagename>
<name>PKG_REGULARLABS</name>
<version>24.11.1459</version>
<creationDate>November 2024</creationDate>
<author>Regular Labs (Peter van Westen)</author>
<authorEmail>info@regularlabs.com</authorEmail>
<authorUrl>https://regularlabs.com</authorUrl>
<copyright>Copyright © 2024 Regular Labs - All Rights Reserved</copyright>
<license>GNU General Public License version 2 or later</license>
<scriptfile>script.install.php</scriptfile>
<blockChildUninstall>true</blockChildUninstall>
<files folder="packages">
<file type="library" id="regularlabs">lib_regularlabs</file>
<file type="plugin" group="system" id="regularlabs">plg_system_regularlabs</file>
</files>
<updateservers>
<server type="extension" priority="1" name="Regular Labs Library">https://download.regularlabs.com/updates.xml?e=library&amp;type=.xml</server>
</updateservers>
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.pkg_regularlabs.sys.ini</language>
</languages>
</extension>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension type="package" method="upgrade">
<name>pkg_search</name>
<packagename>search</packagename>
<creationDate>2021-08-17</creationDate>
<packager>Joomla! Project</packager>
<copyright>(C) 2021 Open Source Matters. All rights reserved.</copyright>
<packageremail>admin@joomla.org</packageremail>
<packagerurl>www.joomla.org</packagerurl>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>4.0.0</version>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<scriptfile>script.php</scriptfile>
<files>
<!-- The id for each extension is the element stored in the DB -->
<file type="component" id="com_search">com_search.zip</file>
<file type="module" id="mod_search" client="site">mod_search.zip</file>
<file type="plugin" id="categories" group="search">plg_search_categories.zip</file>
<file type="plugin" id="contacts" group="search">plg_search_contacts.zip</file>
<file type="plugin" id="content" group="search">plg_search_content.zip</file>
<file type="plugin" id="newsfeeds" group="search">plg_search_newsfeeds.zip</file>
<file type="plugin" id="tags" group="search">plg_search_tags.zip</file>
</files>
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.pkg_search.sys.ini</language>
</languages>
<updateservers>
<!-- Note: No spaces or linebreaks allowed between the server tags -->
<server type="extension" name="Search Update Site">https://raw.githubusercontent.com/joomla-extensions/search/main/manifest.xml</server>
</updateservers>
</extension>

View File

@ -0,0 +1,187 @@
<?php
/**
* @package Regular Labs Library
* @version 24.11.1459
*
* @author Peter van Westen <info@regularlabs.com>
* @link https://regularlabs.com
* @copyright Copyright © 2024 Regular Labs All Rights Reserved
* @license GNU General Public License version 2 or later
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory as JFactory;
use Joomla\CMS\Installer\Manifest\PackageManifest as JPackageManifest;
use Joomla\CMS\Language\Text as JText;
if ( ! class_exists('pkg_regularlabsInstallerScript'))
{
class pkg_regularlabsInstallerScript
{
static $current_version;
static $name;
static $package_name;
static $previous_version;
public function postflight($install_type, $adapter)
{
if ( ! in_array($install_type, ['install', 'update']))
{
return true;
}
self::publishExtensions();
self::recreateNamespaceMap();
self::displayMessages();
return true;
}
public function preflight($install_type, $adapter)
{
$manifest = $adapter->getManifest();
static::$package_name = trim($manifest->packagename);
static::$name = trim($manifest->name);
static::$current_version = trim($manifest->version);
static::$previous_version = self::getPreviousVersion();
return true;
}
private static function recreateNamespaceMap()
{
if (JVERSION < 4)
{
return;
}
// Remove the administrator/cache/autoload_psr4.php file
$filename = JPATH_ADMINISTRATOR . '/cache/autoload_psr4.php';
if (file_exists($filename))
{
self::clearFileInOPCache($filename);
clearstatcache(true, $filename);
@unlink($filename);
}
JFactory::getApplication()->createExtensionNamespaceMap();
}
private static function clearFileInOPCache($file)
{
$hasOpCache = ini_get('opcache.enable')
&& function_exists('opcache_invalidate')
&& (
! ini_get('opcache.restrict_api')
|| stripos(realpath($_SERVER['SCRIPT_FILENAME']), ini_get('opcache.restrict_api')) === 0
);
if ( ! $hasOpCache)
{
return false;
}
return opcache_invalidate($file, true);
}
private static function displayMessages()
{
if (php_sapi_name() == 'cli')
{
return;
}
$msg = self::getInstallationLanguageString();
JFactory::getApplication()->enqueueMessage(
JText::sprintf(
$msg,
'<strong>' . JText::_(static::$name . '_SHORT') . '</strong>',
'<strong>' . static::$current_version . '</strong>'
), 'success'
);
}
private static function getInstallationLanguageString()
{
if ( ! static::$previous_version)
{
return 'PKG_RL_EXTENSION_INSTALLED';
}
if (static::$previous_version == static::$current_version)
{
return 'PKG_RL_EXTENSION_REINSTALLED';
}
return 'PKG_RL_EXTENSION_UPDATED';
}
private static function getPreviousVersion()
{
$xml_file = self::getXmlFile();
if ( ! $xml_file)
{
return '';
}
$manifest = new JPackageManifest($xml_file);
return isset($manifest->version) ? trim($manifest->version) : '';
}
private static function getXmlFile()
{
$xml_file = JPATH_MANIFESTS . '/packages/pkg_' . static::$package_name . '.xml';
if (file_exists($xml_file))
{
return $xml_file;
}
$xml_file = JPATH_LIBRARIES . '/' . static::$package_name . '.xml';
if (file_exists($xml_file))
{
return $xml_file;
}
$xml_file = JPATH_ADMINISTRATOR . '/components/com_' . static::$package_name . '/' . static::$package_name . '.xml';
if (file_exists($xml_file))
{
return $xml_file;
}
return '';
}
private static function publishExtensions()
{
// ignore if this is an update of Conditions
if (static::$package_name == 'conditions' && static::$previous_version)
{
return;
}
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->update('#__extensions')
->set($db->quoteName('enabled') . ' = 1')
->where($db->quoteName('element') . ' IN ('
. $db->quote(static::$package_name)
. ', ' . $db->quote('com_' . static::$package_name)
. ')'
);
$db->setQuery($query);
$db->execute();
}
}
}