CoreFiles by mySites.guru
config.php54 lines, 1,423 bytes, from Joomla_4.0.0-beta7-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta6
md5
fafc0a0d83a6bdf7d0ea3ac69747718e
sha1
7f14ae27a2e8e10577849154195fdc34df2ae3c0
sha256
e3ed7046987be232753edd8f8f7248d6b478256d5b9c1b607dd714d8ab964d9e
<?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
 */

defined('_JEXEC') or die;

use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Router\ApiRouter;
use Joomla\Router\Route;

/**
 * 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 2 releases, Joomla 4.0.0-beta6 to 4.0.0-beta7. See them all, or every version of this file.