Merge pull request 'refactor: remove leftover src/ directory' (#52) from fix/remove-old-src-v2 into main
Generic: Project CI / Tests (push) Blocked by required conditions
Generic: Repo Health / Scripts governance (push) Blocked by required conditions
Generic: Repo Health / Repository health (push) Blocked by required conditions
Generic: Repo Health / Report Issues (push) Blocked by required conditions
Generic: Repo Health / Access control (push) Successful in 2s
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Project CI / Lint & Validate (push) Successful in 37s
Generic: Project CI / Tests (push) Blocked by required conditions
Generic: Repo Health / Scripts governance (push) Blocked by required conditions
Generic: Repo Health / Repository health (push) Blocked by required conditions
Generic: Repo Health / Report Issues (push) Blocked by required conditions
Generic: Repo Health / Access control (push) Successful in 2s
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Project CI / Lint & Validate (push) Successful in 37s
This commit was merged in pull request #52.
This commit is contained in:
@@ -1,98 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoSuiteBackup
|
||||
* @subpackage plg_webservices_mokosuitebackup
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
*
|
||||
* REST API endpoints — wire-compatible with the mcp_mokosuitebackup MCP server.
|
||||
*
|
||||
* Akeeba-compatible routes:
|
||||
* POST /api/index.php/v1/mokosuitebackup/backup — Start backup
|
||||
* GET /api/index.php/v1/mokosuitebackup/backups — List records
|
||||
* DELETE /api/index.php/v1/mokosuitebackup/backup/:id — Delete record
|
||||
* GET /api/index.php/v1/mokosuitebackup/backup/:id/download — Download archive
|
||||
* GET /api/index.php/v1/mokosuitebackup/profiles — List profiles
|
||||
*/
|
||||
|
||||
namespace Joomla\Plugin\WebServices\MokoSuiteBackup\Extension;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Plugin\CMSPlugin;
|
||||
use Joomla\CMS\Router\ApiRouter;
|
||||
use Joomla\Event\Event;
|
||||
use Joomla\Event\SubscriberInterface;
|
||||
use Joomla\Router\Route;
|
||||
|
||||
final class MokoSuiteBackupWebServices extends CMSPlugin implements SubscriberInterface
|
||||
{
|
||||
protected $autoloadLanguage = true;
|
||||
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
'onBeforeApiRoute' => 'onBeforeApiRoute',
|
||||
];
|
||||
}
|
||||
|
||||
public function onBeforeApiRoute(Event $event): void
|
||||
{
|
||||
/** @var ApiRouter $router */
|
||||
[$router] = array_values($event->getArguments());
|
||||
|
||||
$defaults = [
|
||||
'component' => 'com_mokosuitebackup',
|
||||
'public' => false,
|
||||
];
|
||||
|
||||
// Standard CRUD for backup records
|
||||
$router->createCRUDRoutes('v1/mokosuitebackup/backups', 'backups', $defaults);
|
||||
|
||||
// Start a backup (POST)
|
||||
$router->addRoute(
|
||||
new Route(
|
||||
['POST'],
|
||||
'v1/mokosuitebackup/backup',
|
||||
'backups.backup',
|
||||
[],
|
||||
$defaults
|
||||
)
|
||||
);
|
||||
|
||||
// Delete a backup (DELETE)
|
||||
$router->addRoute(
|
||||
new Route(
|
||||
['DELETE'],
|
||||
'v1/mokosuitebackup/backup/:id',
|
||||
'backups.delete',
|
||||
['id' => '(\d+)'],
|
||||
$defaults
|
||||
)
|
||||
);
|
||||
|
||||
// Download a backup archive (GET)
|
||||
$router->addRoute(
|
||||
new Route(
|
||||
['GET'],
|
||||
'v1/mokosuitebackup/backup/:id/download',
|
||||
'backups.download',
|
||||
['id' => '(\d+)'],
|
||||
$defaults
|
||||
)
|
||||
);
|
||||
|
||||
// List backup profiles (GET)
|
||||
$router->addRoute(
|
||||
new Route(
|
||||
['GET'],
|
||||
'v1/mokosuitebackup/profiles',
|
||||
'backups.profiles',
|
||||
[],
|
||||
$defaults
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -1 +0,0 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
Reference in New Issue
Block a user