- md5
- 34c37b10d00ac815f15b56039151ff6f
- sha1
- fd78b7296723ac0cf3e070cbbb94549596f85587
- sha256
- 41fb5bbdcbabd8bce14dc9e17556f92f5f1628e763bc1e861efc48b5d7f31eeb
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
<?php
/**
* @package Joomla.Plugin
* @subpackage Webservices.Config
*
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
*/
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Router\ApiRouter;
use Joomla\Router\Route;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Web Services adapter for com_config.
*
* @since 4.0.0
*/
class PlgWebservicesConfig extends CMSPlugin
{
/**
* Load the language file on instantiation.
*
* @var boolean
* @since 4.0.0
*/
protected $autoloadLanguage = true;
/**
* Registers com_config's API's routes in the application
*
* @param ApiRouter &$router The API Routing object
*
* @return void
*
* @since 4.0.0
*/
public function onBeforeApiRoute(&$router)
{
$defaults = ['component' => 'com_config'];
$getDefaults = array_merge(['public' => false], $defaults);
$routes = [
new Route(['GET'], 'v1/config/application', 'application.displayList', [], $getDefaults),
new Route(['PATCH'], 'v1/config/application', 'application.edit', [], $defaults),
new Route(['GET'], 'v1/config/:component_name', 'component.displayList', ['component_name' => '([A-Za-z_]+)'], $getDefaults),
new Route(['PATCH'], 'v1/config/:component_name', 'component.edit', ['component_name' => '([A-Za-z_]+)'], $defaults),
];
$router->addRoutes($routes);
}
}
The same content is in 33 releases, Joomla 4.2.1 to 4.3.4. See them all, or every version of this file.