CoreFiles by mySites.guru
PackageInstaller.php66 lines, 1,750 bytes, from Joomla_6.0.2-Stable-Full_Package.zip
Raw History Compare with 6.0.1
md5
967bab1b7f2dd1d96b8765c18fe41e52
sha1
130acfbb0074562ab584905c4e31c79e818668d4
sha256
0f3f5085f30b0aaaa13f5198ed39460506f717e6ef0d7e145c1ad10f345fcd23
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Installer.packageinstaller
 *
 * @copyright   (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Plugin\Installer\Package\Extension;

use Joomla\CMS\Event\Installer\AddInstallationTabEvent;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\Event\SubscriberInterface;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * PackageInstaller Plugin.
 *
 * @since  3.6.0
 */
final class PackageInstaller extends CMSPlugin implements SubscriberInterface
{
    /**
     * Returns an array of events this subscriber will listen to.
     *
     * @return  array
     *
     * @since   5.0.0
     */
    public static function getSubscribedEvents(): array
    {
        return ['onInstallerAddInstallationTab' => 'onInstallerAddInstallationTab'];
    }

    /**
     * Installer add Installation Tab listener.
     *
     * @param   AddInstallationTabEvent  $event  The event instance
     *
     * @return  void
     *
     * @since   3.6.0
     */
    public function onInstallerAddInstallationTab(AddInstallationTabEvent $event)
    {
        // Load language files
        $this->loadLanguage();

        $tab            = [];
        $tab['name']    = 'package';
        $tab['label']   = $this->getApplication()->getLanguage()->_('PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_PACKAGE_FILE');

        // Render the input
        ob_start();
        include PluginHelper::getLayoutPath('installer', 'packageinstaller');
        $tab['content'] = ob_get_clean();

        $event->addResult($tab);
    }
}

The same content is in 50 releases, Joomla 6.0.0-alpha1 to 6.2.1-rc1. See them all, or every version of this file.