Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions libraries/src/Application/CMSApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Joomla\CMS\Authentication\Authentication;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Event\AbstractEvent;
use Joomla\CMS\Event\BeforeExecuteEvent;
use Joomla\CMS\Event\ErrorEvent;
use Joomla\CMS\Exception\ExceptionHandler;
use Joomla\CMS\Extension\ExtensionManagerTrait;
Expand Down Expand Up @@ -227,17 +226,6 @@ public function execute()
{
$this->createExtensionNamespaceMap();

PluginHelper::importPlugin('system');

// Trigger the onBeforeExecute event
$this->getDispatcher()->dispatch(
'onBeforeExecute',
new BeforeExecuteEvent('onBeforeExecute', ['subject' => $this, 'container' => $this->getContainer()])
);

// Mark beforeExecute in the profiler.
JDEBUG ? $this->profiler->mark('beforeExecute event dispatched') : null;

// Perform application routines.
$this->doExecute();

Expand Down
6 changes: 1 addition & 5 deletions libraries/src/Application/CliApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Joomla\CMS\Application\CLI\CliInput;
use Joomla\CMS\Application\CLI\CliOutput;
use Joomla\CMS\Application\CLI\Output\Stdout;
use Joomla\CMS\Event\BeforeExecuteEvent;
use Joomla\CMS\Extension\ExtensionManagerTrait;
use Joomla\CMS\Factory;
use Joomla\DI\Container;
Expand Down Expand Up @@ -149,10 +148,7 @@ public static function getInstance($name = null)
public function execute()
{
// Trigger the onBeforeExecute event
$this->getDispatcher()->dispatch(
'onBeforeExecute',
new BeforeExecuteEvent('onBeforeExecute', ['subject' => $this, 'container' => $this->getContainer()])
);
$this->triggerEevent('onBeforeExecute');

// Perform application routines.
$this->doExecute();
Expand Down
6 changes: 1 addition & 5 deletions libraries/src/Application/DaemonApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

\defined('JPATH_PLATFORM') or die;

use Joomla\CMS\Event\BeforeExecuteEvent;
use Joomla\CMS\Filesystem\Folder;
use Joomla\CMS\Input\Cli;
use Joomla\CMS\Log\Log;
Expand Down Expand Up @@ -365,10 +364,7 @@ public function loadConfiguration($data)
public function execute()
{
// Trigger the onBeforeExecute event
$this->getDispatcher()->dispatch(
'onBeforeExecute',
new BeforeExecuteEvent('onBeforeExecute', ['subject' => $this, 'container' => $this->getContainer()])
);
$this->triggerEvent('onBeforeExecute');

// Enable basic garbage collection.
gc_enable();
Expand Down
7 changes: 7 additions & 0 deletions libraries/src/Application/SiteApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,13 @@ protected function initialiseApp($options = array())
$user->groups = array($guestUsergroup);
}

if ($plugin = PluginHelper::getPlugin('system', 'languagefilter'))
{
$pluginParams = new Registry($plugin->params);
$this->setLanguageFilter(true);
$this->setDetectBrowser($pluginParams->get('detect_browser', 1) == 1);
}

if (empty($options['language']))
{
// Detect the specified language
Expand Down
8 changes: 2 additions & 6 deletions libraries/src/Application/WebApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use Joomla\Application\AbstractWebApplication;
use Joomla\Application\Web\WebClient;
use Joomla\CMS\Document\Document;
use Joomla\CMS\Event\BeforeExecuteEvent;
use Joomla\CMS\Factory;
use Joomla\CMS\Input\Input;
use Joomla\CMS\Language\Language;
Expand Down Expand Up @@ -132,11 +131,8 @@ public static function getInstance($name = null)
*/
public function execute()
{
// Trigger the onBeforeExecute event
$this->getDispatcher()->dispatch(
'onBeforeExecute',
new BeforeExecuteEvent('onBeforeExecute', ['subject' => $this, 'container' => $this->getContainer()])
);
// Trigger the onBeforeExecute event.
$this->triggerEvent('onBeforeExecute');

// Perform application routines.
$this->doExecute();
Expand Down
46 changes: 0 additions & 46 deletions libraries/src/Event/BeforeExecuteEvent.php

This file was deleted.

25 changes: 0 additions & 25 deletions plugins/system/languagefilter/languagefilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Joomla\CMS\Application\CMSApplicationInterface;
use Joomla\CMS\Association\AssociationServiceInterface;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Event\BeforeExecuteEvent;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\Folder;
use Joomla\CMS\Language\Associations;
Expand Down Expand Up @@ -191,30 +190,6 @@ public function onAfterRoute()
}
}

/**
* Listener for the onBeforeExecute event
*
* @param BeforeExecuteEvent $event The Event object
*
* @return void
*
* @since 4.0
*/
public function onBeforeExecute(BeforeExecuteEvent $event)
{
/** @var \Joomla\CMS\Application\SiteApplication $app */
$app = $event->getApplication();

if (!$app->isClient('site'))
{
return;
}

// If a language was specified it has priority, otherwise use user or default language settings
$app->setLanguageFilter(true);
$app->setDetectBrowser($this->params->get('detect_browser', '1') == '1');
}

/**
* Add build preprocess rule to router.
*
Expand Down