[4.0] Update composer deps to latest versions (#26820)

This commit is contained in:
George Wilson 2020-03-04 07:33:24 +00:00 committed by GitHub
parent b453bccdb7
commit 78bdb9bc0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 545 additions and 629 deletions

View File

@ -333,7 +333,8 @@ class DatabaseModel extends InstallerModel
'#__schemas',
'schemas'
)
)->join(
)
->join(
'INNER',
$db->quoteName('#__extensions', 'extensions'),
$db->quoteName('schemas.extension_id') . ' = ' . $db->quoteName('extensions.extension_id')

View File

@ -895,7 +895,8 @@ class ArticlesModel extends ListModel
$query->bind($keys, $values, $dataTypes);
$query
->select('DATE(' .
->select(
'DATE(' .
$query->concatenate(
array(
$query->year($db->quoteName('publish_up')),

942
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,8 @@ namespace Joomla\CMS\Application;
\defined('JPATH_PLATFORM') or die;
use Joomla\Application\SessionAwareWebApplicationInterface;
use Joomla\Application\SessionAwareWebApplicationTrait;
use Joomla\Application\Web\WebClient;
use Joomla\CMS\Authentication\Authentication;
use Joomla\CMS\Component\ComponentHelper;
@ -41,9 +43,9 @@ use Joomla\String\StringHelper;
*
* @since 3.2
*/
abstract class CMSApplication extends WebApplication implements ContainerAwareInterface, CMSApplicationInterface
abstract class CMSApplication extends WebApplication implements ContainerAwareInterface, CMSApplicationInterface, SessionAwareWebApplicationInterface
{
use ContainerAwareTrait, ExtensionManagerTrait, ExtensionNamespaceMapper;
use ContainerAwareTrait, ExtensionManagerTrait, ExtensionNamespaceMapper, SessionAwareWebApplicationTrait;
/**
* Array of options for the \JDocument object

View File

@ -125,15 +125,6 @@ interface CMSApplicationInterface extends ExtensionManagerInterface
*/
public function isClient($identifier);
/**
* Method to get the application session object.
*
* @return SessionInterface The session object
*
* @since 4.0.0
*/
public function getSession();
/**
* Flag if the application instance is a CLI or web based application.
*

View File

@ -20,6 +20,7 @@ use Joomla\DI\ContainerAwareTrait;
use Joomla\Event\DispatcherAwareInterface;
use Joomla\Event\DispatcherAwareTrait;
use Joomla\Event\DispatcherInterface;
use Joomla\Input\Input;
use Joomla\Registry\Registry;
use Joomla\Session\SessionInterface;
use Symfony\Component\Console\Input\InputInterface;
@ -35,6 +36,14 @@ class ConsoleApplication extends Application implements DispatcherAwareInterface
{
use DispatcherAwareTrait, EventAware, IdentityAware, ContainerAwareTrait, ExtensionManagerTrait, ExtensionNamespaceMapper;
/**
* The input.
*
* @var \Joomla\Input\Input
* @since __DEPLOY_VERSION__
*/
protected $input = null;
/**
* The name of the application.
*
@ -87,6 +96,9 @@ class ConsoleApplication extends Application implements DispatcherAwareInterface
?Container $container = null
)
{
// Set up a Input object for Controllers etc to use
$this->input = new \Joomla\CMS\Input\Cli;
parent::__construct($input, $output, $config);
$this->setName('Joomla!');
@ -115,6 +127,42 @@ class ConsoleApplication extends Application implements DispatcherAwareInterface
$this->input->set('format', 'cli');
}
/**
* Magic method to access properties of the application.
*
* @param string $name The name of the property.
*
* @return mixed A value if the property name is valid, null otherwise.
*
* @since __DEPLOY_VERSION__
* @deprecated 3.0 This is a B/C proxy for deprecated read accesses
*/
public function __get($name)
{
switch ($name)
{
case 'input':
@trigger_error(
'Accessing the input property of the application is deprecated, use the getInput() method instead.',
E_USER_DEPRECATED
);
return $this->getInput();
default:
$trace = debug_backtrace();
trigger_error(
sprintf(
'Undefined property via __get(): %1$s in %2$s on line %3$s',
$name,
$trace[0]['file'],
$trace[0]['line']
),
E_USER_NOTICE
);
}
}
/**
* Method to run the application routines.
*
@ -240,6 +288,18 @@ class ConsoleApplication extends Application implements DispatcherAwareInterface
return $this->config;
}
/**
* Method to get the application input object.
*
* @return Input
*
* @since __DEPLOY_VERSION__
*/
public function getInput(): Input
{
return $this->input;
}
/**
* Get the system message queue.
*

View File

@ -1,136 +0,0 @@
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\CMS\Event;
use Joomla\DI\ContainerAwareTrait;
use Joomla\Event\EventInterface;
\defined('JPATH_PLATFORM') or die;
/**
* Decorator for an event listener to be pulled from the service container.
*
* @since 4.0.0
*/
final class LazyServiceEventListener
{
use ContainerAwareTrait;
/**
* The ID of the service from the container to be used
*
* @var string
* @since 4.0.0
*/
private $serviceId;
/**
* The method from the service to be called
*
* @var string
* @since 4.0.0
*/
private $method;
/**
* Constructor.
*
* @param string $serviceId The ID of the service from the container to be used
* @param string $method The method from the service to be called if necessary
* (if left empty, the service must be a callable; i.e. have an `__invoke()` method on a class)
*
* @since 4.0.0
* @throws \InvalidArgumentException if the service ID is empty
*/
public function __construct(string $serviceId, string $method = '')
{
if (empty($serviceId))
{
throw new \InvalidArgumentException(
sprintf(
'The $serviceId parameter cannot be empty in %s',
self::class
)
);
}
$this->serviceId = $serviceId;
$this->method = $method;
}
/**
* Load a service from the container to listen to an event.
*
* @param EventInterface $event The event to process
*
* @return void
*
* @since 4.0.0
* @throws \InvalidArgumentException if the constructor's $method parameter is empty when not executing a callable service
* @throws \RuntimeException if the service cannot be executed
*/
public function __invoke(EventInterface $event)
{
if (!$this->container)
{
throw new \RuntimeException(
sprintf(
'The container has not been set in %s for %s, ensure you call the `setContainer()` method first',
self::class,
!empty($this->serviceId) ? ('the "' . $this->serviceId . '" service') : 'an unknown service'
)
);
}
if (!$this->container->has($this->serviceId))
{
throw new \RuntimeException(
sprintf(
'The "%s" service has not been registered to the service container',
$this->serviceId
)
);
}
$service = $this->container->get($this->serviceId);
// If the service is callable on its own, just execute it
if (\is_callable($service))
{
\call_user_func($service, $event);
return;
}
if (empty($this->method))
{
throw new \InvalidArgumentException(
sprintf(
'The $method argument is required when creating a "%s" to call a method from the "%s" service.',
self::class,
$this->serviceId
)
);
}
if (!method_exists($service, $this->method))
{
throw new \RuntimeException(
sprintf(
'The "%s" method does not exist on "%s" (from service "%s")',
$this->method,
\get_class($service),
$this->serviceId
)
);
}
\call_user_func([$service, $this->method], $event);
}
}

View File

@ -132,11 +132,11 @@ class ListField extends FormField
if ((string) $option['showon'])
{
$tmp['optionattr'] = " data-showon='" .
json_encode(
FormHelper::parseShowOnConditions((string) $option['showon'], $this->formControl, $this->group)
)
. "'";
$encodedConditions = json_encode(
FormHelper::parseShowOnConditions((string) $option['showon'], $this->formControl, $this->group)
);
$tmp['optionattr'] = " data-showon='" . $encodedConditions . "'";
}
// Add the option object to the result set.

View File

@ -16,7 +16,6 @@ use Joomla\CMS\Application\ApplicationHelper;
use Joomla\CMS\Application\CMSApplicationInterface;
use Joomla\CMS\Application\ConsoleApplication;
use Joomla\CMS\Application\SiteApplication;
use Joomla\CMS\Event\LazyServiceEventListener;
use Joomla\CMS\Factory;
use Joomla\CMS\Installation\Application\InstallationApplication;
use Joomla\CMS\Session\EventListener\MetadataManagerListener;
@ -28,6 +27,7 @@ use Joomla\DI\Container;
use Joomla\DI\Exception\DependencyResolutionException;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Event\LazyServiceEventListener;
use Joomla\Event\Priority;
use Joomla\Registry\Registry;
use Joomla\Session\SessionEvents;
@ -244,8 +244,7 @@ class Session implements ServiceProviderInterface
true
);
$listener = new LazyServiceEventListener('session.event_listener.metadata_manager', 'onAfterSessionStart');
$listener->setContainer($container);
$listener = new LazyServiceEventListener($container, 'session.event_listener.metadata_manager', 'onAfterSessionStart');
/** @var DispatcherInterface $dispatcher */
$dispatcher = $container->get(DispatcherInterface::class);