3 Commits

Author SHA1 Message Date
Jonathan Miller 37d325f1ed chore: rename mokobackup to mokojoombackup throughout
Generic: Repo Health / Release configuration (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 / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 1s
Universal: Auto Version Bump / Version Bump (push) Successful in 3s
Full rename of all extension elements, namespaces, language keys,
database tables, file names, and directory names:

- pkg_mokobackup → pkg_mokojoombackup
- com_mokobackup → com_mokojoombackup
- plg_*_mokobackup → plg_*_mokojoombackup
- MokoBackup namespace → MokoJoomBackup
- #__mokobackup_ tables → #__mokojoombackup_
- COM_MOKOBACKUP_ keys → COM_MOKOJOOMBACKUP_

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-06-06 14:54:04 -05:00
jmiller a7458a693e chore: sync .mokogitea/workflows/auto-release.yml from moko-platform [skip ci] 2026-06-06 19:51:46 +00:00
jmiller dc06336b04 chore: sync .mokogitea/workflows/pre-release.yml from moko-platform [skip ci] 2026-06-06 19:49:15 +00:00
243 changed files with 2188 additions and 2147 deletions
+14 -14
View File
@@ -6,7 +6,7 @@ Full-site backup and restore for Joomla — database, files, and configuration.
| Field | Value | | Field | Value |
|---|---| |---|---|
| **Package** | `pkg_mokobackup` | | **Package** | `pkg_mokojoombackup` |
| **Language** | PHP 8.1+ | | **Language** | PHP 8.1+ |
| **Branch** | develop on `dev`, merge to `main` (protected) | | **Branch** | develop on `dev`, merge to `main` (protected) |
| **Wiki** | [MokoJoomBackup Wiki](https://git.mokoconsulting.tech/MokoConsulting/MokoJoomBackup/wiki) | | **Wiki** | [MokoJoomBackup Wiki](https://git.mokoconsulting.tech/MokoConsulting/MokoJoomBackup/wiki) |
@@ -26,32 +26,32 @@ composer install # Install PHP dependencies
Joomla **package** with four sub-extensions: Joomla **package** with four sub-extensions:
### com_mokobackup (Component) ### com_mokojoombackup (Component)
- Admin backend for managing backup profiles and records - Admin backend for managing backup profiles and records
- Backup engine: `Engine/BackupEngine`, `Engine/DatabaseDumper`, `Engine/FileScanner`, `Engine/Archiver` - Backup engine: `Engine/BackupEngine`, `Engine/DatabaseDumper`, `Engine/FileScanner`, `Engine/Archiver`
- Joomla 4/5 MVC: Controllers, Models, Views, Tables - Joomla 4/5 MVC: Controllers, Models, Views, Tables
- Namespace: `Joomla\Component\MokoBackup\Administrator` - Namespace: `Joomla\Component\MokoJoomBackup\Administrator`
- DB tables: `#__mokobackup_profiles`, `#__mokobackup_records` - DB tables: `#__mokojoombackup_profiles`, `#__mokojoombackup_records`
- CLI: `cli/mokobackup.php` for cron-based backups - CLI: `cli/mokojoombackup.php` for cron-based backups
### plg_system_mokobackup (System Plugin) ### plg_system_mokojoombackup (System Plugin)
- Cleanup of expired backup archives (age + count limits) - Cleanup of expired backup archives (age + count limits)
- Namespace: `Joomla\Plugin\System\MokoBackup` - Namespace: `Joomla\Plugin\System\MokoJoomBackup`
### plg_task_mokobackup (Task Plugin) ### plg_task_mokojoombackup (Task Plugin)
- Integrates with Joomla's Scheduled Tasks (com_scheduler) - Integrates with Joomla's Scheduled Tasks (com_scheduler)
- Registers "Run Backup Profile" task type - Registers "Run Backup Profile" task type
- Namespace: `Joomla\Plugin\Task\MokoBackup` - Namespace: `Joomla\Plugin\Task\MokoJoomBackup`
### plg_webservices_mokobackup (WebServices Plugin) ### plg_webservices_mokojoombackup (WebServices Plugin)
- REST API for remote backup management (wire-compatible with mcp_mokobackup) - REST API for remote backup management (wire-compatible with mcp_mokojoombackup)
- Endpoints: backup, backups, profiles, download, delete - Endpoints: backup, backups, profiles, download, delete
- Namespace: `Joomla\Plugin\WebServices\MokoBackup` - Namespace: `Joomla\Plugin\WebServices\MokoJoomBackup`
### Database Schema ### Database Schema
- `#__mokobackup_profiles` — backup profiles (name, description, config JSON, filters JSON) - `#__mokojoombackup_profiles` — backup profiles (name, description, config JSON, filters JSON)
- `#__mokobackup_records` — backup records (profile_id, status, origin, archive path, sizes, timestamps) - `#__mokojoombackup_records` — backup records (profile_id, status, origin, archive path, sizes, timestamps)
## Rules ## Rules
+70 -31
View File
@@ -17,7 +17,7 @@
# | Reads manifest.xml (joomla|dolibarr|generic) to branch logic. | # | Reads manifest.xml (joomla|dolibarr|generic) to branch logic. |
# | | # | |
# | Platform-specific: | # | Platform-specific: |
# | joomla: XML manifest, updates.xml, type-prefixed packages | # | joomla: XML manifest, type-prefixed packages |
# | dolibarr: mod*.class.php, update.txt, dev version reset | # | dolibarr: mod*.class.php, update.txt, dev version reset |
# | generic: README-only, no update stream | # | generic: README-only, no update stream |
# | | # | |
@@ -71,20 +71,25 @@ jobs:
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }} MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
run: | run: |
if ! command -v composer &> /dev/null; then if [ -f /opt/moko-platform/cli/version_bump.php ] && [ -f /opt/moko-platform/vendor/autoload.php ]; then
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1 echo Using pre-installed /opt/moko-platform
echo MOKO_CLI=/opt/moko-platform/cli >> $GITHUB_ENV
else
echo Falling back to fresh clone
if ! command -v composer > /dev/null 2>&1; then
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1
fi
rm -rf /tmp/moko-platform-api
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/moko-platform-api
cd /tmp/moko-platform-api
composer install --no-dev --no-interaction --quiet
echo MOKO_CLI=/tmp/moko-platform-api/cli >> $GITHUB_ENV
fi fi
# Always fetch latest CLI tools — never use stale cache from previous runs
rm -rf /tmp/moko-platform-api
git clone --depth 1 --branch main --quiet \
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git" \
/tmp/moko-platform-api
cd /tmp/moko-platform-api
composer install --no-dev --no-interaction --quiet
- name: Rename branch to rc - name: Rename branch to rc
run: | run: |
php /tmp/moko-platform-api/cli/branch_rename.php \ php ${MOKO_CLI}/branch_rename.php \
--from "${{ github.event.pull_request.head.ref || 'dev' }}" --to rc \ --from "${{ github.event.pull_request.head.ref || 'dev' }}" --to rc \
--token "${{ secrets.MOKOGITEA_TOKEN }}" \ --token "${{ secrets.MOKOGITEA_TOKEN }}" \
--api-base "${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" \ --api-base "${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" \
@@ -100,16 +105,15 @@ jobs:
- name: Publish RC release - name: Publish RC release
run: | run: |
php /tmp/moko-platform-api/cli/release_publish.php \ php ${MOKO_CLI}/release_publish.php \
--path . --stability rc --bump minor --branch rc \ --path . --stability rc --bump minor --branch rc \
--token "${{ secrets.MOKOGITEA_TOKEN }}" \ --token "${{ secrets.MOKOGITEA_TOKEN }}"
--skip-update-stream
- name: Summary - name: Summary
if: always() if: always()
run: | run: |
echo "## Promoted to Release Candidate" >> $GITHUB_STEP_SUMMARY echo "## Promoted to Release Candidate" >> $GITHUB_STEP_SUMMARY
echo "Branch renamed to rc, minor bump, RC release built (updates.xml managed by Gitea Pages)" >> $GITHUB_STEP_SUMMARY echo "Branch renamed to rc, minor bump, RC release built" >> $GITHUB_STEP_SUMMARY
# ── Merged PR → Build & Release (or promote RC to stable) ──────────────────── # ── Merged PR → Build & Release (or promote RC to stable) ────────────────────
release: release:
@@ -151,25 +155,60 @@ jobs:
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GH_MIRROR_TOKEN }}"}}' COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GH_MIRROR_TOKEN }}"}}'
run: | run: |
# Ensure PHP + Composer are available if [ -f /opt/moko-platform/cli/version_bump.php ] && [ -f /opt/moko-platform/vendor/autoload.php ]; then
if ! command -v composer &> /dev/null; then echo Using pre-installed /opt/moko-platform
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1 echo MOKO_CLI=/opt/moko-platform/cli >> $GITHUB_ENV
else
echo Falling back to fresh clone
if ! command -v composer > /dev/null 2>&1; then
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1
fi
rm -rf /tmp/moko-platform-api
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/moko-platform-api
cd /tmp/moko-platform-api
composer install --no-dev --no-interaction --quiet
echo MOKO_CLI=/tmp/moko-platform-api/cli >> $GITHUB_ENV
fi fi
# Always fetch latest CLI tools — never use stale cache from previous runs
rm -rf /tmp/moko-platform-api
git clone --depth 1 --branch main --quiet \
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git" \
/tmp/moko-platform-api
cd /tmp/moko-platform-api
composer install --no-dev --no-interaction --quiet
- name: "Publish stable release" - name: "Publish stable release"
run: | run: |
php /tmp/moko-platform-api/cli/release_publish.php \ php ${MOKO_CLI}/release_publish.php \
--path . --stability stable --bump minor --branch main \ --path . --stability stable --bump minor --branch main \
--token "${{ secrets.MOKOGITEA_TOKEN }}" \ --token "${{ secrets.MOKOGITEA_TOKEN }}"
--skip-update-stream
- name: Update release notes from CHANGELOG.md
run: |
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
# Extract [Unreleased] section from changelog
if [ -f "CHANGELOG.md" ]; then
NOTES=$(awk '/^## \[Unreleased\]/{found=1; next} /^## \[/{if(found) exit} found{print}' CHANGELOG.md)
[ -z "$NOTES" ] && NOTES="Stable release"
else
NOTES="Stable release"
fi
# Update release body via API
RELEASE_ID=$(curl -sf -H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
"${API_BASE}/releases/tags/stable" | python3 -c "import json,sys; print(json.load(sys.stdin).get('id',''))" 2>/dev/null || true)
if [ -n "$RELEASE_ID" ]; then
python3 -c "
import json, urllib.request
body = open('/dev/stdin').read()
payload = json.dumps({'body': body}).encode()
req = urllib.request.Request(
'${API_BASE}/releases/${RELEASE_ID}',
data=payload, method='PATCH',
headers={
'Authorization': 'token ${{ secrets.MOKOGITEA_TOKEN }}',
'Content-Type': 'application/json'
})
urllib.request.urlopen(req)
" <<< "$NOTES"
echo "Release notes updated from CHANGELOG.md"
fi
# -- STEP 9: Mirror to GitHub (stable only) -------------------------------- # -- STEP 9: Mirror to GitHub (stable only) --------------------------------
- name: "Step 9: Mirror release to GitHub" - name: "Step 9: Mirror release to GitHub"
@@ -182,7 +221,7 @@ jobs:
RELEASE_TAG="${{ steps.version.outputs.release_tag }}" RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}" GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}"
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
php /tmp/moko-platform-api/cli/release_mirror.php \ php ${MOKO_CLI}/release_mirror.php \
--version "$VERSION" --tag "$RELEASE_TAG" \ --version "$VERSION" --tag "$RELEASE_TAG" \
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \ --token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
--gh-token "${{ secrets.GH_MIRROR_TOKEN }}" --gh-repo "$GH_REPO" \ --gh-token "${{ secrets.GH_MIRROR_TOKEN }}" --gh-repo "$GH_REPO" \
@@ -256,7 +295,7 @@ jobs:
continue-on-error: true continue-on-error: true
run: | run: |
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
php /tmp/moko-platform-api/cli/version_reset_dev.php \ php ${MOKO_CLI}/version_reset_dev.php \
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "${API_BASE}" \ --token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "${API_BASE}" \
--branch dev --path . 2>&1 || true --branch dev --path . 2>&1 || true
+7 -5
View File
@@ -64,18 +64,17 @@ jobs:
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
run: | run: |
# Use pre-installed /opt/moko-platform if available (updated by cron every 6h) # Use pre-installed /opt/moko-platform if available (updated by cron every 6h)
# Note: avoid double-quoted strings — Act Runner v0.6.x has a quoting bug in Docker mode if [ -f /opt/moko-platform/cli/version_bump.php ] && [ -f /opt/moko-platform/cli/manifest_element.php ] && [ -f /opt/moko-platform/vendor/autoload.php ]; then
if [ -f /opt/moko-platform/cli/version_bump.php ] && [ -f /opt/moko-platform/vendor/autoload.php ]; then
echo Using pre-installed /opt/moko-platform echo Using pre-installed /opt/moko-platform
echo MOKO_CLI=/opt/moko-platform/cli >> $GITHUB_ENV echo MOKO_CLI=/opt/moko-platform/cli >> $GITHUB_ENV
else else
echo Falling back to fresh clone echo Falling back to fresh clone
if ! command -v composer &> /dev/null; then if ! command -v composer > /dev/null 2>&1; then
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1 sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1
fi fi
rm -rf /tmp/moko-platform-api rm -rf /tmp/moko-platform-api
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git
git clone --depth 1 --branch main --quiet ${CLONE_URL} /tmp/moko-platform-api git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/moko-platform-api
cd /tmp/moko-platform-api && composer install --no-dev --no-interaction --quiet cd /tmp/moko-platform-api && composer install --no-dev --no-interaction --quiet
echo MOKO_CLI=/tmp/moko-platform-api/cli >> $GITHUB_ENV echo MOKO_CLI=/tmp/moko-platform-api/cli >> $GITHUB_ENV
fi fi
@@ -118,6 +117,9 @@ jobs:
--path . --version "$VERSION" --branch "${{ github.ref_name }}" --stability "$STABILITY" 2>/dev/null || true --path . --version "$VERSION" --branch "${{ github.ref_name }}" --stability "$STABILITY" 2>/dev/null || true
php ${MOKO_CLI}/version_check.php --path . --fix 2>/dev/null || true php ${MOKO_CLI}/version_check.php --path . --fix 2>/dev/null || true
# Ensure licensing tags (updateservers, dlid) if enabled in manifest.xml
php ${MOKO_CLI}/manifest_licensing.php --path . --fix 2>/dev/null || true
# Append suffix for output # Append suffix for output
if [ -n "$SUFFIX" ]; then if [ -n "$SUFFIX" ]; then
VERSION="${VERSION}${SUFFIX}" VERSION="${VERSION}${SUFFIX}"
+6 -6
View File
@@ -34,10 +34,10 @@
### Added ### Added
- Admin dashboard view as default landing page with status cards, quick actions, and system health checklist (#28) - Admin dashboard view as default landing page with status cards, quick actions, and system health checklist (#28)
- Console plugin (plg_console_mokobackup) — CLI commands: run, list, profiles, restore, cleanup (#29) - Console plugin (plg_console_mokojoombackup) — CLI commands: run, list, profiles, restore, cleanup (#29)
- Content plugin (plg_content_mokobackup) — auto-backup before extension install/update (#30) - Content plugin (plg_content_mokojoombackup) — auto-backup before extension install/update (#30)
- Actionlog plugin (plg_actionlog_mokobackup) — logs backup and profile actions to User Action Logs (#31) - Actionlog plugin (plg_actionlog_mokojoombackup) — logs backup and profile actions to User Action Logs (#31)
- BackupEngine dispatches onMokoBackupAfterRun event for plugin listeners - BackupEngine dispatches onMokoJoomBackupAfterRun event for plugin listeners
- Update site notice on dashboard and post-install - Update site notice on dashboard and post-install
### Changed ### Changed
@@ -52,7 +52,7 @@
### Added ### Added
- Initial package structure with component, system plugin, task plugin, and webservices plugin - Initial package structure with component, system plugin, task plugin, and webservices plugin
- Joomla Scheduled Tasks integration (plg_task_mokobackup) — create multiple tasks, each running a different backup profile on its own schedule - Joomla Scheduled Tasks integration (plg_task_mokojoombackup) — create multiple tasks, each running a different backup profile on its own schedule
- Individual form fields for all profile settings (no raw JSON) - Individual form fields for all profile settings (no raw JSON)
- FTP/FTPS uploader with recursive directory creation, passive mode, SSL, and size verification - FTP/FTPS uploader with recursive directory creation, passive mode, SSL, and size verification
- Google Drive uploader using OAuth2 refresh tokens and resumable upload API - Google Drive uploader using OAuth2 refresh tokens and resumable upload API
@@ -80,5 +80,5 @@
- Backup profiles with independent configurations - Backup profiles with independent configurations
- Backup record management (list, download, delete) - Backup record management (list, download, delete)
- CLI script for cron/scheduled backups - CLI script for cron/scheduled backups
- REST API compatible with MokoBackup MCP server - REST API compatible with MokoJoomBackup MCP server
- System plugin for automatic backup cleanup with configurable retention - System plugin for automatic backup cleanup with configurable retention
+2 -2
View File
@@ -12,7 +12,7 @@
# CONFIGURATION # CONFIGURATION
# ============================================================================== # ==============================================================================
EXTENSION_NAME := mokobackup EXTENSION_NAME := mokojoombackup
EXTENSION_TYPE := package EXTENSION_TYPE := package
SRC_DIR := source SRC_DIR := source
@@ -158,7 +158,7 @@ release-rc: validate validate-xml ## Trigger release-candidate build via CI work
.PHONY: version .PHONY: version
version: ## Display version from package manifest version: ## Display version from package manifest
@VERSION=$$(grep '<version>' $(SRC_DIR)/pkg_mokobackup.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/'); \ @VERSION=$$(grep '<version>' $(SRC_DIR)/pkg_mokojoombackup.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/'); \
echo "$(COLOR_BLUE)$(EXTENSION_NAME)$(COLOR_RESET) v$$VERSION ($(EXTENSION_TYPE))" echo "$(COLOR_BLUE)$(EXTENSION_NAME)$(COLOR_RESET) v$$VERSION ($(EXTENSION_TYPE))"
# Default target # Default target
@@ -1,10 +0,0 @@
; MokoJoomBackup — Package language file (en-GB)
; @package MokoJoomBackup
; @author Moko Consulting <hello@mokoconsulting.tech>
; @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
; @license GPL-3.0-or-later
PKG_MOKOBACKUP="Package - MokoJoomBackup"
PKG_MOKOBACKUP_DESCRIPTION="Full-site backup and restore for Joomla — database, files, and configuration. Includes admin component, system plugin, and REST API."
PKG_MOKOBACKUP_PHP_VERSION_ERROR="MokoJoomBackup requires PHP %s or later."
PKG_MOKOBACKUP_POSTINSTALL_UPDATE_SITE="MokoJoomBackup installed successfully. Configure your <a href=\"%s\">Update Site</a> to receive automatic updates."
@@ -0,0 +1,10 @@
; MokoJoomBackup — Package language file (en-GB)
; @package MokoJoomBackup
; @author Moko Consulting <hello@mokoconsulting.tech>
; @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
; @license GPL-3.0-or-later
PKG_MOKOJOOMBACKUP="Package - MokoJoomBackup"
PKG_MOKOJOOMBACKUP_DESCRIPTION="Full-site backup and restore for Joomla — database, files, and configuration. Includes admin component, system plugin, and REST API."
PKG_MOKOJOOMBACKUP_PHP_VERSION_ERROR="MokoJoomBackup requires PHP %s or later."
PKG_MOKOJOOMBACKUP_POSTINSTALL_UPDATE_SITE="MokoJoomBackup installed successfully. Configure your <a href=\"%s\">Update Site</a> to receive automatic updates."
@@ -1,10 +0,0 @@
; MokoJoomBackup — Package language file (en-US)
; @package MokoJoomBackup
; @author Moko Consulting <hello@mokoconsulting.tech>
; @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
; @license GPL-3.0-or-later
PKG_MOKOBACKUP="Package - MokoJoomBackup"
PKG_MOKOBACKUP_DESCRIPTION="Full-site backup and restore for Joomla — database, files, and configuration. Includes admin component, system plugin, and REST API."
PKG_MOKOBACKUP_PHP_VERSION_ERROR="MokoJoomBackup requires PHP %s or later."
PKG_MOKOBACKUP_POSTINSTALL_UPDATE_SITE="MokoJoomBackup installed successfully. Configure your <a href=\"%s\">Update Site</a> to receive automatic updates."
@@ -0,0 +1,10 @@
; MokoJoomBackup — Package language file (en-US)
; @package MokoJoomBackup
; @author Moko Consulting <hello@mokoconsulting.tech>
; @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
; @license GPL-3.0-or-later
PKG_MOKOJOOMBACKUP="Package - MokoJoomBackup"
PKG_MOKOJOOMBACKUP_DESCRIPTION="Full-site backup and restore for Joomla — database, files, and configuration. Includes admin component, system plugin, and REST API."
PKG_MOKOJOOMBACKUP_PHP_VERSION_ERROR="MokoJoomBackup requires PHP %s or later."
PKG_MOKOJOOMBACKUP_POSTINSTALL_UPDATE_SITE="MokoJoomBackup installed successfully. Configure your <a href=\"%s\">Update Site</a> to receive automatic updates."
@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<form>
<fieldset name="general">
<field name="id" type="hidden" />
<field name="profile_id" type="hidden" />
<field name="description" type="text" label="COM_MOKOBACKUP_FIELD_DESCRIPTION" readonly="true" />
<field name="status" type="text" label="COM_MOKOBACKUP_FIELD_STATUS" readonly="true" />
<field name="origin" type="text" label="COM_MOKOBACKUP_FIELD_ORIGIN" readonly="true" />
<field name="backup_type" type="text" label="COM_MOKOBACKUP_FIELD_BACKUP_TYPE" readonly="true" />
<field name="archivename" type="text" label="COM_MOKOBACKUP_FIELD_ARCHIVE" readonly="true" />
<field name="total_size" type="text" label="COM_MOKOBACKUP_FIELD_SIZE" readonly="true" />
<field name="backupstart" type="text" label="COM_MOKOBACKUP_FIELD_START" readonly="true" />
<field name="backupend" type="text" label="COM_MOKOBACKUP_FIELD_END" readonly="true" />
</fieldset>
</form>
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<form>
<fields name="filter">
<field
name="search"
type="text"
label="COM_MOKOBACKUP_FILTER_SEARCH"
hint="JSEARCH_FILTER"
/>
<field
name="status"
type="list"
label="COM_MOKOBACKUP_FILTER_STATUS"
onchange="this.form.submit();"
>
<option value="">COM_MOKOBACKUP_FILTER_STATUS_ALL</option>
<option value="complete">COM_MOKOBACKUP_STATUS_COMPLETE</option>
<option value="running">COM_MOKOBACKUP_STATUS_RUNNING</option>
<option value="fail">COM_MOKOBACKUP_STATUS_FAIL</option>
<option value="pending">COM_MOKOBACKUP_STATUS_PENDING</option>
</field>
</fields>
<fields name="list">
<field
name="fullordering"
type="list"
label="JGLOBAL_SORT_BY"
default="a.backupstart DESC"
onchange="this.form.submit();"
>
<option value="a.backupstart DESC">COM_MOKOBACKUP_HEADING_DATE_DESC</option>
<option value="a.backupstart ASC">COM_MOKOBACKUP_HEADING_DATE_ASC</option>
<option value="a.total_size DESC">COM_MOKOBACKUP_HEADING_SIZE_DESC</option>
<option value="a.total_size ASC">COM_MOKOBACKUP_HEADING_SIZE_ASC</option>
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
</field>
<field
name="limit"
type="limitbox"
label="JGLOBAL_LIST_LIMIT"
default="25"
onchange="this.form.submit();"
/>
</fields>
</form>
@@ -1,373 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<form>
<fieldset name="general" label="COM_MOKOBACKUP_FIELDSET_GENERAL">
<field
name="title"
type="text"
label="COM_MOKOBACKUP_FIELD_TITLE"
description="COM_MOKOBACKUP_FIELD_TITLE_DESC"
required="true"
maxlength="255"
/>
<field
name="description"
type="textarea"
label="COM_MOKOBACKUP_FIELD_DESCRIPTION"
description="COM_MOKOBACKUP_FIELD_DESCRIPTION_DESC"
rows="3"
/>
<field
name="backup_type"
type="list"
label="COM_MOKOBACKUP_FIELD_BACKUP_TYPE"
description="COM_MOKOBACKUP_FIELD_BACKUP_TYPE_DESC"
default="full"
>
<option value="full">COM_MOKOBACKUP_TYPE_FULL</option>
<option value="database">COM_MOKOBACKUP_TYPE_DATABASE</option>
<option value="files">COM_MOKOBACKUP_TYPE_FILES</option>
<option value="differential">COM_MOKOBACKUP_TYPE_DIFFERENTIAL</option>
</field>
</fieldset>
<fieldset name="archive" label="COM_MOKOBACKUP_FIELDSET_ARCHIVE">
<field
name="archive_format"
type="list"
label="COM_MOKOBACKUP_FIELD_ARCHIVE_FORMAT"
description="COM_MOKOBACKUP_FIELD_ARCHIVE_FORMAT_DESC"
default="zip"
>
<option value="zip">ZIP</option>
<option value="tar.gz">tar.gz</option>
</field>
<field
name="compression_level"
type="list"
label="COM_MOKOBACKUP_FIELD_COMPRESSION"
description="COM_MOKOBACKUP_FIELD_COMPRESSION_DESC"
default="5"
>
<option value="0">COM_MOKOBACKUP_COMPRESSION_NONE</option>
<option value="1">COM_MOKOBACKUP_COMPRESSION_FASTEST</option>
<option value="5">COM_MOKOBACKUP_COMPRESSION_NORMAL</option>
<option value="9">COM_MOKOBACKUP_COMPRESSION_BEST</option>
</field>
<field
name="split_size"
type="number"
label="COM_MOKOBACKUP_FIELD_SPLIT_SIZE"
description="COM_MOKOBACKUP_FIELD_SPLIT_SIZE_DESC"
default="0"
min="0"
hint="0 = no splitting"
/>
<field
name="backup_dir"
type="FolderPicker"
label="COM_MOKOBACKUP_FIELD_BACKUP_DIR"
description="COM_MOKOBACKUP_FIELD_BACKUP_DIR_DESC"
default="administrator/components/com_mokobackup/backups"
addfieldprefix="Joomla\Component\MokoBackup\Administrator\Field"
/>
<field
name="archive_name_format"
type="text"
label="COM_MOKOBACKUP_FIELD_ARCHIVE_NAME_FORMAT"
description="COM_MOKOBACKUP_FIELD_ARCHIVE_NAME_FORMAT_DESC"
default="[host]_[datetime]_profile[profile_id]"
maxlength="512"
hint="[host]_[datetime]_profile[profile_id]"
/>
<field
name="include_mokorestore"
type="radio"
label="COM_MOKOBACKUP_FIELD_INCLUDE_MOKORESTORE"
description="COM_MOKOBACKUP_FIELD_INCLUDE_MOKORESTORE_DESC"
default="0"
class="btn-group"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="encryption_password"
type="password"
label="COM_MOKOBACKUP_FIELD_ENCRYPTION_PASSWORD"
description="COM_MOKOBACKUP_FIELD_ENCRYPTION_PASSWORD_DESC"
maxlength="255"
/>
</fieldset>
<fieldset name="sidebar" label="COM_MOKOBACKUP_FIELDSET_STATUS">
<field
name="id"
type="hidden"
/>
<field
name="published"
type="list"
label="JSTATUS"
default="1"
>
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field
name="ordering"
type="number"
label="JFIELD_ORDERING_LABEL"
default="0"
/>
</fieldset>
<fieldset name="filters" label="COM_MOKOBACKUP_FIELDSET_FILTERS">
<field
name="exclude_dirs"
type="DirectoryFilter"
label="COM_MOKOBACKUP_FIELD_EXCLUDE_DIRS"
description="COM_MOKOBACKUP_FIELD_EXCLUDE_DIRS_DESC"
filter="raw"
hint="tmp"
addfieldprefix="Joomla\Component\MokoBackup\Administrator\Field"
/>
<field
name="exclude_files"
type="ExcludeList"
label="COM_MOKOBACKUP_FIELD_EXCLUDE_FILES"
description="COM_MOKOBACKUP_FIELD_EXCLUDE_FILES_DESC"
filter="raw"
hint="*.bak"
addfieldprefix="Joomla\Component\MokoBackup\Administrator\Field"
/>
<field
name="exclude_tables"
type="DatabaseTables"
label="COM_MOKOBACKUP_FIELD_EXCLUDE_TABLES"
description="COM_MOKOBACKUP_FIELD_EXCLUDE_TABLES_DESC"
filter="raw"
addfieldprefix="Joomla\Component\MokoBackup\Administrator\Field"
/>
</fieldset>
<fieldset name="remote" label="COM_MOKOBACKUP_FIELDSET_REMOTE">
<field
name="remote_storage"
type="list"
label="COM_MOKOBACKUP_FIELD_REMOTE_STORAGE"
description="COM_MOKOBACKUP_FIELD_REMOTE_STORAGE_DESC"
default="none"
>
<option value="none">COM_MOKOBACKUP_REMOTE_NONE</option>
<option value="ftp">COM_MOKOBACKUP_REMOTE_FTP</option>
<option value="google_drive">COM_MOKOBACKUP_REMOTE_GDRIVE</option>
<option value="s3">COM_MOKOBACKUP_REMOTE_S3</option>
</field>
<field
name="remote_keep_local"
type="radio"
label="COM_MOKOBACKUP_FIELD_KEEP_LOCAL"
description="COM_MOKOBACKUP_FIELD_KEEP_LOCAL_DESC"
default="1"
class="btn-group"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
</fieldset>
<fieldset name="notifications" label="COM_MOKOBACKUP_FIELDSET_NOTIFICATIONS">
<field
name="notify_email"
type="text"
label="COM_MOKOBACKUP_FIELD_NOTIFY_EMAIL"
description="COM_MOKOBACKUP_FIELD_NOTIFY_EMAIL_DESC"
maxlength="512"
hint="admin@example.com, backup@example.com"
/>
<field
name="notify_user_groups"
type="usergrouplist"
label="COM_MOKOBACKUP_FIELD_NOTIFY_USER_GROUPS"
description="COM_MOKOBACKUP_FIELD_NOTIFY_USER_GROUPS_DESC"
multiple="true"
layout="joomla.form.field.list-fancy-select"
/>
<field
name="notify_on_success"
type="radio"
label="COM_MOKOBACKUP_FIELD_NOTIFY_SUCCESS"
description="COM_MOKOBACKUP_FIELD_NOTIFY_SUCCESS_DESC"
default="0"
class="btn-group"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="notify_on_failure"
type="radio"
label="COM_MOKOBACKUP_FIELD_NOTIFY_FAILURE"
description="COM_MOKOBACKUP_FIELD_NOTIFY_FAILURE_DESC"
default="1"
class="btn-group"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
</fieldset>
<fieldset name="ftp" label="COM_MOKOBACKUP_FIELDSET_FTP">
<field
name="ftp_host"
type="text"
label="COM_MOKOBACKUP_FIELD_FTP_HOST"
description="COM_MOKOBACKUP_FIELD_FTP_HOST_DESC"
maxlength="255"
showon="remote_storage:ftp"
/>
<field
name="ftp_port"
type="number"
label="COM_MOKOBACKUP_FIELD_FTP_PORT"
description="COM_MOKOBACKUP_FIELD_FTP_PORT_DESC"
default="21"
min="1"
max="65535"
showon="remote_storage:ftp"
/>
<field
name="ftp_username"
type="text"
label="COM_MOKOBACKUP_FIELD_FTP_USERNAME"
maxlength="255"
showon="remote_storage:ftp"
/>
<field
name="ftp_password"
type="password"
label="COM_MOKOBACKUP_FIELD_FTP_PASSWORD"
maxlength="255"
showon="remote_storage:ftp"
/>
<field
name="ftp_path"
type="text"
label="COM_MOKOBACKUP_FIELD_FTP_PATH"
description="COM_MOKOBACKUP_FIELD_FTP_PATH_DESC"
default="/backups"
maxlength="512"
showon="remote_storage:ftp"
/>
<field
name="ftp_passive"
type="radio"
label="COM_MOKOBACKUP_FIELD_FTP_PASSIVE"
description="COM_MOKOBACKUP_FIELD_FTP_PASSIVE_DESC"
default="1"
class="btn-group"
showon="remote_storage:ftp"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="ftp_ssl"
type="radio"
label="COM_MOKOBACKUP_FIELD_FTP_SSL"
description="COM_MOKOBACKUP_FIELD_FTP_SSL_DESC"
default="0"
class="btn-group"
showon="remote_storage:ftp"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
</fieldset>
<fieldset name="google_drive" label="COM_MOKOBACKUP_FIELDSET_GDRIVE">
<field
name="gdrive_client_id"
type="text"
label="COM_MOKOBACKUP_FIELD_GDRIVE_CLIENT_ID"
description="COM_MOKOBACKUP_FIELD_GDRIVE_CLIENT_ID_DESC"
maxlength="255"
showon="remote_storage:google_drive"
/>
<field
name="gdrive_client_secret"
type="password"
label="COM_MOKOBACKUP_FIELD_GDRIVE_CLIENT_SECRET"
maxlength="255"
showon="remote_storage:google_drive"
/>
<field
name="gdrive_refresh_token"
type="text"
label="COM_MOKOBACKUP_FIELD_GDRIVE_REFRESH_TOKEN"
description="COM_MOKOBACKUP_FIELD_GDRIVE_REFRESH_TOKEN_DESC"
maxlength="512"
showon="remote_storage:google_drive"
/>
<field
name="gdrive_folder_id"
type="text"
label="COM_MOKOBACKUP_FIELD_GDRIVE_FOLDER_ID"
description="COM_MOKOBACKUP_FIELD_GDRIVE_FOLDER_ID_DESC"
maxlength="255"
showon="remote_storage:google_drive"
/>
</fieldset>
<fieldset name="s3" label="COM_MOKOBACKUP_FIELDSET_S3">
<field
name="s3_endpoint"
type="text"
label="COM_MOKOBACKUP_FIELD_S3_ENDPOINT"
description="COM_MOKOBACKUP_FIELD_S3_ENDPOINT_DESC"
maxlength="512"
hint="https://s3.amazonaws.com"
showon="remote_storage:s3"
/>
<field
name="s3_region"
type="text"
label="COM_MOKOBACKUP_FIELD_S3_REGION"
description="COM_MOKOBACKUP_FIELD_S3_REGION_DESC"
default="us-east-1"
maxlength="50"
showon="remote_storage:s3"
/>
<field
name="s3_access_key"
type="text"
label="COM_MOKOBACKUP_FIELD_S3_ACCESS_KEY"
maxlength="255"
showon="remote_storage:s3"
/>
<field
name="s3_secret_key"
type="password"
label="COM_MOKOBACKUP_FIELD_S3_SECRET_KEY"
maxlength="255"
showon="remote_storage:s3"
/>
<field
name="s3_bucket"
type="text"
label="COM_MOKOBACKUP_FIELD_S3_BUCKET"
description="COM_MOKOBACKUP_FIELD_S3_BUCKET_DESC"
maxlength="255"
showon="remote_storage:s3"
/>
<field
name="s3_path"
type="text"
label="COM_MOKOBACKUP_FIELD_S3_PATH"
description="COM_MOKOBACKUP_FIELD_S3_PATH_DESC"
default="/backups"
maxlength="512"
showon="remote_storage:s3"
/>
</fieldset>
</form>
@@ -1,264 +0,0 @@
; MokoJoomBackup — Component language file (en-GB)
; @package MokoJoomBackup
; @author Moko Consulting <hello@mokoconsulting.tech>
; @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
; @license GPL-3.0-or-later
COM_MOKOBACKUP="MokoJoomBackup"
COM_MOKOBACKUP_DESCRIPTION="Full-site backup and restore for Joomla"
; Submenu
COM_MOKOBACKUP_SUBMENU_DASHBOARD="Dashboard"
COM_MOKOBACKUP_SUBMENU_BACKUPS="Backup Records"
COM_MOKOBACKUP_SUBMENU_PROFILES="Backup Profiles"
; Dashboard view
COM_MOKOBACKUP_DASHBOARD_TITLE="MokoJoomBackup Dashboard"
COM_MOKOBACKUP_DASHBOARD_LAST_BACKUP="Last Backup"
COM_MOKOBACKUP_DASHBOARD_NO_BACKUPS="No backups yet"
COM_MOKOBACKUP_DASHBOARD_NEXT_SCHEDULED="Next Scheduled"
COM_MOKOBACKUP_DASHBOARD_NO_SCHEDULED="No tasks scheduled"
COM_MOKOBACKUP_DASHBOARD_TOTAL_BACKUPS="Total Backups"
COM_MOKOBACKUP_DASHBOARD_STORAGE="Storage Used"
COM_MOKOBACKUP_DASHBOARD_FAILURES_7D="%d failures (7 days)"
COM_MOKOBACKUP_DASHBOARD_QUICK_ACTIONS="Quick Actions"
COM_MOKOBACKUP_DASHBOARD_SCHEDULED_TASKS="Scheduled Tasks"
COM_MOKOBACKUP_DASHBOARD_UPDATE_SITE="Update Site"
COM_MOKOBACKUP_DASHBOARD_SYSTEM_HEALTH="System Health"
; Backups view
COM_MOKOBACKUP_BACKUPS_TITLE="Backup Records"
COM_MOKOBACKUP_BACKUPS_TABLE_CAPTION="Table of backup records"
COM_MOKOBACKUP_NO_BACKUPS="No backups found. Click 'Backup Now' to create your first backup."
COM_MOKOBACKUP_TOOLBAR_BACKUP_NOW="Backup Now"
COM_MOKOBACKUP_DOWNLOAD="Download"
; Backup detail view
COM_MOKOBACKUP_BACKUP_DETAIL="Backup Detail"
COM_MOKOBACKUP_VIEW_LOG="Backup Log"
COM_MOKOBACKUP_FIELD_CHECKSUM="SHA-256 Checksum"
COM_MOKOBACKUP_FIELD_PATH="File Path"
COM_MOKOBACKUP_FIELD_DB_SIZE="DB Size"
COM_MOKOBACKUP_FIELD_REMOTE="Remote Path"
; Profiles view
COM_MOKOBACKUP_PROFILES_TITLE="Backup Profiles"
COM_MOKOBACKUP_PROFILES_TABLE_CAPTION="Table of backup profiles"
COM_MOKOBACKUP_NO_PROFILES="No backup profiles found."
COM_MOKOBACKUP_PROFILE_NEW="New Profile"
COM_MOKOBACKUP_PROFILE_EDIT="Edit Profile"
; Table headings
COM_MOKOBACKUP_HEADING_DESCRIPTION="Description"
COM_MOKOBACKUP_HEADING_PROFILE="Profile"
COM_MOKOBACKUP_HEADING_STATUS="Status"
COM_MOKOBACKUP_HEADING_TYPE="Type"
COM_MOKOBACKUP_HEADING_SIZE="Size"
COM_MOKOBACKUP_HEADING_DATE="Date"
COM_MOKOBACKUP_HEADING_ACTIONS="Actions"
COM_MOKOBACKUP_HEADING_TITLE="Title"
COM_MOKOBACKUP_HEADING_DATE_DESC="Date descending"
COM_MOKOBACKUP_HEADING_DATE_ASC="Date ascending"
COM_MOKOBACKUP_HEADING_SIZE_DESC="Size descending"
COM_MOKOBACKUP_HEADING_SIZE_ASC="Size ascending"
COM_MOKOBACKUP_HEADING_TITLE_ASC="Title ascending"
COM_MOKOBACKUP_HEADING_TITLE_DESC="Title descending"
; General fields
COM_MOKOBACKUP_FIELD_TITLE="Title"
COM_MOKOBACKUP_FIELD_TITLE_DESC="Profile name"
COM_MOKOBACKUP_FIELD_DESCRIPTION="Description"
COM_MOKOBACKUP_FIELD_DESCRIPTION_DESC="Brief description of this profile"
COM_MOKOBACKUP_FIELD_BACKUP_TYPE="Backup Type"
COM_MOKOBACKUP_FIELD_BACKUP_TYPE_DESC="What to include in the backup"
COM_MOKOBACKUP_FIELD_STATUS="Status"
COM_MOKOBACKUP_FIELD_ORIGIN="Origin"
COM_MOKOBACKUP_FIELD_SIZE="Total Size"
COM_MOKOBACKUP_FIELD_START="Start Time"
COM_MOKOBACKUP_FIELD_END="End Time"
COM_MOKOBACKUP_FIELD_ARCHIVE="Archive Name"
COM_MOKOBACKUP_FIELD_FILES_COUNT="Files Count"
COM_MOKOBACKUP_FIELD_TABLES_COUNT="Tables Count"
; Archive settings
COM_MOKOBACKUP_FIELD_ARCHIVE_FORMAT="Archive Format"
COM_MOKOBACKUP_FIELD_ARCHIVE_FORMAT_DESC="Format for the backup archive file"
COM_MOKOBACKUP_FIELD_COMPRESSION="Compression Level"
COM_MOKOBACKUP_FIELD_COMPRESSION_DESC="Higher compression = smaller file but slower"
COM_MOKOBACKUP_COMPRESSION_NONE="None (fastest)"
COM_MOKOBACKUP_COMPRESSION_FASTEST="Low (fast)"
COM_MOKOBACKUP_COMPRESSION_NORMAL="Normal (balanced)"
COM_MOKOBACKUP_COMPRESSION_BEST="Maximum (smallest)"
COM_MOKOBACKUP_FIELD_ENCRYPTION_PASSWORD="Encryption Password"
COM_MOKOBACKUP_FIELD_ENCRYPTION_PASSWORD_DESC="Set a password to encrypt the backup archive with AES-256. Leave blank for no encryption. Required to restore encrypted backups."
COM_MOKOBACKUP_FIELD_SPLIT_SIZE="Split Size (MB)"
COM_MOKOBACKUP_FIELD_SPLIT_SIZE_DESC="Split archive into parts of this size in MB. 0 = no splitting."
COM_MOKOBACKUP_FIELD_BACKUP_DIR="Backup Directory"
COM_MOKOBACKUP_FIELD_BACKUP_DIR_DESC="Directory where backup archives are stored. Supports placeholders: [host], [date], [year], [month], [day], [profile_name], [site_name], [type]. Absolute paths (starting with /) are used as-is; relative paths resolve from the Joomla root."
COM_MOKOBACKUP_FIELD_ARCHIVE_NAME_FORMAT="Archive Name Format"
COM_MOKOBACKUP_FIELD_ARCHIVE_NAME_FORMAT_DESC="Filename template for backup archives (without extension). Placeholders: [host] hostname, [date] Ymd, [time] His, [datetime] Ymd_His, [year] [month] [day] [hour] [minute] [second], [profile_id], [profile_name], [site_name], [type], [random]."
COM_MOKOBACKUP_FIELD_INCLUDE_MOKORESTORE="Include Restore Script"
COM_MOKOBACKUP_FIELD_INCLUDE_MOKORESTORE_DESC="Include MokoRestore (standalone restore.php) inside the backup archive. Creates a self-contained package that can restore the site on a blank server without Joomla installed."
; Exclusion filter fields
COM_MOKOBACKUP_FIELD_EXCLUDE_DIRS="Exclude Directories"
COM_MOKOBACKUP_FIELD_EXCLUDE_DIRS_DESC="Browse and check directories to exclude from file backup. You can also type paths manually."
COM_MOKOBACKUP_FILTER_EXCLUDED="Excluded"
COM_MOKOBACKUP_FILTER_INCLUDED="Included"
COM_MOKOBACKUP_FILTER_ADD_MANUAL="Add Path"
COM_MOKOBACKUP_FIELD_EXCLUDE_FILES="Exclude Files"
COM_MOKOBACKUP_FIELD_EXCLUDE_FILES_DESC="One filename or pattern per line. Supports wildcards (e.g. *.bak, *.tmp)."
COM_MOKOBACKUP_FIELD_EXCLUDE_TABLES="Exclude Tables"
COM_MOKOBACKUP_FIELD_EXCLUDE_TABLES_DESC="One table name per line (use #__ prefix). These tables will be skipped during database dump."
; Remote storage fields
COM_MOKOBACKUP_FIELD_REMOTE_STORAGE="Remote Storage"
COM_MOKOBACKUP_FIELD_REMOTE_STORAGE_DESC="Optionally upload backup archives to a remote location after creation"
COM_MOKOBACKUP_REMOTE_NONE="None (local only)"
COM_MOKOBACKUP_REMOTE_FTP="FTP / FTPS"
COM_MOKOBACKUP_REMOTE_GDRIVE="Google Drive"
COM_MOKOBACKUP_FIELD_KEEP_LOCAL="Keep Local Copy"
COM_MOKOBACKUP_FIELD_KEEP_LOCAL_DESC="Keep the local backup file after uploading to remote storage"
; FTP fields
COM_MOKOBACKUP_FIELD_FTP_HOST="FTP Host"
COM_MOKOBACKUP_FIELD_FTP_HOST_DESC="FTP server hostname or IP address"
COM_MOKOBACKUP_FIELD_FTP_PORT="FTP Port"
COM_MOKOBACKUP_FIELD_FTP_PORT_DESC="FTP server port (default: 21)"
COM_MOKOBACKUP_FIELD_FTP_USERNAME="FTP Username"
COM_MOKOBACKUP_FIELD_FTP_PASSWORD="FTP Password"
COM_MOKOBACKUP_FIELD_FTP_PATH="Remote Path"
COM_MOKOBACKUP_FIELD_FTP_PATH_DESC="Directory on the FTP server to upload backups to"
COM_MOKOBACKUP_FIELD_FTP_PASSIVE="Passive Mode"
COM_MOKOBACKUP_FIELD_FTP_PASSIVE_DESC="Use passive mode for FTP connections (recommended)"
COM_MOKOBACKUP_FIELD_FTP_SSL="Use FTPS (SSL)"
COM_MOKOBACKUP_FIELD_FTP_SSL_DESC="Connect using FTPS (FTP over SSL/TLS)"
; Google Drive fields
COM_MOKOBACKUP_FIELD_GDRIVE_CLIENT_ID="Google Client ID"
COM_MOKOBACKUP_FIELD_GDRIVE_CLIENT_ID_DESC="OAuth 2.0 Client ID from Google Cloud Console"
COM_MOKOBACKUP_FIELD_GDRIVE_CLIENT_SECRET="Google Client Secret"
COM_MOKOBACKUP_FIELD_GDRIVE_REFRESH_TOKEN="Refresh Token"
COM_MOKOBACKUP_FIELD_GDRIVE_REFRESH_TOKEN_DESC="OAuth 2.0 refresh token for offline access"
COM_MOKOBACKUP_FIELD_GDRIVE_FOLDER_ID="Drive Folder ID"
COM_MOKOBACKUP_FIELD_GDRIVE_FOLDER_ID_DESC="Google Drive folder ID where backups will be uploaded. Find this in the folder URL."
; Backup types
COM_MOKOBACKUP_TYPE_FULL="Full Site (Database + Files)"
COM_MOKOBACKUP_TYPE_DATABASE="Database Only"
COM_MOKOBACKUP_TYPE_FILES="Files Only"
COM_MOKOBACKUP_TYPE_DIFFERENTIAL="Differential (changed files + full DB)"
; Status labels
COM_MOKOBACKUP_STATUS_COMPLETE="Complete"
COM_MOKOBACKUP_STATUS_RUNNING="Running"
COM_MOKOBACKUP_STATUS_FAIL="Failed"
COM_MOKOBACKUP_STATUS_PENDING="Pending"
; Filters
COM_MOKOBACKUP_FILTER_SEARCH="Search"
COM_MOKOBACKUP_FILTER_STATUS="Status"
COM_MOKOBACKUP_FILTER_STATUS_ALL="- Select Status -"
; Tabs and fieldsets
COM_MOKOBACKUP_TAB_GENERAL="General"
COM_MOKOBACKUP_TAB_ARCHIVE="Archive Settings"
COM_MOKOBACKUP_TAB_FILTERS="Exclusion Filters"
COM_MOKOBACKUP_TAB_REMOTE="Remote Storage"
COM_MOKOBACKUP_FIELDSET_GENERAL="General"
COM_MOKOBACKUP_FIELDSET_ARCHIVE="Archive Settings"
COM_MOKOBACKUP_FIELDSET_STATUS="Status"
COM_MOKOBACKUP_FIELDSET_FILTERS="Exclusion Filters"
COM_MOKOBACKUP_FIELDSET_REMOTE="Remote Storage"
COM_MOKOBACKUP_FIELDSET_FTP="FTP Settings"
COM_MOKOBACKUP_FIELDSET_GDRIVE="Google Drive Settings"
; Backup profile selector
COM_MOKOBACKUP_BACKUP_PROFILE="Backup Profile"
; Restore
COM_MOKOBACKUP_TOOLBAR_RESTORE="Restore"
COM_MOKOBACKUP_RESTORE_CONFIRM="WARNING: Restoring will overwrite your current site files and/or database. Are you sure you want to continue?"
; Notifications
COM_MOKOBACKUP_TAB_NOTIFICATIONS="Notifications"
COM_MOKOBACKUP_FIELDSET_NOTIFICATIONS="Email Notifications"
COM_MOKOBACKUP_FIELD_NOTIFY_EMAIL="Notification Email(s)"
COM_MOKOBACKUP_FIELD_NOTIFY_EMAIL_DESC="Comma-separated list of email addresses to notify. Leave empty to disable notifications."
COM_MOKOBACKUP_FIELD_NOTIFY_SUCCESS="Notify on Success"
COM_MOKOBACKUP_FIELD_NOTIFY_SUCCESS_DESC="Send an email when a backup completes successfully."
COM_MOKOBACKUP_FIELD_NOTIFY_FAILURE="Notify on Failure"
COM_MOKOBACKUP_FIELD_NOTIFY_FAILURE_DESC="Send an email when a backup fails. Includes log excerpt for debugging."
; Integrity verification
COM_MOKOBACKUP_TOOLBAR_VERIFY="Verify Integrity"
COM_MOKOBACKUP_VERIFY_OK="Archive integrity verified — SHA-256 checksum matches."
COM_MOKOBACKUP_VERIFY_FAILED="INTEGRITY CHECK FAILED — archive has been modified or corrupted since backup."
COM_MOKOBACKUP_VERIFY_NO_CHECKSUM="No checksum stored for this backup. Only backups created after this update can be verified."
; S3 storage
COM_MOKOBACKUP_REMOTE_S3="Amazon S3 / S3-Compatible"
COM_MOKOBACKUP_FIELDSET_S3="S3 Storage Settings"
COM_MOKOBACKUP_FIELD_S3_ENDPOINT="S3 Endpoint"
COM_MOKOBACKUP_FIELD_S3_ENDPOINT_DESC="S3 API endpoint URL. Leave blank for AWS S3. For Wasabi, MinIO, Backblaze B2, enter their endpoint URL."
COM_MOKOBACKUP_FIELD_S3_REGION="Region"
COM_MOKOBACKUP_FIELD_S3_REGION_DESC="AWS region (e.g. us-east-1, eu-west-1). Required for AWS Signature V4."
COM_MOKOBACKUP_FIELD_S3_ACCESS_KEY="Access Key"
COM_MOKOBACKUP_FIELD_S3_SECRET_KEY="Secret Key"
COM_MOKOBACKUP_FIELD_S3_BUCKET="Bucket Name"
COM_MOKOBACKUP_FIELD_S3_BUCKET_DESC="S3 bucket name where backups will be stored."
COM_MOKOBACKUP_FIELD_S3_PATH="Path Prefix"
COM_MOKOBACKUP_FIELD_S3_PATH_DESC="Optional path prefix inside the bucket (e.g. /backups or /sites/mysite)."
; Akeeba Import
COM_MOKOBACKUP_TOOLBAR_IMPORT_AKEEBA="Import from Akeeba"
COM_MOKOBACKUP_AKEEBA_NOT_FOUND="Akeeba Backup tables not found. Is Akeeba Backup Pro installed?"
; Update site notice
COM_MOKOBACKUP_UPDATE_SITE_NOTICE="To receive automatic updates, configure your <a href=\"%s\">Update Site</a> with your download key."
COM_MOKOBACKUP_UPDATE_SITE_MISSING="MokoJoomBackup update site not found. Reinstall the package to register the update server."
COM_MOKOBACKUP_POSTINSTALL_UPDATE_SITE="MokoJoomBackup installed successfully. Configure your <a href=\"%s\">Update Site</a> to receive automatic updates."
; Component Options (config.xml)
COM_MOKOBACKUP_CONFIG_GENERAL="General"
COM_MOKOBACKUP_CONFIG_DEFAULT_BACKUP_DIR="Default Backup Directory"
COM_MOKOBACKUP_CONFIG_DEFAULT_BACKUP_DIR_DESC="Default directory for backup archives, relative to Joomla root. Can be overridden per profile."
COM_MOKOBACKUP_CONFIG_DEFAULT_PROFILE="Default Profile"
COM_MOKOBACKUP_CONFIG_DEFAULT_PROFILE_DESC="Default backup profile used by quick actions and CLI when no profile is specified."
COM_MOKOBACKUP_CONFIG_SHOW_UPDATE_NOTICE="Show Update Site Notice"
COM_MOKOBACKUP_CONFIG_SHOW_UPDATE_NOTICE_DESC="Display the update site configuration notice on the Backup Records view."
COM_MOKOBACKUP_CONFIG_CLEANUP="Cleanup Defaults"
COM_MOKOBACKUP_CONFIG_MAX_AGE="Max Backup Age (days)"
COM_MOKOBACKUP_CONFIG_MAX_AGE_DESC="Default maximum age for backup records. Used by the system plugin and CLI cleanup command."
COM_MOKOBACKUP_CONFIG_MAX_BACKUPS="Max Backup Count"
COM_MOKOBACKUP_CONFIG_MAX_BACKUPS_DESC="Default maximum number of completed backups to retain."
COM_MOKOBACKUP_CONFIG_NOTIFICATIONS="Notifications"
COM_MOKOBACKUP_CONFIG_NOTIFY_EMAIL="Global Notification Email(s)"
COM_MOKOBACKUP_CONFIG_NOTIFY_EMAIL_DESC="Comma-separated list of email addresses for global backup notifications. Per-profile settings override this."
COM_MOKOBACKUP_CONFIG_NOTIFY_SUCCESS="Notify on Success"
COM_MOKOBACKUP_CONFIG_NOTIFY_SUCCESS_DESC="Send email when any backup completes successfully (unless overridden by profile)."
COM_MOKOBACKUP_CONFIG_NOTIFY_FAILURE="Notify on Failure"
COM_MOKOBACKUP_CONFIG_NOTIFY_FAILURE_DESC="Send email when any backup fails (unless overridden by profile)."
; Folder picker
COM_MOKOBACKUP_FOLDER_EXISTS="Directory exists"
COM_MOKOBACKUP_FOLDER_NOT_FOUND="Directory not found"
COM_MOKOBACKUP_BACKUP_DIR_DEFAULT="Default (inside web root)"
; Exclude fields
COM_MOKOBACKUP_FIELD_EXCLUDE_TABLES_HELP="Check tables to exclude from database backup. Use Data to skip row data (keeps structure), Structure to skip CREATE TABLE, or both to fully exclude."
COM_MOKOBACKUP_FIELD_EXCLUDE_DATA="Data"
COM_MOKOBACKUP_FIELD_EXCLUDE_STRUCTURE="Structure"
COM_MOKOBACKUP_FIELD_TABLE_NAME="Table Name"
; User group notifications
COM_MOKOBACKUP_FIELD_NOTIFY_USER_GROUPS="Notify User Groups"
COM_MOKOBACKUP_FIELD_NOTIFY_USER_GROUPS_DESC="Select Joomla user groups whose members will receive backup notifications. Combined with email addresses above."
; Dashboard warnings
COM_MOKOBACKUP_DASHBOARD_DEFAULT_DIR_WARNING_TITLE="Backup directory is inside the web root"
COM_MOKOBACKUP_DASHBOARD_DEFAULT_DIR_WARNING="One or more profiles store backups in the default directory inside the web root. This may expose backup archives if .htaccess is not supported. Move backups to a directory outside the web root for better security."
; Errors
COM_MOKOBACKUP_ERROR_FILE_NOT_FOUND="Backup archive file not found or has been deleted."
COM_MOKOBACKUP_ERROR_NO_RECORD_SELECTED="No backup record selected for restore."
@@ -1,10 +0,0 @@
; MokoJoomBackup — Component system language file (en-GB)
; @package MokoJoomBackup
; @author Moko Consulting <hello@mokoconsulting.tech>
; @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
; @license GPL-3.0-or-later
COM_MOKOBACKUP="MokoJoomBackup"
COM_MOKOBACKUP_DESCRIPTION="Full-site backup and restore for Joomla — database, files, and configuration."
COM_MOKOBACKUP_SUBMENU_BACKUPS="Backup Records"
COM_MOKOBACKUP_SUBMENU_PROFILES="Backup Profiles"
@@ -1,69 +0,0 @@
; MokoJoomBackup — Component language file (en-US)
; @package MokoJoomBackup
; @author Moko Consulting <hello@mokoconsulting.tech>
; @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
; @license GPL-3.0-or-later
COM_MOKOBACKUP="MokoJoomBackup"
COM_MOKOBACKUP_DESCRIPTION="Full-site backup and restore for Joomla"
COM_MOKOBACKUP_SUBMENU_DASHBOARD="Dashboard"
COM_MOKOBACKUP_SUBMENU_BACKUPS="Backup Records"
COM_MOKOBACKUP_SUBMENU_PROFILES="Backup Profiles"
COM_MOKOBACKUP_DASHBOARD_TITLE="MokoJoomBackup Dashboard"
COM_MOKOBACKUP_DASHBOARD_LAST_BACKUP="Last Backup"
COM_MOKOBACKUP_DASHBOARD_NO_BACKUPS="No backups yet"
COM_MOKOBACKUP_DASHBOARD_NEXT_SCHEDULED="Next Scheduled"
COM_MOKOBACKUP_DASHBOARD_NO_SCHEDULED="No tasks scheduled"
COM_MOKOBACKUP_DASHBOARD_TOTAL_BACKUPS="Total Backups"
COM_MOKOBACKUP_DASHBOARD_STORAGE="Storage Used"
COM_MOKOBACKUP_DASHBOARD_FAILURES_7D="%d failures (7 days)"
COM_MOKOBACKUP_DASHBOARD_QUICK_ACTIONS="Quick Actions"
COM_MOKOBACKUP_DASHBOARD_SCHEDULED_TASKS="Scheduled Tasks"
COM_MOKOBACKUP_DASHBOARD_UPDATE_SITE="Update Site"
COM_MOKOBACKUP_DASHBOARD_SYSTEM_HEALTH="System Health"
COM_MOKOBACKUP_BACKUPS_TITLE="Backup Records"
COM_MOKOBACKUP_PROFILES_TITLE="Backup Profiles"
COM_MOKOBACKUP_TOOLBAR_BACKUP_NOW="Backup Now"
COM_MOKOBACKUP_NO_BACKUPS="No backups found. Click 'Backup Now' to create your first backup."
COM_MOKOBACKUP_NO_PROFILES="No backup profiles found."
COM_MOKOBACKUP_UPDATE_SITE_NOTICE="To receive automatic updates, configure your <a href=\"%s\">Update Site</a> with your download key."
COM_MOKOBACKUP_UPDATE_SITE_MISSING="MokoJoomBackup update site not found. Reinstall the package to register the update server."
COM_MOKOBACKUP_POSTINSTALL_UPDATE_SITE="MokoJoomBackup installed successfully. Configure your <a href=\"%s\">Update Site</a> to receive automatic updates."
COM_MOKOBACKUP_CONFIG_GENERAL="General"
COM_MOKOBACKUP_CONFIG_DEFAULT_BACKUP_DIR="Default Backup Directory"
COM_MOKOBACKUP_CONFIG_DEFAULT_BACKUP_DIR_DESC="Default directory for backup archives, relative to Joomla root. Can be overridden per profile."
COM_MOKOBACKUP_CONFIG_DEFAULT_PROFILE="Default Profile"
COM_MOKOBACKUP_CONFIG_DEFAULT_PROFILE_DESC="Default backup profile used by quick actions and CLI when no profile is specified."
COM_MOKOBACKUP_CONFIG_SHOW_UPDATE_NOTICE="Show Update Site Notice"
COM_MOKOBACKUP_CONFIG_SHOW_UPDATE_NOTICE_DESC="Display the update site configuration notice on the Backup Records view."
COM_MOKOBACKUP_CONFIG_CLEANUP="Cleanup Defaults"
COM_MOKOBACKUP_CONFIG_MAX_AGE="Max Backup Age (days)"
COM_MOKOBACKUP_CONFIG_MAX_AGE_DESC="Default maximum age for backup records. Used by the system plugin and CLI cleanup command."
COM_MOKOBACKUP_CONFIG_MAX_BACKUPS="Max Backup Count"
COM_MOKOBACKUP_CONFIG_MAX_BACKUPS_DESC="Default maximum number of completed backups to retain."
COM_MOKOBACKUP_CONFIG_NOTIFICATIONS="Notifications"
COM_MOKOBACKUP_CONFIG_NOTIFY_EMAIL="Global Notification Email(s)"
COM_MOKOBACKUP_CONFIG_NOTIFY_EMAIL_DESC="Comma-separated list of email addresses for global backup notifications. Per-profile settings override this."
COM_MOKOBACKUP_CONFIG_NOTIFY_SUCCESS="Notify on Success"
COM_MOKOBACKUP_CONFIG_NOTIFY_SUCCESS_DESC="Send email when any backup completes successfully (unless overridden by profile)."
COM_MOKOBACKUP_CONFIG_NOTIFY_FAILURE="Notify on Failure"
COM_MOKOBACKUP_CONFIG_NOTIFY_FAILURE_DESC="Send email when any backup fails (unless overridden by profile)."
COM_MOKOBACKUP_FOLDER_EXISTS="Directory exists"
COM_MOKOBACKUP_FOLDER_NOT_FOUND="Directory not found"
COM_MOKOBACKUP_BACKUP_DIR_DEFAULT="Default (inside web root)"
COM_MOKOBACKUP_DASHBOARD_DEFAULT_DIR_WARNING_TITLE="Backup directory is inside the web root"
COM_MOKOBACKUP_DASHBOARD_DEFAULT_DIR_WARNING="One or more profiles store backups in the default directory inside the web root. This may expose backup archives if .htaccess is not supported. Move backups to a directory outside the web root for better security."
COM_MOKOBACKUP_FOLDER_EXISTS="Directory exists"
COM_MOKOBACKUP_FOLDER_NOT_FOUND="Directory not found"
COM_MOKOBACKUP_BACKUP_DIR_DEFAULT="Default (inside web root)"
COM_MOKOBACKUP_FIELD_EXCLUDE_TABLES_HELP="Check tables to exclude from database backup. Use Data to skip row data (keeps structure), Structure to skip CREATE TABLE, or both to fully exclude."
COM_MOKOBACKUP_FIELD_EXCLUDE_DATA="Data"
COM_MOKOBACKUP_FIELD_EXCLUDE_STRUCTURE="Structure"
COM_MOKOBACKUP_FIELD_TABLE_NAME="Table Name"
COM_MOKOBACKUP_VIEW_LOG="Backup Log"
COM_MOKOBACKUP_FIELD_CHECKSUM="SHA-256 Checksum"
COM_MOKOBACKUP_FIELD_PATH="File Path"
COM_MOKOBACKUP_FIELD_DB_SIZE="DB Size"
COM_MOKOBACKUP_FIELD_REMOTE="Remote Path"
COM_MOKOBACKUP_FIELD_NOTIFY_USER_GROUPS="Notify User Groups"
COM_MOKOBACKUP_FIELD_NOTIFY_USER_GROUPS_DESC="Select Joomla user groups whose members will receive backup notifications. Combined with email addresses above."
@@ -1,10 +0,0 @@
; MokoJoomBackup — Component system language file (en-US)
; @package MokoJoomBackup
; @author Moko Consulting <hello@mokoconsulting.tech>
; @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
; @license GPL-3.0-or-later
COM_MOKOBACKUP="MokoJoomBackup"
COM_MOKOBACKUP_DESCRIPTION="Full-site backup and restore for Joomla — database, files, and configuration."
COM_MOKOBACKUP_SUBMENU_BACKUPS="Backup Records"
COM_MOKOBACKUP_SUBMENU_PROFILES="Backup Profiles"
@@ -1,2 +0,0 @@
DROP TABLE IF EXISTS `#__mokobackup_records`;
DROP TABLE IF EXISTS `#__mokobackup_profiles`;
@@ -1 +0,0 @@
ALTER TABLE `#__mokobackup_profiles` CHANGE `include_kickstart` `include_mokorestore` TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'Include MokoRestore standalone restore script in archive';
@@ -1,12 +0,0 @@
-- MokoJoomBackup 01.01.02
-- Consolidated schema updates: NULL defaults, notifications, archive name format
-- Fix: allow NULL defaults for manifest and log columns
ALTER TABLE `#__mokobackup_records` MODIFY `manifest` LONGTEXT DEFAULT NULL;
ALTER TABLE `#__mokobackup_records` MODIFY `log` MEDIUMTEXT DEFAULT NULL;
-- Add user group notifications column to profiles
ALTER TABLE `#__mokobackup_profiles` ADD COLUMN `notify_user_groups` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Comma-separated Joomla user group IDs' AFTER `notify_email`;
-- Add archive_name_format column with placeholder support
ALTER TABLE `#__mokobackup_profiles` ADD COLUMN `archive_name_format` VARCHAR(512) NOT NULL DEFAULT '[host]_[datetime]_profile[profile_id]' COMMENT 'Filename format with placeholders' AFTER `backup_dir`;
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -10,7 +10,7 @@
* CLI backup script for cron/scheduled use. * CLI backup script for cron/scheduled use.
* *
* Usage: * Usage:
* php cli/mokobackup.php --profile=1 --description="Scheduled backup" * php cli/mokojoombackup.php --profile=1 --description="Scheduled backup"
* *
* Must be run from the Joomla root directory. * Must be run from the Joomla root directory.
*/ */
@@ -30,7 +30,7 @@ if (!defined('JPATH_BASE')) {
require_once JPATH_BASE . '/includes/framework.php'; require_once JPATH_BASE . '/includes/framework.php';
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\Component\MokoBackup\Administrator\Engine\BackupEngine; use Joomla\Component\MokoJoomBackup\Administrator\Engine\BackupEngine;
// Parse CLI arguments // Parse CLI arguments
$profileId = 1; $profileId = 1;
@@ -2,18 +2,18 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Api\Controller; namespace Joomla\Component\MokoJoomBackup\Api\Controller;
defined('_JEXEC') or die; defined('_JEXEC') or die;
use Joomla\CMS\MVC\Controller\ApiController; use Joomla\CMS\MVC\Controller\ApiController;
use Joomla\Component\MokoBackup\Administrator\Engine\BackupEngine; use Joomla\Component\MokoJoomBackup\Administrator\Engine\BackupEngine;
class BackupsController extends ApiController class BackupsController extends ApiController
{ {
@@ -21,7 +21,7 @@ class BackupsController extends ApiController
protected $default_view = 'backups'; protected $default_view = 'backups';
/** /**
* Start a new backup (POST /api/index.php/v1/mokobackup/backup) * Start a new backup (POST /api/index.php/v1/mokojoombackup/backup)
*/ */
public function backup(): static public function backup(): static
{ {
@@ -47,7 +47,7 @@ class BackupsController extends ApiController
} }
/** /**
* Download a backup archive (GET /api/index.php/v1/mokobackup/backup/:id/download) * Download a backup archive (GET /api/index.php/v1/mokojoombackup/backup/:id/download)
*/ */
public function download(): static public function download(): static
{ {
@@ -74,7 +74,7 @@ class BackupsController extends ApiController
} }
/** /**
* List backup profiles (GET /api/index.php/v1/mokobackup/profiles) * List backup profiles (GET /api/index.php/v1/mokojoombackup/profiles)
*/ */
public function profiles(): static public function profiles(): static
{ {
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Api\View\Backups; namespace Joomla\Component\MokoJoomBackup\Api\View\Backups;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -1,27 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
--> -->
<config> <config>
<fieldset name="general" label="COM_MOKOBACKUP_CONFIG_GENERAL"> <fieldset name="general" label="COM_MOKOJOOMBACKUP_CONFIG_GENERAL">
<field <field
name="default_backup_dir" name="default_backup_dir"
type="FolderPicker" type="FolderPicker"
label="COM_MOKOBACKUP_CONFIG_DEFAULT_BACKUP_DIR" label="COM_MOKOJOOMBACKUP_CONFIG_DEFAULT_BACKUP_DIR"
description="COM_MOKOBACKUP_CONFIG_DEFAULT_BACKUP_DIR_DESC" description="COM_MOKOJOOMBACKUP_CONFIG_DEFAULT_BACKUP_DIR_DESC"
default="administrator/components/com_mokobackup/backups" default="administrator/components/com_mokojoombackup/backups"
addfieldprefix="Joomla\Component\MokoBackup\Administrator\Field" addfieldprefix="Joomla\Component\MokoJoomBackup\Administrator\Field"
/> />
<field <field
name="default_profile" name="default_profile"
type="sql" type="sql"
label="COM_MOKOBACKUP_CONFIG_DEFAULT_PROFILE" label="COM_MOKOJOOMBACKUP_CONFIG_DEFAULT_PROFILE"
description="COM_MOKOBACKUP_CONFIG_DEFAULT_PROFILE_DESC" description="COM_MOKOJOOMBACKUP_CONFIG_DEFAULT_PROFILE_DESC"
query="SELECT id AS value, title AS text FROM #__mokobackup_profiles WHERE published = 1 ORDER BY ordering ASC" query="SELECT id AS value, title AS text FROM #__mokojoombackup_profiles WHERE published = 1 ORDER BY ordering ASC"
default="1" default="1"
> >
<option value="1">Default Backup Profile</option> <option value="1">Default Backup Profile</option>
@@ -29,8 +29,8 @@
<field <field
name="show_update_notice" name="show_update_notice"
type="radio" type="radio"
label="COM_MOKOBACKUP_CONFIG_SHOW_UPDATE_NOTICE" label="COM_MOKOJOOMBACKUP_CONFIG_SHOW_UPDATE_NOTICE"
description="COM_MOKOBACKUP_CONFIG_SHOW_UPDATE_NOTICE_DESC" description="COM_MOKOJOOMBACKUP_CONFIG_SHOW_UPDATE_NOTICE_DESC"
default="1" default="1"
class="btn-group" class="btn-group"
> >
@@ -39,12 +39,12 @@
</field> </field>
</fieldset> </fieldset>
<fieldset name="cleanup" label="COM_MOKOBACKUP_CONFIG_CLEANUP"> <fieldset name="cleanup" label="COM_MOKOJOOMBACKUP_CONFIG_CLEANUP">
<field <field
name="max_age_days" name="max_age_days"
type="number" type="number"
label="COM_MOKOBACKUP_CONFIG_MAX_AGE" label="COM_MOKOJOOMBACKUP_CONFIG_MAX_AGE"
description="COM_MOKOBACKUP_CONFIG_MAX_AGE_DESC" description="COM_MOKOJOOMBACKUP_CONFIG_MAX_AGE_DESC"
default="30" default="30"
min="1" min="1"
max="365" max="365"
@@ -52,28 +52,28 @@
<field <field
name="max_backups" name="max_backups"
type="number" type="number"
label="COM_MOKOBACKUP_CONFIG_MAX_BACKUPS" label="COM_MOKOJOOMBACKUP_CONFIG_MAX_BACKUPS"
description="COM_MOKOBACKUP_CONFIG_MAX_BACKUPS_DESC" description="COM_MOKOJOOMBACKUP_CONFIG_MAX_BACKUPS_DESC"
default="10" default="10"
min="1" min="1"
max="100" max="100"
/> />
</fieldset> </fieldset>
<fieldset name="notifications" label="COM_MOKOBACKUP_CONFIG_NOTIFICATIONS"> <fieldset name="notifications" label="COM_MOKOJOOMBACKUP_CONFIG_NOTIFICATIONS">
<field <field
name="notify_email" name="notify_email"
type="text" type="text"
label="COM_MOKOBACKUP_CONFIG_NOTIFY_EMAIL" label="COM_MOKOJOOMBACKUP_CONFIG_NOTIFY_EMAIL"
description="COM_MOKOBACKUP_CONFIG_NOTIFY_EMAIL_DESC" description="COM_MOKOJOOMBACKUP_CONFIG_NOTIFY_EMAIL_DESC"
default="" default=""
filter="string" filter="string"
/> />
<field <field
name="notify_on_success" name="notify_on_success"
type="radio" type="radio"
label="COM_MOKOBACKUP_CONFIG_NOTIFY_SUCCESS" label="COM_MOKOJOOMBACKUP_CONFIG_NOTIFY_SUCCESS"
description="COM_MOKOBACKUP_CONFIG_NOTIFY_SUCCESS_DESC" description="COM_MOKOJOOMBACKUP_CONFIG_NOTIFY_SUCCESS_DESC"
default="0" default="0"
class="btn-group" class="btn-group"
> >
@@ -83,8 +83,8 @@
<field <field
name="notify_on_failure" name="notify_on_failure"
type="radio" type="radio"
label="COM_MOKOBACKUP_CONFIG_NOTIFY_FAILURE" label="COM_MOKOJOOMBACKUP_CONFIG_NOTIFY_FAILURE"
description="COM_MOKOBACKUP_CONFIG_NOTIFY_FAILURE_DESC" description="COM_MOKOJOOMBACKUP_CONFIG_NOTIFY_FAILURE_DESC"
default="1" default="1"
class="btn-group" class="btn-group"
> >
@@ -101,7 +101,7 @@
label="JCONFIG_PERMISSIONS_LABEL" label="JCONFIG_PERMISSIONS_LABEL"
filter="rules" filter="rules"
validate="rules" validate="rules"
component="com_mokobackup" component="com_mokojoombackup"
section="component" section="component"
/> />
</fieldset> </fieldset>
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<form>
<fieldset name="general">
<field name="id" type="hidden" />
<field name="profile_id" type="hidden" />
<field name="description" type="text" label="COM_MOKOJOOMBACKUP_FIELD_DESCRIPTION" readonly="true" />
<field name="status" type="text" label="COM_MOKOJOOMBACKUP_FIELD_STATUS" readonly="true" />
<field name="origin" type="text" label="COM_MOKOJOOMBACKUP_FIELD_ORIGIN" readonly="true" />
<field name="backup_type" type="text" label="COM_MOKOJOOMBACKUP_FIELD_BACKUP_TYPE" readonly="true" />
<field name="archivename" type="text" label="COM_MOKOJOOMBACKUP_FIELD_ARCHIVE" readonly="true" />
<field name="total_size" type="text" label="COM_MOKOJOOMBACKUP_FIELD_SIZE" readonly="true" />
<field name="backupstart" type="text" label="COM_MOKOJOOMBACKUP_FIELD_START" readonly="true" />
<field name="backupend" type="text" label="COM_MOKOJOOMBACKUP_FIELD_END" readonly="true" />
</fieldset>
</form>
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<form>
<fields name="filter">
<field
name="search"
type="text"
label="COM_MOKOJOOMBACKUP_FILTER_SEARCH"
hint="JSEARCH_FILTER"
/>
<field
name="status"
type="list"
label="COM_MOKOJOOMBACKUP_FILTER_STATUS"
onchange="this.form.submit();"
>
<option value="">COM_MOKOJOOMBACKUP_FILTER_STATUS_ALL</option>
<option value="complete">COM_MOKOJOOMBACKUP_STATUS_COMPLETE</option>
<option value="running">COM_MOKOJOOMBACKUP_STATUS_RUNNING</option>
<option value="fail">COM_MOKOJOOMBACKUP_STATUS_FAIL</option>
<option value="pending">COM_MOKOJOOMBACKUP_STATUS_PENDING</option>
</field>
</fields>
<fields name="list">
<field
name="fullordering"
type="list"
label="JGLOBAL_SORT_BY"
default="a.backupstart DESC"
onchange="this.form.submit();"
>
<option value="a.backupstart DESC">COM_MOKOJOOMBACKUP_HEADING_DATE_DESC</option>
<option value="a.backupstart ASC">COM_MOKOJOOMBACKUP_HEADING_DATE_ASC</option>
<option value="a.total_size DESC">COM_MOKOJOOMBACKUP_HEADING_SIZE_DESC</option>
<option value="a.total_size ASC">COM_MOKOJOOMBACKUP_HEADING_SIZE_ASC</option>
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
</field>
<field
name="limit"
type="limitbox"
label="JGLOBAL_LIST_LIMIT"
default="25"
onchange="this.form.submit();"
/>
</fields>
</form>
@@ -4,7 +4,7 @@
<field <field
name="search" name="search"
type="text" type="text"
label="COM_MOKOBACKUP_FILTER_SEARCH" label="COM_MOKOJOOMBACKUP_FILTER_SEARCH"
hint="JSEARCH_FILTER" hint="JSEARCH_FILTER"
/> />
<field <field
@@ -28,8 +28,8 @@
onchange="this.form.submit();" onchange="this.form.submit();"
> >
<option value="a.ordering ASC">JFIELD_ORDERING_LABEL_ASC</option> <option value="a.ordering ASC">JFIELD_ORDERING_LABEL_ASC</option>
<option value="a.title ASC">COM_MOKOBACKUP_HEADING_TITLE_ASC</option> <option value="a.title ASC">COM_MOKOJOOMBACKUP_HEADING_TITLE_ASC</option>
<option value="a.title DESC">COM_MOKOBACKUP_HEADING_TITLE_DESC</option> <option value="a.title DESC">COM_MOKOJOOMBACKUP_HEADING_TITLE_DESC</option>
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option> <option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option> <option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
</field> </field>
@@ -0,0 +1,373 @@
<?xml version="1.0" encoding="UTF-8"?>
<form>
<fieldset name="general" label="COM_MOKOJOOMBACKUP_FIELDSET_GENERAL">
<field
name="title"
type="text"
label="COM_MOKOJOOMBACKUP_FIELD_TITLE"
description="COM_MOKOJOOMBACKUP_FIELD_TITLE_DESC"
required="true"
maxlength="255"
/>
<field
name="description"
type="textarea"
label="COM_MOKOJOOMBACKUP_FIELD_DESCRIPTION"
description="COM_MOKOJOOMBACKUP_FIELD_DESCRIPTION_DESC"
rows="3"
/>
<field
name="backup_type"
type="list"
label="COM_MOKOJOOMBACKUP_FIELD_BACKUP_TYPE"
description="COM_MOKOJOOMBACKUP_FIELD_BACKUP_TYPE_DESC"
default="full"
>
<option value="full">COM_MOKOJOOMBACKUP_TYPE_FULL</option>
<option value="database">COM_MOKOJOOMBACKUP_TYPE_DATABASE</option>
<option value="files">COM_MOKOJOOMBACKUP_TYPE_FILES</option>
<option value="differential">COM_MOKOJOOMBACKUP_TYPE_DIFFERENTIAL</option>
</field>
</fieldset>
<fieldset name="archive" label="COM_MOKOJOOMBACKUP_FIELDSET_ARCHIVE">
<field
name="archive_format"
type="list"
label="COM_MOKOJOOMBACKUP_FIELD_ARCHIVE_FORMAT"
description="COM_MOKOJOOMBACKUP_FIELD_ARCHIVE_FORMAT_DESC"
default="zip"
>
<option value="zip">ZIP</option>
<option value="tar.gz">tar.gz</option>
</field>
<field
name="compression_level"
type="list"
label="COM_MOKOJOOMBACKUP_FIELD_COMPRESSION"
description="COM_MOKOJOOMBACKUP_FIELD_COMPRESSION_DESC"
default="5"
>
<option value="0">COM_MOKOJOOMBACKUP_COMPRESSION_NONE</option>
<option value="1">COM_MOKOJOOMBACKUP_COMPRESSION_FASTEST</option>
<option value="5">COM_MOKOJOOMBACKUP_COMPRESSION_NORMAL</option>
<option value="9">COM_MOKOJOOMBACKUP_COMPRESSION_BEST</option>
</field>
<field
name="split_size"
type="number"
label="COM_MOKOJOOMBACKUP_FIELD_SPLIT_SIZE"
description="COM_MOKOJOOMBACKUP_FIELD_SPLIT_SIZE_DESC"
default="0"
min="0"
hint="0 = no splitting"
/>
<field
name="backup_dir"
type="FolderPicker"
label="COM_MOKOJOOMBACKUP_FIELD_BACKUP_DIR"
description="COM_MOKOJOOMBACKUP_FIELD_BACKUP_DIR_DESC"
default="administrator/components/com_mokojoombackup/backups"
addfieldprefix="Joomla\Component\MokoJoomBackup\Administrator\Field"
/>
<field
name="archive_name_format"
type="text"
label="COM_MOKOJOOMBACKUP_FIELD_ARCHIVE_NAME_FORMAT"
description="COM_MOKOJOOMBACKUP_FIELD_ARCHIVE_NAME_FORMAT_DESC"
default="[host]_[datetime]_profile[profile_id]"
maxlength="512"
hint="[host]_[datetime]_profile[profile_id]"
/>
<field
name="include_mokorestore"
type="radio"
label="COM_MOKOJOOMBACKUP_FIELD_INCLUDE_MOKORESTORE"
description="COM_MOKOJOOMBACKUP_FIELD_INCLUDE_MOKORESTORE_DESC"
default="0"
class="btn-group"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="encryption_password"
type="password"
label="COM_MOKOJOOMBACKUP_FIELD_ENCRYPTION_PASSWORD"
description="COM_MOKOJOOMBACKUP_FIELD_ENCRYPTION_PASSWORD_DESC"
maxlength="255"
/>
</fieldset>
<fieldset name="sidebar" label="COM_MOKOJOOMBACKUP_FIELDSET_STATUS">
<field
name="id"
type="hidden"
/>
<field
name="published"
type="list"
label="JSTATUS"
default="1"
>
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field
name="ordering"
type="number"
label="JFIELD_ORDERING_LABEL"
default="0"
/>
</fieldset>
<fieldset name="filters" label="COM_MOKOJOOMBACKUP_FIELDSET_FILTERS">
<field
name="exclude_dirs"
type="DirectoryFilter"
label="COM_MOKOJOOMBACKUP_FIELD_EXCLUDE_DIRS"
description="COM_MOKOJOOMBACKUP_FIELD_EXCLUDE_DIRS_DESC"
filter="raw"
hint="tmp"
addfieldprefix="Joomla\Component\MokoJoomBackup\Administrator\Field"
/>
<field
name="exclude_files"
type="ExcludeList"
label="COM_MOKOJOOMBACKUP_FIELD_EXCLUDE_FILES"
description="COM_MOKOJOOMBACKUP_FIELD_EXCLUDE_FILES_DESC"
filter="raw"
hint="*.bak"
addfieldprefix="Joomla\Component\MokoJoomBackup\Administrator\Field"
/>
<field
name="exclude_tables"
type="DatabaseTables"
label="COM_MOKOJOOMBACKUP_FIELD_EXCLUDE_TABLES"
description="COM_MOKOJOOMBACKUP_FIELD_EXCLUDE_TABLES_DESC"
filter="raw"
addfieldprefix="Joomla\Component\MokoJoomBackup\Administrator\Field"
/>
</fieldset>
<fieldset name="remote" label="COM_MOKOJOOMBACKUP_FIELDSET_REMOTE">
<field
name="remote_storage"
type="list"
label="COM_MOKOJOOMBACKUP_FIELD_REMOTE_STORAGE"
description="COM_MOKOJOOMBACKUP_FIELD_REMOTE_STORAGE_DESC"
default="none"
>
<option value="none">COM_MOKOJOOMBACKUP_REMOTE_NONE</option>
<option value="ftp">COM_MOKOJOOMBACKUP_REMOTE_FTP</option>
<option value="google_drive">COM_MOKOJOOMBACKUP_REMOTE_GDRIVE</option>
<option value="s3">COM_MOKOJOOMBACKUP_REMOTE_S3</option>
</field>
<field
name="remote_keep_local"
type="radio"
label="COM_MOKOJOOMBACKUP_FIELD_KEEP_LOCAL"
description="COM_MOKOJOOMBACKUP_FIELD_KEEP_LOCAL_DESC"
default="1"
class="btn-group"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
</fieldset>
<fieldset name="notifications" label="COM_MOKOJOOMBACKUP_FIELDSET_NOTIFICATIONS">
<field
name="notify_email"
type="text"
label="COM_MOKOJOOMBACKUP_FIELD_NOTIFY_EMAIL"
description="COM_MOKOJOOMBACKUP_FIELD_NOTIFY_EMAIL_DESC"
maxlength="512"
hint="admin@example.com, backup@example.com"
/>
<field
name="notify_user_groups"
type="usergrouplist"
label="COM_MOKOJOOMBACKUP_FIELD_NOTIFY_USER_GROUPS"
description="COM_MOKOJOOMBACKUP_FIELD_NOTIFY_USER_GROUPS_DESC"
multiple="true"
layout="joomla.form.field.list-fancy-select"
/>
<field
name="notify_on_success"
type="radio"
label="COM_MOKOJOOMBACKUP_FIELD_NOTIFY_SUCCESS"
description="COM_MOKOJOOMBACKUP_FIELD_NOTIFY_SUCCESS_DESC"
default="0"
class="btn-group"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="notify_on_failure"
type="radio"
label="COM_MOKOJOOMBACKUP_FIELD_NOTIFY_FAILURE"
description="COM_MOKOJOOMBACKUP_FIELD_NOTIFY_FAILURE_DESC"
default="1"
class="btn-group"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
</fieldset>
<fieldset name="ftp" label="COM_MOKOJOOMBACKUP_FIELDSET_FTP">
<field
name="ftp_host"
type="text"
label="COM_MOKOJOOMBACKUP_FIELD_FTP_HOST"
description="COM_MOKOJOOMBACKUP_FIELD_FTP_HOST_DESC"
maxlength="255"
showon="remote_storage:ftp"
/>
<field
name="ftp_port"
type="number"
label="COM_MOKOJOOMBACKUP_FIELD_FTP_PORT"
description="COM_MOKOJOOMBACKUP_FIELD_FTP_PORT_DESC"
default="21"
min="1"
max="65535"
showon="remote_storage:ftp"
/>
<field
name="ftp_username"
type="text"
label="COM_MOKOJOOMBACKUP_FIELD_FTP_USERNAME"
maxlength="255"
showon="remote_storage:ftp"
/>
<field
name="ftp_password"
type="password"
label="COM_MOKOJOOMBACKUP_FIELD_FTP_PASSWORD"
maxlength="255"
showon="remote_storage:ftp"
/>
<field
name="ftp_path"
type="text"
label="COM_MOKOJOOMBACKUP_FIELD_FTP_PATH"
description="COM_MOKOJOOMBACKUP_FIELD_FTP_PATH_DESC"
default="/backups"
maxlength="512"
showon="remote_storage:ftp"
/>
<field
name="ftp_passive"
type="radio"
label="COM_MOKOJOOMBACKUP_FIELD_FTP_PASSIVE"
description="COM_MOKOJOOMBACKUP_FIELD_FTP_PASSIVE_DESC"
default="1"
class="btn-group"
showon="remote_storage:ftp"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="ftp_ssl"
type="radio"
label="COM_MOKOJOOMBACKUP_FIELD_FTP_SSL"
description="COM_MOKOJOOMBACKUP_FIELD_FTP_SSL_DESC"
default="0"
class="btn-group"
showon="remote_storage:ftp"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
</fieldset>
<fieldset name="google_drive" label="COM_MOKOJOOMBACKUP_FIELDSET_GDRIVE">
<field
name="gdrive_client_id"
type="text"
label="COM_MOKOJOOMBACKUP_FIELD_GDRIVE_CLIENT_ID"
description="COM_MOKOJOOMBACKUP_FIELD_GDRIVE_CLIENT_ID_DESC"
maxlength="255"
showon="remote_storage:google_drive"
/>
<field
name="gdrive_client_secret"
type="password"
label="COM_MOKOJOOMBACKUP_FIELD_GDRIVE_CLIENT_SECRET"
maxlength="255"
showon="remote_storage:google_drive"
/>
<field
name="gdrive_refresh_token"
type="text"
label="COM_MOKOJOOMBACKUP_FIELD_GDRIVE_REFRESH_TOKEN"
description="COM_MOKOJOOMBACKUP_FIELD_GDRIVE_REFRESH_TOKEN_DESC"
maxlength="512"
showon="remote_storage:google_drive"
/>
<field
name="gdrive_folder_id"
type="text"
label="COM_MOKOJOOMBACKUP_FIELD_GDRIVE_FOLDER_ID"
description="COM_MOKOJOOMBACKUP_FIELD_GDRIVE_FOLDER_ID_DESC"
maxlength="255"
showon="remote_storage:google_drive"
/>
</fieldset>
<fieldset name="s3" label="COM_MOKOJOOMBACKUP_FIELDSET_S3">
<field
name="s3_endpoint"
type="text"
label="COM_MOKOJOOMBACKUP_FIELD_S3_ENDPOINT"
description="COM_MOKOJOOMBACKUP_FIELD_S3_ENDPOINT_DESC"
maxlength="512"
hint="https://s3.amazonaws.com"
showon="remote_storage:s3"
/>
<field
name="s3_region"
type="text"
label="COM_MOKOJOOMBACKUP_FIELD_S3_REGION"
description="COM_MOKOJOOMBACKUP_FIELD_S3_REGION_DESC"
default="us-east-1"
maxlength="50"
showon="remote_storage:s3"
/>
<field
name="s3_access_key"
type="text"
label="COM_MOKOJOOMBACKUP_FIELD_S3_ACCESS_KEY"
maxlength="255"
showon="remote_storage:s3"
/>
<field
name="s3_secret_key"
type="password"
label="COM_MOKOJOOMBACKUP_FIELD_S3_SECRET_KEY"
maxlength="255"
showon="remote_storage:s3"
/>
<field
name="s3_bucket"
type="text"
label="COM_MOKOJOOMBACKUP_FIELD_S3_BUCKET"
description="COM_MOKOJOOMBACKUP_FIELD_S3_BUCKET_DESC"
maxlength="255"
showon="remote_storage:s3"
/>
<field
name="s3_path"
type="text"
label="COM_MOKOJOOMBACKUP_FIELD_S3_PATH"
description="COM_MOKOJOOMBACKUP_FIELD_S3_PATH_DESC"
default="/backups"
maxlength="512"
showon="remote_storage:s3"
/>
</fieldset>
</form>
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -15,20 +15,20 @@ use Joomla\CMS\Extension\ComponentInterface;
use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory; use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory;
use Joomla\CMS\Extension\Service\Provider\MVCFactory; use Joomla\CMS\Extension\Service\Provider\MVCFactory;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\Component\MokoBackup\Administrator\Extension\MokoBackupComponent; use Joomla\Component\MokoJoomBackup\Administrator\Extension\MokoJoomBackupComponent;
use Joomla\DI\Container; use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface; use Joomla\DI\ServiceProviderInterface;
return new class () implements ServiceProviderInterface { return new class () implements ServiceProviderInterface {
public function register(Container $container): void public function register(Container $container): void
{ {
$container->registerServiceProvider(new MVCFactory('\\Joomla\\Component\\MokoBackup')); $container->registerServiceProvider(new MVCFactory('\\Joomla\\Component\\MokoJoomBackup'));
$container->registerServiceProvider(new ComponentDispatcherFactory('\\Joomla\\Component\\MokoBackup')); $container->registerServiceProvider(new ComponentDispatcherFactory('\\Joomla\\Component\\MokoJoomBackup'));
$container->set( $container->set(
ComponentInterface::class, ComponentInterface::class,
function (Container $container) { function (Container $container) {
$component = new MokoBackupComponent( $component = new MokoJoomBackupComponent(
$container->get(ComponentDispatcherFactoryInterface::class) $container->get(ComponentDispatcherFactoryInterface::class)
); );
$component->setMVCFactory($container->get(MVCFactoryInterface::class)); $component->setMVCFactory($container->get(MVCFactoryInterface::class));
@@ -1,4 +1,4 @@
CREATE TABLE IF NOT EXISTS `#__mokobackup_profiles` ( CREATE TABLE IF NOT EXISTS `#__mokojoombackup_profiles` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` VARCHAR(255) NOT NULL DEFAULT '', `title` VARCHAR(255) NOT NULL DEFAULT '',
`description` TEXT NOT NULL, `description` TEXT NOT NULL,
@@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS `#__mokobackup_profiles` (
`archive_format` VARCHAR(10) NOT NULL DEFAULT 'zip', `archive_format` VARCHAR(10) NOT NULL DEFAULT 'zip',
`compression_level` TINYINT(1) UNSIGNED NOT NULL DEFAULT 5 COMMENT '0=none, 9=max', `compression_level` TINYINT(1) UNSIGNED NOT NULL DEFAULT 5 COMMENT '0=none, 9=max',
`split_size` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0=no split, otherwise MB per part', `split_size` INT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0=no split, otherwise MB per part',
`backup_dir` VARCHAR(512) NOT NULL DEFAULT 'administrator/components/com_mokobackup/backups', `backup_dir` VARCHAR(512) NOT NULL DEFAULT 'administrator/components/com_mokojoombackup/backups',
`archive_name_format` VARCHAR(512) NOT NULL DEFAULT '[host]_[datetime]_profile[profile_id]' COMMENT 'Filename format with placeholders', `archive_name_format` VARCHAR(512) NOT NULL DEFAULT '[host]_[datetime]_profile[profile_id]' COMMENT 'Filename format with placeholders',
`exclude_dirs` TEXT NOT NULL COMMENT 'Newline-separated directory paths to exclude', `exclude_dirs` TEXT NOT NULL COMMENT 'Newline-separated directory paths to exclude',
`exclude_files` TEXT NOT NULL COMMENT 'Newline-separated filename patterns to exclude', `exclude_files` TEXT NOT NULL COMMENT 'Newline-separated filename patterns to exclude',
@@ -44,7 +44,7 @@ CREATE TABLE IF NOT EXISTS `#__mokobackup_profiles` (
KEY `idx_published` (`published`) KEY `idx_published` (`published`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `#__mokobackup_records` ( CREATE TABLE IF NOT EXISTS `#__mokojoombackup_records` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`profile_id` INT(11) UNSIGNED NOT NULL DEFAULT 1, `profile_id` INT(11) UNSIGNED NOT NULL DEFAULT 1,
`description` VARCHAR(255) NOT NULL DEFAULT '', `description` VARCHAR(255) NOT NULL DEFAULT '',
@@ -74,15 +74,15 @@ CREATE TABLE IF NOT EXISTS `#__mokobackup_records` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Insert default backup profile -- Insert default backup profile
INSERT INTO `#__mokobackup_profiles` ( INSERT INTO `#__mokojoombackup_profiles` (
`id`, `title`, `description`, `backup_type`, `id`, `title`, `description`, `backup_type`,
`archive_format`, `compression_level`, `split_size`, `backup_dir`, `archive_format`, `compression_level`, `split_size`, `backup_dir`,
`exclude_dirs`, `exclude_files`, `exclude_tables`, `exclude_dirs`, `exclude_files`, `exclude_tables`,
`published`, `ordering`, `created`, `modified` `published`, `ordering`, `created`, `modified`
) VALUES ( ) VALUES (
1, 'Default Backup Profile', 'Full site backup with default settings', 'full', 1, 'Default Backup Profile', 'Full site backup with default settings', 'full',
'zip', 5, 0, 'administrator/components/com_mokobackup/backups', 'zip', 5, 0, 'administrator/components/com_mokojoombackup/backups',
'administrator/components/com_mokobackup/backups\ntmp\ncache\nlogs\nadministrator/logs', 'administrator/components/com_mokojoombackup/backups\ntmp\ncache\nlogs\nadministrator/logs',
'.gitignore\n.htaccess.bak', '.gitignore\n.htaccess.bak',
'#__session', '#__session',
1, 1, NOW(), NOW() 1, 1, NOW(), NOW()
@@ -0,0 +1,2 @@
DROP TABLE IF EXISTS `#__mokojoombackup_records`;
DROP TABLE IF EXISTS `#__mokojoombackup_profiles`;
@@ -0,0 +1 @@
ALTER TABLE `#__mokojoombackup_profiles` CHANGE `include_kickstart` `include_mokorestore` TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'Include MokoRestore standalone restore script in archive';
@@ -0,0 +1,12 @@
-- MokoJoomBackup 01.01.02
-- Consolidated schema updates: NULL defaults, notifications, archive name format
-- Fix: allow NULL defaults for manifest and log columns
ALTER TABLE `#__mokojoombackup_records` MODIFY `manifest` LONGTEXT DEFAULT NULL;
ALTER TABLE `#__mokojoombackup_records` MODIFY `log` MEDIUMTEXT DEFAULT NULL;
-- Add user group notifications column to profiles
ALTER TABLE `#__mokojoombackup_profiles` ADD COLUMN `notify_user_groups` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Comma-separated Joomla user group IDs' AFTER `notify_email`;
-- Add archive_name_format column with placeholder support
ALTER TABLE `#__mokojoombackup_profiles` ADD COLUMN `archive_name_format` VARCHAR(512) NOT NULL DEFAULT '[host]_[datetime]_profile[profile_id]' COMMENT 'Filename format with placeholders' AFTER `backup_dir`;
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -11,13 +11,13 @@
* Handles init and step requests from the admin UI JavaScript. * Handles init and step requests from the admin UI JavaScript.
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Controller; namespace Joomla\Component\MokoJoomBackup\Administrator\Controller;
defined('_JEXEC') or die; defined('_JEXEC') or die;
use Joomla\CMS\MVC\Controller\BaseController; use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Session\Session; use Joomla\CMS\Session\Session;
use Joomla\Component\MokoBackup\Administrator\Engine\SteppedBackupEngine; use Joomla\Component\MokoJoomBackup\Administrator\Engine\SteppedBackupEngine;
class AjaxController extends BaseController class AjaxController extends BaseController
{ {
@@ -148,7 +148,7 @@ class AjaxController extends BaseController
$db = \Joomla\CMS\Factory::getDbo(); $db = \Joomla\CMS\Factory::getDbo();
$query = $db->getQuery(true) $query = $db->getQuery(true)
->select($db->quoteName(['absolute_path', 'log'])) ->select($db->quoteName(['absolute_path', 'log']))
->from($db->quoteName('#__mokobackup_records')) ->from($db->quoteName('#__mokojoombackup_records'))
->where($db->quoteName('id') . ' = ' . $id); ->where($db->quoteName('id') . ' = ' . $id);
$db->setQuery($query); $db->setQuery($query);
$record = $db->loadObject(); $record = $db->loadObject();
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Controller; namespace Joomla\Component\MokoJoomBackup\Administrator\Controller;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -16,5 +16,5 @@ use Joomla\CMS\MVC\Controller\FormController;
class BackupController extends FormController class BackupController extends FormController
{ {
protected $text_prefix = 'COM_MOKOBACKUP_BACKUP'; protected $text_prefix = 'COM_MOKOJOOMBACKUP_BACKUP';
} }
@@ -2,24 +2,24 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Controller; namespace Joomla\Component\MokoJoomBackup\Administrator\Controller;
defined('_JEXEC') or die; defined('_JEXEC') or die;
use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\CMS\Router\Route; use Joomla\CMS\Router\Route;
use Joomla\Component\MokoBackup\Administrator\Engine\BackupEngine; use Joomla\Component\MokoJoomBackup\Administrator\Engine\BackupEngine;
use Joomla\Component\MokoBackup\Administrator\Engine\RestoreEngine; use Joomla\Component\MokoJoomBackup\Administrator\Engine\RestoreEngine;
class BackupsController extends AdminController class BackupsController extends AdminController
{ {
protected $text_prefix = 'COM_MOKOBACKUP_BACKUPS'; protected $text_prefix = 'COM_MOKOJOOMBACKUP_BACKUPS';
public function getModel($name = 'Backup', $prefix = 'Administrator', $config = ['ignore_request' => true]) public function getModel($name = 'Backup', $prefix = 'Administrator', $config = ['ignore_request' => true])
{ {
@@ -47,7 +47,7 @@ class BackupsController extends AdminController
$this->setMessage($result['message'], 'error'); $this->setMessage($result['message'], 'error');
} }
$this->setRedirect(Route::_('index.php?option=com_mokobackup&view=backups', false)); $this->setRedirect(Route::_('index.php?option=com_mokojoombackup&view=backups', false));
} }
/** /**
@@ -62,8 +62,8 @@ class BackupsController extends AdminController
$item = $model->getItem($id); $item = $model->getItem($id);
if (!$item || !$item->id || !$item->filesexist || !is_file($item->absolute_path)) { if (!$item || !$item->id || !$item->filesexist || !is_file($item->absolute_path)) {
$this->setMessage('COM_MOKOBACKUP_ERROR_FILE_NOT_FOUND', 'error'); $this->setMessage('COM_MOKOJOOMBACKUP_ERROR_FILE_NOT_FOUND', 'error');
$this->setRedirect(Route::_('index.php?option=com_mokobackup&view=backups', false)); $this->setRedirect(Route::_('index.php?option=com_mokojoombackup&view=backups', false));
return; return;
} }
@@ -108,8 +108,8 @@ class BackupsController extends AdminController
$password = $this->input->getString('encryption_password', ''); $password = $this->input->getString('encryption_password', '');
if (!$id) { if (!$id) {
$this->setMessage('COM_MOKOBACKUP_ERROR_NO_RECORD_SELECTED', 'error'); $this->setMessage('COM_MOKOJOOMBACKUP_ERROR_NO_RECORD_SELECTED', 'error');
$this->setRedirect(Route::_('index.php?option=com_mokobackup&view=backups', false)); $this->setRedirect(Route::_('index.php?option=com_mokojoombackup&view=backups', false));
return; return;
} }
@@ -123,7 +123,7 @@ class BackupsController extends AdminController
$this->setMessage($result['message'], 'error'); $this->setMessage($result['message'], 'error');
} }
$this->setRedirect(Route::_('index.php?option=com_mokobackup&view=backups', false)); $this->setRedirect(Route::_('index.php?option=com_mokojoombackup&view=backups', false));
} }
/** /**
@@ -137,8 +137,8 @@ class BackupsController extends AdminController
$id = !empty($cid) ? (int) $cid[0] : $this->input->getInt('id', 0); $id = !empty($cid) ? (int) $cid[0] : $this->input->getInt('id', 0);
if (!$id) { if (!$id) {
$this->setMessage('COM_MOKOBACKUP_ERROR_NO_RECORD_SELECTED', 'error'); $this->setMessage('COM_MOKOJOOMBACKUP_ERROR_NO_RECORD_SELECTED', 'error');
$this->setRedirect(Route::_('index.php?option=com_mokobackup&view=backups', false)); $this->setRedirect(Route::_('index.php?option=com_mokojoombackup&view=backups', false));
return; return;
} }
@@ -147,22 +147,22 @@ class BackupsController extends AdminController
$item = $model->getItem($id); $item = $model->getItem($id);
if (!$item || !$item->id) { if (!$item || !$item->id) {
$this->setMessage('COM_MOKOBACKUP_ERROR_NO_RECORD_SELECTED', 'error'); $this->setMessage('COM_MOKOJOOMBACKUP_ERROR_NO_RECORD_SELECTED', 'error');
$this->setRedirect(Route::_('index.php?option=com_mokobackup&view=backups', false)); $this->setRedirect(Route::_('index.php?option=com_mokojoombackup&view=backups', false));
return; return;
} }
if (!is_file($item->absolute_path)) { if (!is_file($item->absolute_path)) {
$this->setMessage('COM_MOKOBACKUP_ERROR_FILE_NOT_FOUND', 'error'); $this->setMessage('COM_MOKOJOOMBACKUP_ERROR_FILE_NOT_FOUND', 'error');
$this->setRedirect(Route::_('index.php?option=com_mokobackup&view=backups', false)); $this->setRedirect(Route::_('index.php?option=com_mokojoombackup&view=backups', false));
return; return;
} }
if (empty($item->checksum)) { if (empty($item->checksum)) {
$this->setMessage('COM_MOKOBACKUP_VERIFY_NO_CHECKSUM', 'warning'); $this->setMessage('COM_MOKOJOOMBACKUP_VERIFY_NO_CHECKSUM', 'warning');
$this->setRedirect(Route::_('index.php?option=com_mokobackup&view=backups', false)); $this->setRedirect(Route::_('index.php?option=com_mokojoombackup&view=backups', false));
return; return;
} }
@@ -170,11 +170,11 @@ class BackupsController extends AdminController
$currentHash = hash_file('sha256', $item->absolute_path); $currentHash = hash_file('sha256', $item->absolute_path);
if ($currentHash === $item->checksum) { if ($currentHash === $item->checksum) {
$this->setMessage('COM_MOKOBACKUP_VERIFY_OK'); $this->setMessage('COM_MOKOJOOMBACKUP_VERIFY_OK');
} else { } else {
$this->setMessage('COM_MOKOBACKUP_VERIFY_FAILED', 'error'); $this->setMessage('COM_MOKOJOOMBACKUP_VERIFY_FAILED', 'error');
} }
$this->setRedirect(Route::_('index.php?option=com_mokobackup&view=backups', false)); $this->setRedirect(Route::_('index.php?option=com_mokojoombackup&view=backups', false));
} }
} }
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Controller; namespace Joomla\Component\MokoJoomBackup\Administrator\Controller;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Controller; namespace Joomla\Component\MokoJoomBackup\Administrator\Controller;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -16,5 +16,5 @@ use Joomla\CMS\MVC\Controller\FormController;
class ProfileController extends FormController class ProfileController extends FormController
{ {
protected $text_prefix = 'COM_MOKOBACKUP_PROFILE'; protected $text_prefix = 'COM_MOKOJOOMBACKUP_PROFILE';
} }
@@ -2,24 +2,24 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Controller; namespace Joomla\Component\MokoJoomBackup\Administrator\Controller;
defined('_JEXEC') or die; defined('_JEXEC') or die;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\CMS\Router\Route; use Joomla\CMS\Router\Route;
use Joomla\Component\MokoBackup\Administrator\Engine\AkeebaImporter; use Joomla\Component\MokoJoomBackup\Administrator\Engine\AkeebaImporter;
class ProfilesController extends AdminController class ProfilesController extends AdminController
{ {
protected $text_prefix = 'COM_MOKOBACKUP_PROFILES'; protected $text_prefix = 'COM_MOKOJOOMBACKUP_PROFILES';
public function getModel($name = 'Profile', $prefix = 'Administrator', $config = ['ignore_request' => true]) public function getModel($name = 'Profile', $prefix = 'Administrator', $config = ['ignore_request' => true])
{ {
@@ -39,8 +39,8 @@ class ProfilesController extends AdminController
$detection = $importer->detect(); $detection = $importer->detect();
if (!$detection['profiles']) { if (!$detection['profiles']) {
$this->setMessage('COM_MOKOBACKUP_AKEEBA_NOT_FOUND', 'error'); $this->setMessage('COM_MOKOJOOMBACKUP_AKEEBA_NOT_FOUND', 'error');
$this->setRedirect(Route::_('index.php?option=com_mokobackup&view=profiles', false)); $this->setRedirect(Route::_('index.php?option=com_mokojoombackup&view=profiles', false));
return; return;
} }
@@ -55,7 +55,7 @@ class ProfilesController extends AdminController
$this->setMessage($result['message'], 'error'); $this->setMessage($result['message'], 'error');
} }
$this->setRedirect(Route::_('index.php?option=com_mokobackup&view=profiles', false)); $this->setRedirect(Route::_('index.php?option=com_mokojoombackup&view=profiles', false));
} }
/** /**
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -25,7 +25,7 @@
* "databases": {"include": {...}, "exclude": {...}}} * "databases": {"include": {...}, "exclude": {...}}}
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -119,7 +119,7 @@ class AkeebaImporter
$akProfiles = $db->loadObjectList(); $akProfiles = $db->loadObjectList();
$profilesImported = 0; $profilesImported = 0;
$profileIdMap = []; // akeeba_id => mokobackup_id $profileIdMap = []; // akeeba_id => mokojoombackup_id
foreach ($akProfiles as $akProfile) { foreach ($akProfiles as $akProfile) {
$config = $this->parseAkeebaConfig($akProfile->configuration ?? ''); $config = $this->parseAkeebaConfig($akProfile->configuration ?? '');
@@ -127,11 +127,11 @@ class AkeebaImporter
$mokoProfile = $this->mapToMokoProfile($akProfile, $config, $filters); $mokoProfile = $this->mapToMokoProfile($akProfile, $config, $filters);
$db->insertObject('#__mokobackup_profiles', $mokoProfile, 'id'); $db->insertObject('#__mokojoombackup_profiles', $mokoProfile, 'id');
$profileIdMap[$akProfile->id] = $mokoProfile->id; $profileIdMap[$akProfile->id] = $mokoProfile->id;
$profilesImported++; $profilesImported++;
$this->log('Imported profile: "' . $akProfile->description . '" (Akeeba #' . $akProfile->id . ' → MokoBackup #' . $mokoProfile->id . ')'); $this->log('Imported profile: "' . $akProfile->description . '" (Akeeba #' . $akProfile->id . ' → MokoJoomBackup #' . $mokoProfile->id . ')');
} }
// Import backup history // Import backup history
@@ -200,7 +200,7 @@ class AkeebaImporter
'log' => 'Imported from Akeeba Backup record #' . $stat->id, 'log' => 'Imported from Akeeba Backup record #' . $stat->id,
]; ];
$db->insertObject('#__mokobackup_records', $record, 'id'); $db->insertObject('#__mokojoombackup_records', $record, 'id');
$imported++; $imported++;
} }
@@ -484,7 +484,7 @@ class AkeebaImporter
$dir = $config['akeeba.basic.output_directory'] ?? ''; $dir = $config['akeeba.basic.output_directory'] ?? '';
if (empty($dir) || $dir === '[DEFAULT_OUTPUT]') { if (empty($dir) || $dir === '[DEFAULT_OUTPUT]') {
return 'administrator/components/com_mokobackup/backups'; return 'administrator/components/com_mokojoombackup/backups';
} }
// Convert absolute path to relative // Convert absolute path to relative
@@ -492,7 +492,7 @@ class AkeebaImporter
$dir = ltrim(substr($dir, strlen(JPATH_ROOT)), '/\\'); $dir = ltrim(substr($dir, strlen(JPATH_ROOT)), '/\\');
} }
return $dir ?: 'administrator/components/com_mokobackup/backups'; return $dir ?: 'administrator/components/com_mokojoombackup/backups';
} }
private function mapRemoteStorage(array $config): string private function mapRemoteStorage(array $config): string
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -46,7 +46,7 @@ class BackupEngine
// Load profile // Load profile
$query = $db->getQuery(true) $query = $db->getQuery(true)
->select('*') ->select('*')
->from($db->quoteName('#__mokobackup_profiles')) ->from($db->quoteName('#__mokojoombackup_profiles'))
->where($db->quoteName('id') . ' = ' . $profileId); ->where($db->quoteName('id') . ' = ' . $profileId);
$db->setQuery($query); $db->setQuery($query);
$profile = $db->loadObject(); $profile = $db->loadObject();
@@ -63,7 +63,7 @@ class BackupEngine
// Resolve placeholders in directory and filename // Resolve placeholders in directory and filename
$resolver = new PlaceholderResolver($profile); $resolver = new PlaceholderResolver($profile);
$configuredDir = $profile->backup_dir ?: 'administrator/components/com_mokobackup/backups'; $configuredDir = $profile->backup_dir ?: 'administrator/components/com_mokojoombackup/backups';
$this->backupDir = $this->resolveBackupDir($resolver->resolve($configuredDir)); $this->backupDir = $this->resolveBackupDir($resolver->resolve($configuredDir));
if (!is_dir($this->backupDir)) { if (!is_dir($this->backupDir)) {
@@ -104,7 +104,7 @@ class BackupEngine
'log' => '', 'log' => '',
]; ];
$db->insertObject('#__mokobackup_records', $record, 'id'); $db->insertObject('#__mokojoombackup_records', $record, 'id');
$recordId = $record->id; $recordId = $record->id;
try { try {
@@ -257,7 +257,7 @@ class BackupEngine
'log' => $logContent, 'log' => $logContent,
]; ];
$db->updateObject('#__mokobackup_records', $update, 'id'); $db->updateObject('#__mokojoombackup_records', $update, 'id');
// Send success notification // Send success notification
NotificationSender::send($profile, $update, true, implode("\n", $this->log)); NotificationSender::send($profile, $update, true, implode("\n", $this->log));
@@ -285,7 +285,7 @@ class BackupEngine
'log' => implode("\n", $this->log), 'log' => implode("\n", $this->log),
]; ];
$db->updateObject('#__mokobackup_records', $update, 'id'); $db->updateObject('#__mokojoombackup_records', $update, 'id');
// Send failure notification // Send failure notification
NotificationSender::send($profile, $update, false, implode("\n", $this->log)); NotificationSender::send($profile, $update, false, implode("\n", $this->log));
@@ -405,7 +405,7 @@ class BackupEngine
{ {
$query = $db->getQuery(true) $query = $db->getQuery(true)
->select($db->quoteName('manifest')) ->select($db->quoteName('manifest'))
->from($db->quoteName('#__mokobackup_records')) ->from($db->quoteName('#__mokojoombackup_records'))
->where($db->quoteName('profile_id') . ' = ' . $profileId) ->where($db->quoteName('profile_id') . ' = ' . $profileId)
->where($db->quoteName('status') . ' = ' . $db->quote('complete')) ->where($db->quoteName('status') . ' = ' . $db->quote('complete'))
->where($db->quoteName('manifest') . ' != ' . $db->quote('')) ->where($db->quoteName('manifest') . ' != ' . $db->quote(''))
@@ -476,14 +476,14 @@ class BackupEngine
} }
/** /**
* Dispatch the onMokoBackupAfterRun event so plugins (actionlog, etc.) can react. * Dispatch the onMokoJoomBackupAfterRun event so plugins (actionlog, etc.) can react.
*/ */
private function dispatchAfterRun(bool $success, int $recordId, string $description, int $profileId, string $origin): void private function dispatchAfterRun(bool $success, int $recordId, string $description, int $profileId, string $origin): void
{ {
try { try {
$app = Factory::getApplication(); $app = Factory::getApplication();
$event = new Event('onMokoBackupAfterRun', [ $event = new Event('onMokoJoomBackupAfterRun', [
'success' => $success, 'success' => $success,
'record_id' => $recordId, 'record_id' => $recordId,
'description' => $description, 'description' => $description,
@@ -491,7 +491,7 @@ class BackupEngine
'origin' => $origin, 'origin' => $origin,
]); ]);
$app->getDispatcher()->dispatch('onMokoBackupAfterRun', $event); $app->getDispatcher()->dispatch('onMokoJoomBackupAfterRun', $event);
} catch (\Throwable $e) { } catch (\Throwable $e) {
// Never let a listener failure break the backup result // Never let a listener failure break the backup result
} }
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -12,7 +12,7 @@
* and DROP TABLE before CREATE TABLE for clean restores. * and DROP TABLE before CREATE TABLE for clean restores.
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -101,7 +101,7 @@ class DatabaseImporter
// Log but don't abort — some statements may fail on // Log but don't abort — some statements may fail on
// different MySQL versions (e.g. charset differences) // different MySQL versions (e.g. charset differences)
// but the overall restore should continue. // but the overall restore should continue.
error_log('MokoBackup SQL import warning: ' . $e->getMessage()); error_log('MokoJoomBackup SQL import warning: ' . $e->getMessage());
} }
} }
} }
@@ -115,7 +115,7 @@ class DatabaseImporter
$db->execute(); $db->execute();
$statementsExecuted++; $statementsExecuted++;
} catch (\Exception $e) { } catch (\Exception $e) {
error_log('MokoBackup SQL import warning (final): ' . $e->getMessage()); error_log('MokoJoomBackup SQL import warning (final): ' . $e->getMessage());
} }
} }
} finally { } finally {
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -15,7 +15,7 @@
* {"path/to/file": {"size": 1234, "mtime": 1717350000}, ...} * {"path/to/file": {"size": 1234, "mtime": 1717350000}, ...}
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -11,7 +11,7 @@
* Skips database.sql and sensitive files that should not be overwritten. * Skips database.sql and sensitive files that should not be overwritten.
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -12,7 +12,7 @@
* No SDK dependency pure PHP with cURL. * No SDK dependency pure PHP with cURL.
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -19,7 +19,7 @@
* The RestoreEngine can then restore from the extracted files. * The RestoreEngine can then restore from the extracted files.
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -21,7 +21,7 @@
* with a Joomla-styled wizard interface. * with a Joomla-styled wizard interface.
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -97,7 +97,7 @@ class MokoRestore
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
ini_set('display_errors', 0); ini_set('display_errors', 0);
define('MOKOBACKUP_RESTORE', 1); define('MOKOJOOMBACKUP_RESTORE', 1);
define('RESTORE_DIR', __DIR__); define('RESTORE_DIR', __DIR__);
define('BACKUP_FILE', RESTORE_DIR . '/site-backup.zip'); define('BACKUP_FILE', RESTORE_DIR . '/site-backup.zip');
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -11,7 +11,7 @@
* Uses Joomla's built-in mail system (Factory::getMailer()). * Uses Joomla's built-in mail system (Factory::getMailer()).
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -73,7 +73,7 @@ class NotificationSender
// Build subject // Build subject
$statusLabel = $success ? 'SUCCESS' : 'FAILED'; $statusLabel = $success ? 'SUCCESS' : 'FAILED';
$mailer->setSubject("[MokoBackup] {$statusLabel}: {$record->description}{$siteName}"); $mailer->setSubject("[MokoJoomBackup] {$statusLabel}: {$record->description}{$siteName}");
// Build body // Build body
$duration = ''; $duration = '';
@@ -133,7 +133,7 @@ class NotificationSender
return $mailer->Send(); return $mailer->Send();
} catch (\Throwable $e) { } catch (\Throwable $e) {
// Don't let notification failure break the backup flow // Don't let notification failure break the backup flow
error_log('MokoBackup notification error: ' . $e->getMessage()); error_log('MokoJoomBackup notification error: ' . $e->getMessage());
return false; return false;
} }
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -11,7 +11,7 @@
* directory paths and archive filename formats. * directory paths and archive filename formats.
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -18,7 +18,7 @@
* 6. Clean up staging directory * 6. Clean up staging directory
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -57,7 +57,7 @@ class RestoreEngine
// Load backup record // Load backup record
$query = $db->getQuery(true) $query = $db->getQuery(true)
->select('*') ->select('*')
->from($db->quoteName('#__mokobackup_records')) ->from($db->quoteName('#__mokojoombackup_records'))
->where($db->quoteName('id') . ' = ' . $recordId); ->where($db->quoteName('id') . ' = ' . $recordId);
$db->setQuery($query); $db->setQuery($query);
$record = $db->loadObject(); $record = $db->loadObject();
@@ -77,7 +77,7 @@ class RestoreEngine
} }
// Create staging directory // Create staging directory
$this->stagingDir = JPATH_ROOT . '/tmp/mokobackup-restore-' . $record->tag; $this->stagingDir = JPATH_ROOT . '/tmp/mokojoombackup-restore-' . $record->tag;
if (is_dir($this->stagingDir)) { if (is_dir($this->stagingDir)) {
$this->recursiveDelete($this->stagingDir); $this->recursiveDelete($this->stagingDir);
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -12,7 +12,7 @@
* No SDK dependency pure PHP with cURL. * No SDK dependency pure PHP with cURL.
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -16,7 +16,7 @@
* where ini_set() and set_time_limit() are disabled. * where ini_set() and set_time_limit() are disabled.
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -36,7 +36,7 @@ class SteppedBackupEngine
// Load profile // Load profile
$query = $db->getQuery(true) $query = $db->getQuery(true)
->select('*') ->select('*')
->from($db->quoteName('#__mokobackup_profiles')) ->from($db->quoteName('#__mokojoombackup_profiles'))
->where($db->quoteName('id') . ' = ' . $profileId); ->where($db->quoteName('id') . ' = ' . $profileId);
$db->setQuery($query); $db->setQuery($query);
$profile = $db->loadObject(); $profile = $db->loadObject();
@@ -55,7 +55,7 @@ class SteppedBackupEngine
$session->excludeDirs = $this->parseNewlineList($profile->exclude_dirs ?? ''); $session->excludeDirs = $this->parseNewlineList($profile->exclude_dirs ?? '');
$session->excludeFiles = $this->parseNewlineList($profile->exclude_files ?? ''); $session->excludeFiles = $this->parseNewlineList($profile->exclude_files ?? '');
$session->excludeTables = $this->parseNewlineList($profile->exclude_tables ?? ''); $session->excludeTables = $this->parseNewlineList($profile->exclude_tables ?? '');
$session->backupDir = $profile->backup_dir ?: 'administrator/components/com_mokobackup/backups'; $session->backupDir = $profile->backup_dir ?: 'administrator/components/com_mokojoombackup/backups';
$session->remoteStorage = $profile->remote_storage ?? 'none'; $session->remoteStorage = $profile->remote_storage ?? 'none';
$session->includeMokoRestore = (bool) ($profile->include_mokorestore ?? false); $session->includeMokoRestore = (bool) ($profile->include_mokorestore ?? false);
$session->remoteKeepLocal = (bool) ($profile->remote_keep_local ?? true); $session->remoteKeepLocal = (bool) ($profile->remote_keep_local ?? true);
@@ -99,7 +99,7 @@ class SteppedBackupEngine
'log' => '', 'log' => '',
]; ];
$db->insertObject('#__mokobackup_records', $record, 'id'); $db->insertObject('#__mokojoombackup_records', $record, 'id');
$session->recordId = $record->id; $session->recordId = $record->id;
// Determine what work needs to be done and estimate steps // Determine what work needs to be done and estimate steps
@@ -339,7 +339,7 @@ class SteppedBackupEngine
'filesexist' => 1, 'filesexist' => 1,
]; ];
$db->updateObject('#__mokobackup_records', $update, 'id'); $db->updateObject('#__mokojoombackup_records', $update, 'id');
$session->currentStep++; $session->currentStep++;
$session->phase = ($session->remoteStorage !== 'none') ? 'upload' : 'complete'; $session->phase = ($session->remoteStorage !== 'none') ? 'upload' : 'complete';
@@ -361,7 +361,7 @@ class SteppedBackupEngine
// Reload profile for remote settings // Reload profile for remote settings
$query = $db->getQuery(true) $query = $db->getQuery(true)
->select('*') ->select('*')
->from($db->quoteName('#__mokobackup_profiles')) ->from($db->quoteName('#__mokojoombackup_profiles'))
->where($db->quoteName('id') . ' = ' . $session->profileId); ->where($db->quoteName('id') . ' = ' . $session->profileId);
$db->setQuery($query); $db->setQuery($query);
$profile = $db->loadObject(); $profile = $db->loadObject();
@@ -396,7 +396,7 @@ class SteppedBackupEngine
'filesexist' => is_file($session->archivePath) ? 1 : 0, 'filesexist' => is_file($session->archivePath) ? 1 : 0,
]; ];
$db->updateObject('#__mokobackup_records', $update, 'id'); $db->updateObject('#__mokojoombackup_records', $update, 'id');
$session->currentStep++; $session->currentStep++;
$session->phase = 'complete'; $session->phase = 'complete';
@@ -423,7 +423,7 @@ class SteppedBackupEngine
'log' => $logContent, 'log' => $logContent,
]; ];
$db->updateObject('#__mokobackup_records', $update, 'id'); $db->updateObject('#__mokojoombackup_records', $update, 'id');
} }
/** /**
@@ -439,7 +439,7 @@ class SteppedBackupEngine
'log' => implode("\n", $session->log), 'log' => implode("\n", $session->log),
]; ];
$db->updateObject('#__mokobackup_records', $update, 'id'); $db->updateObject('#__mokojoombackup_records', $update, 'id');
} }
/** /**
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -17,7 +17,7 @@
* Phases: init database files finalize upload complete * Phases: init database files finalize upload complete
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -62,7 +62,7 @@ class SteppedSession
private static function getSessionDir(): string private static function getSessionDir(): string
{ {
$dir = JPATH_ROOT . '/tmp/mokobackup-sessions'; $dir = JPATH_ROOT . '/tmp/mokojoombackup-sessions';
if (!is_dir($dir)) { if (!is_dir($dir)) {
mkdir($dir, 0755, true); mkdir($dir, 0755, true);
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Engine; namespace Joomla\Component\MokoJoomBackup\Administrator\Engine;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -2,18 +2,18 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Extension; namespace Joomla\Component\MokoJoomBackup\Administrator\Extension;
defined('_JEXEC') or die; defined('_JEXEC') or die;
use Joomla\CMS\Extension\MVCComponent; use Joomla\CMS\Extension\MVCComponent;
class MokoBackupComponent extends MVCComponent class MokoJoomBackupComponent extends MVCComponent
{ {
} }
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Field; namespace Joomla\Component\MokoJoomBackup\Administrator\Field;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -55,15 +55,15 @@ class DatabaseTablesField extends FormField
$html = '<div class="mb-2">'; $html = '<div class="mb-2">';
$html .= '<input type="hidden" name="' . $name . '" id="' . $id . '" value="" />'; $html .= '<input type="hidden" name="' . $name . '" id="' . $id . '" value="" />';
$html .= '<div class="form-text mb-2">' . Text::_('COM_MOKOBACKUP_FIELD_EXCLUDE_TABLES_HELP') . '</div>'; $html .= '<div class="form-text mb-2">' . Text::_('COM_MOKOJOOMBACKUP_FIELD_EXCLUDE_TABLES_HELP') . '</div>';
$html .= '<div class="table-responsive" style="max-height:400px; overflow-y:auto;">'; $html .= '<div class="table-responsive" style="max-height:400px; overflow-y:auto;">';
$html .= '<table class="table table-sm table-hover mb-0">'; $html .= '<table class="table table-sm table-hover mb-0">';
$html .= '<thead class="sticky-top bg-white"><tr>'; $html .= '<thead class="sticky-top bg-white"><tr>';
$html .= '<th class="w-1"><input type="checkbox" id="' . $id . '_toggleData" title="Toggle all data" /></th>'; $html .= '<th class="w-1"><input type="checkbox" id="' . $id . '_toggleData" title="Toggle all data" /></th>';
$html .= '<th class="w-1">' . Text::_('COM_MOKOBACKUP_FIELD_EXCLUDE_DATA') . '</th>'; $html .= '<th class="w-1">' . Text::_('COM_MOKOJOOMBACKUP_FIELD_EXCLUDE_DATA') . '</th>';
$html .= '<th class="w-1"><input type="checkbox" id="' . $id . '_toggleStructure" title="Toggle all structure" /></th>'; $html .= '<th class="w-1"><input type="checkbox" id="' . $id . '_toggleStructure" title="Toggle all structure" /></th>';
$html .= '<th class="w-1">' . Text::_('COM_MOKOBACKUP_FIELD_EXCLUDE_STRUCTURE') . '</th>'; $html .= '<th class="w-1">' . Text::_('COM_MOKOJOOMBACKUP_FIELD_EXCLUDE_STRUCTURE') . '</th>';
$html .= '<th>' . Text::_('COM_MOKOBACKUP_FIELD_TABLE_NAME') . '</th>'; $html .= '<th>' . Text::_('COM_MOKOJOOMBACKUP_FIELD_TABLE_NAME') . '</th>';
$html .= '</tr></thead><tbody>'; $html .= '</tr></thead><tbody>';
foreach ($tables as $table) { foreach ($tables as $table) {
@@ -2,7 +2,7 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
@@ -11,7 +11,7 @@
* Loads the directory tree from the server via AJAX (browseDir endpoint). * Loads the directory tree from the server via AJAX (browseDir endpoint).
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Field; namespace Joomla\Component\MokoJoomBackup\Administrator\Field;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -38,9 +38,9 @@ class DirectoryFilterField extends FormField
$itemsJson = json_encode($items); $itemsJson = json_encode($items);
$jRoot = json_encode(JPATH_ROOT); $jRoot = json_encode(JPATH_ROOT);
$labelExclude = Text::_('COM_MOKOBACKUP_FILTER_EXCLUDED'); $labelExclude = Text::_('COM_MOKOJOOMBACKUP_FILTER_EXCLUDED');
$labelInclude = Text::_('COM_MOKOBACKUP_FILTER_INCLUDED'); $labelInclude = Text::_('COM_MOKOJOOMBACKUP_FILTER_INCLUDED');
$labelManual = Text::_('COM_MOKOBACKUP_FILTER_ADD_MANUAL'); $labelManual = Text::_('COM_MOKOJOOMBACKUP_FILTER_ADD_MANUAL');
$addLabel = Text::_('JGLOBAL_FIELD_ADD'); $addLabel = Text::_('JGLOBAL_FIELD_ADD');
$placeholder = htmlspecialchars((string) ($this->element['hint'] ?? 'path/to/directory'), ENT_QUOTES, 'UTF-8'); $placeholder = htmlspecialchars((string) ($this->element['hint'] ?? 'path/to/directory'), ENT_QUOTES, 'UTF-8');
@@ -163,7 +163,7 @@ class DirectoryFilterField extends FormField
const tokenName = Joomla.getOptions('csrf.token') || ''; const tokenName = Joomla.getOptions('csrf.token') || '';
if (tokenName) form.append(tokenName, '1'); if (tokenName) form.append(tokenName, '1');
fetch('index.php?option=com_mokobackup&format=json', { fetch('index.php?option=com_mokojoombackup&format=json', {
method: 'POST', body: form, method: 'POST', body: form,
headers: { 'X-Requested-With': 'XMLHttpRequest' } headers: { 'X-Requested-With': 'XMLHttpRequest' }
}) })
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Field; namespace Joomla\Component\MokoJoomBackup\Administrator\Field;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Field; namespace Joomla\Component\MokoJoomBackup\Administrator\Field;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -39,15 +39,15 @@ class FolderPickerField extends FormField
$statusClass = $exists ? 'text-success' : 'text-danger'; $statusClass = $exists ? 'text-success' : 'text-danger';
$statusIcon = $exists ? 'icon-publish' : 'icon-unpublish'; $statusIcon = $exists ? 'icon-publish' : 'icon-unpublish';
$statusText = $exists $statusText = $exists
? Text::_('COM_MOKOBACKUP_FOLDER_EXISTS') ? Text::_('COM_MOKOJOOMBACKUP_FOLDER_EXISTS')
: Text::_('COM_MOKOBACKUP_FOLDER_NOT_FOUND'); : Text::_('COM_MOKOJOOMBACKUP_FOLDER_NOT_FOUND');
$absPathSafe = htmlspecialchars($absPath, ENT_QUOTES, 'UTF-8'); $absPathSafe = htmlspecialchars($absPath, ENT_QUOTES, 'UTF-8');
return <<<HTML return <<<HTML
<div class="input-group"> <div class="input-group">
<input type="text" name="{$name}" id="{$id}" value="{$value}" <input type="text" name="{$name}" id="{$id}" value="{$value}"
class="form-control" maxlength="512" class="form-control" maxlength="512"
placeholder="/home/user/backups or administrator/components/com_mokobackup/backups" /> placeholder="/home/user/backups or administrator/components/com_mokojoombackup/backups" />
<button type="button" class="btn btn-outline-secondary" id="{$id}_btn"> <button type="button" class="btn btn-outline-secondary" id="{$id}_btn">
<span class="icon-folder-open" aria-hidden="true"></span> <span class="icon-folder-open" aria-hidden="true"></span>
Browse Browse
@@ -91,7 +91,7 @@ class FolderPickerField extends FormField
var tokenName = Joomla.getOptions('csrf.token') || ''; var tokenName = Joomla.getOptions('csrf.token') || '';
if (tokenName) form.append(tokenName, '1'); if (tokenName) form.append(tokenName, '1');
fetch('index.php?option=com_mokobackup&format=json', { fetch('index.php?option=com_mokojoombackup&format=json', {
method: 'POST', method: 'POST',
body: form, body: form,
headers: { 'X-Requested-With': 'XMLHttpRequest' } headers: { 'X-Requested-With': 'XMLHttpRequest' }
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Model; namespace Joomla\Component\MokoJoomBackup\Administrator\Model;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -20,7 +20,7 @@ class BackupModel extends AdminModel
public function getForm($data = [], $loadData = true) public function getForm($data = [], $loadData = true)
{ {
$form = $this->loadForm( $form = $this->loadForm(
'com_mokobackup.backup', 'com_mokojoombackup.backup',
'backup', 'backup',
['control' => 'jform', 'load_data' => $loadData] ['control' => 'jform', 'load_data' => $loadData]
); );
@@ -30,7 +30,7 @@ class BackupModel extends AdminModel
protected function loadFormData(): object protected function loadFormData(): object
{ {
$data = Factory::getApplication()->getUserState('com_mokobackup.edit.backup.data', []); $data = Factory::getApplication()->getUserState('com_mokojoombackup.edit.backup.data', []);
if (empty($data)) { if (empty($data)) {
$data = $this->getItem(); $data = $this->getItem();
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Model; namespace Joomla\Component\MokoJoomBackup\Administrator\Model;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -41,11 +41,11 @@ class BackupsModel extends ListModel
$query = $db->getQuery(true); $query = $db->getQuery(true);
$query->select('a.*') $query->select('a.*')
->from($db->quoteName('#__mokobackup_records', 'a')); ->from($db->quoteName('#__mokojoombackup_records', 'a'));
// Join profile title // Join profile title
$query->select($db->quoteName('p.title', 'profile_title')) $query->select($db->quoteName('p.title', 'profile_title'))
->join('LEFT', $db->quoteName('#__mokobackup_profiles', 'p') . ' ON p.id = a.profile_id'); ->join('LEFT', $db->quoteName('#__mokojoombackup_profiles', 'p') . ' ON p.id = a.profile_id');
// Filter by status // Filter by status
$status = $this->getState('filter.status'); $status = $this->getState('filter.status');
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Model; namespace Joomla\Component\MokoJoomBackup\Administrator\Model;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -27,8 +27,8 @@ class DashboardModel extends BaseDatabaseModel
$db = $this->getDatabase(); $db = $this->getDatabase();
$query = $db->getQuery(true) $query = $db->getQuery(true)
->select('r.*, p.title AS profile_title') ->select('r.*, p.title AS profile_title')
->from($db->quoteName('#__mokobackup_records', 'r')) ->from($db->quoteName('#__mokojoombackup_records', 'r'))
->join('LEFT', $db->quoteName('#__mokobackup_profiles', 'p') . ' ON p.id = r.profile_id') ->join('LEFT', $db->quoteName('#__mokojoombackup_profiles', 'p') . ' ON p.id = r.profile_id')
->where($db->quoteName('r.status') . ' = ' . $db->quote('complete')) ->where($db->quoteName('r.status') . ' = ' . $db->quote('complete'))
->order($db->quoteName('r.backupend') . ' DESC'); ->order($db->quoteName('r.backupend') . ' DESC');
$db->setQuery($query, 0, 1); $db->setQuery($query, 0, 1);
@@ -37,7 +37,7 @@ class DashboardModel extends BaseDatabaseModel
} }
/** /**
* Query com_scheduler for the next scheduled MokoBackup task. * Query com_scheduler for the next scheduled MokoJoomBackup task.
* *
* @return object|null Object with next_execution and title, or null * @return object|null Object with next_execution and title, or null
*/ */
@@ -49,7 +49,7 @@ class DashboardModel extends BaseDatabaseModel
$query = $db->getQuery(true) $query = $db->getQuery(true)
->select($db->quoteName(['t.next_execution', 't.title'])) ->select($db->quoteName(['t.next_execution', 't.title']))
->from($db->quoteName('#__scheduler_tasks', 't')) ->from($db->quoteName('#__scheduler_tasks', 't'))
->where($db->quoteName('t.type') . ' = ' . $db->quote('mokobackup.run_profile')) ->where($db->quoteName('t.type') . ' = ' . $db->quote('mokojoombackup.run_profile'))
->where($db->quoteName('t.state') . ' = 1') ->where($db->quoteName('t.state') . ' = 1')
->order($db->quoteName('t.next_execution') . ' ASC'); ->order($db->quoteName('t.next_execution') . ' ASC');
$db->setQuery($query, 0, 1); $db->setQuery($query, 0, 1);
@@ -73,7 +73,7 @@ class DashboardModel extends BaseDatabaseModel
$query = $db->getQuery(true) $query = $db->getQuery(true)
->select('COUNT(*) AS total_count') ->select('COUNT(*) AS total_count')
->select('COALESCE(SUM(' . $db->quoteName('total_size') . '), 0) AS total_size') ->select('COALESCE(SUM(' . $db->quoteName('total_size') . '), 0) AS total_size')
->from($db->quoteName('#__mokobackup_records')) ->from($db->quoteName('#__mokojoombackup_records'))
->where($db->quoteName('status') . ' = ' . $db->quote('complete')); ->where($db->quoteName('status') . ' = ' . $db->quote('complete'));
$db->setQuery($query); $db->setQuery($query);
$stats = $db->loadObject(); $stats = $db->loadObject();
@@ -82,7 +82,7 @@ class DashboardModel extends BaseDatabaseModel
$cutoff = date('Y-m-d H:i:s', strtotime('-7 days')); $cutoff = date('Y-m-d H:i:s', strtotime('-7 days'));
$query = $db->getQuery(true) $query = $db->getQuery(true)
->select('COUNT(*) AS fail_count') ->select('COUNT(*) AS fail_count')
->from($db->quoteName('#__mokobackup_records')) ->from($db->quoteName('#__mokojoombackup_records'))
->where($db->quoteName('status') . ' = ' . $db->quote('fail')) ->where($db->quoteName('status') . ' = ' . $db->quote('fail'))
->where($db->quoteName('backupstart') . ' >= ' . $db->quote($cutoff)); ->where($db->quoteName('backupstart') . ' >= ' . $db->quote($cutoff));
$db->setQuery($query); $db->setQuery($query);
@@ -123,14 +123,14 @@ class DashboardModel extends BaseDatabaseModel
]; ];
// Backup directory writable — check the default path // Backup directory writable — check the default path
$defaultDir = JPATH_ADMINISTRATOR . '/components/com_mokobackup/backups'; $defaultDir = JPATH_ADMINISTRATOR . '/components/com_mokojoombackup/backups';
$backupDir = $defaultDir; $backupDir = $defaultDir;
// If profiles use a custom directory, check that instead // If profiles use a custom directory, check that instead
$db2 = $this->getDatabase(); $db2 = $this->getDatabase();
$qDir = $db2->getQuery(true) $qDir = $db2->getQuery(true)
->select($db2->quoteName('backup_dir')) ->select($db2->quoteName('backup_dir'))
->from($db2->quoteName('#__mokobackup_profiles')) ->from($db2->quoteName('#__mokojoombackup_profiles'))
->where($db2->quoteName('published') . ' = 1') ->where($db2->quoteName('published') . ' = 1')
->where($db2->quoteName('backup_dir') . ' != ' . $db2->quote('')) ->where($db2->quoteName('backup_dir') . ' != ' . $db2->quote(''))
->where($db2->quoteName('backup_dir') . ' IS NOT NULL'); ->where($db2->quoteName('backup_dir') . ' IS NOT NULL');
@@ -173,11 +173,11 @@ class DashboardModel extends BaseDatabaseModel
public function isUsingDefaultBackupDir(): bool public function isUsingDefaultBackupDir(): bool
{ {
$db = $this->getDatabase(); $db = $this->getDatabase();
$default = 'administrator/components/com_mokobackup/backups'; $default = 'administrator/components/com_mokojoombackup/backups';
$query = $db->getQuery(true) $query = $db->getQuery(true)
->select('COUNT(*)') ->select('COUNT(*)')
->from($db->quoteName('#__mokobackup_profiles')) ->from($db->quoteName('#__mokojoombackup_profiles'))
->where($db->quoteName('published') . ' = 1') ->where($db->quoteName('published') . ' = 1')
->where('(' . $db->quoteName('backup_dir') . ' = ' . $db->quote($default) ->where('(' . $db->quoteName('backup_dir') . ' = ' . $db->quote($default)
. ' OR ' . $db->quoteName('backup_dir') . ' = ' . $db->quote('') . ' OR ' . $db->quoteName('backup_dir') . ' = ' . $db->quote('')
@@ -197,7 +197,7 @@ class DashboardModel extends BaseDatabaseModel
$db = $this->getDatabase(); $db = $this->getDatabase();
$query = $db->getQuery(true) $query = $db->getQuery(true)
->select($db->quoteName(['id', 'title', 'backup_type'])) ->select($db->quoteName(['id', 'title', 'backup_type']))
->from($db->quoteName('#__mokobackup_profiles')) ->from($db->quoteName('#__mokojoombackup_profiles'))
->where($db->quoteName('published') . ' = 1') ->where($db->quoteName('published') . ' = 1')
->order($db->quoteName('ordering') . ' ASC'); ->order($db->quoteName('ordering') . ' ASC');
$db->setQuery($query); $db->setQuery($query);
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Model; namespace Joomla\Component\MokoJoomBackup\Administrator\Model;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -20,7 +20,7 @@ class ProfileModel extends AdminModel
public function getForm($data = [], $loadData = true) public function getForm($data = [], $loadData = true)
{ {
$form = $this->loadForm( $form = $this->loadForm(
'com_mokobackup.profile', 'com_mokojoombackup.profile',
'profile', 'profile',
['control' => 'jform', 'load_data' => $loadData] ['control' => 'jform', 'load_data' => $loadData]
); );
@@ -30,7 +30,7 @@ class ProfileModel extends AdminModel
protected function loadFormData(): object protected function loadFormData(): object
{ {
$data = Factory::getApplication()->getUserState('com_mokobackup.edit.profile.data', []); $data = Factory::getApplication()->getUserState('com_mokojoombackup.edit.profile.data', []);
if (empty($data)) { if (empty($data)) {
$data = $this->getItem(); $data = $this->getItem();
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Model; namespace Joomla\Component\MokoJoomBackup\Administrator\Model;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -38,7 +38,7 @@ class ProfilesModel extends ListModel
$query = $db->getQuery(true); $query = $db->getQuery(true);
$query->select('a.*') $query->select('a.*')
->from($db->quoteName('#__mokobackup_profiles', 'a')); ->from($db->quoteName('#__mokojoombackup_profiles', 'a'));
$published = $this->getState('filter.published'); $published = $this->getState('filter.published');
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Table; namespace Joomla\Component\MokoJoomBackup\Administrator\Table;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -19,7 +19,7 @@ class BackupTable extends Table
{ {
public function __construct(DatabaseDriver $db) public function __construct(DatabaseDriver $db)
{ {
parent::__construct('#__mokobackup_records', 'id', $db); parent::__construct('#__mokojoombackup_records', 'id', $db);
} }
public function check(): bool public function check(): bool
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\Table; namespace Joomla\Component\MokoJoomBackup\Administrator\Table;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -19,7 +19,7 @@ class ProfileTable extends Table
{ {
public function __construct(DatabaseDriver $db) public function __construct(DatabaseDriver $db)
{ {
parent::__construct('#__mokobackup_profiles', 'id', $db); parent::__construct('#__mokojoombackup_profiles', 'id', $db);
} }
public function check(): bool public function check(): bool
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\View\Backup; namespace Joomla\Component\MokoJoomBackup\Administrator\View\Backup;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -33,7 +33,7 @@ class HtmlView extends BaseHtmlView
protected function addToolbar(): void protected function addToolbar(): void
{ {
ToolbarHelper::title(Text::_('COM_MOKOBACKUP_BACKUP_DETAIL'), 'database'); ToolbarHelper::title(Text::_('COM_MOKOJOOMBACKUP_BACKUP_DETAIL'), 'database');
ToolbarHelper::back('JTOOLBAR_BACK', 'index.php?option=com_mokobackup&view=backups'); ToolbarHelper::back('JTOOLBAR_BACK', 'index.php?option=com_mokojoombackup&view=backups');
} }
} }
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\View\Backups; namespace Joomla\Component\MokoJoomBackup\Administrator\View\Backups;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -39,7 +39,7 @@ class HtmlView extends BaseHtmlView
$db = Factory::getDbo(); $db = Factory::getDbo();
$query = $db->getQuery(true) $query = $db->getQuery(true)
->select($db->quoteName(['id', 'title', 'backup_type'])) ->select($db->quoteName(['id', 'title', 'backup_type']))
->from($db->quoteName('#__mokobackup_profiles')) ->from($db->quoteName('#__mokojoombackup_profiles'))
->where($db->quoteName('published') . ' = 1') ->where($db->quoteName('published') . ' = 1')
->order($db->quoteName('ordering') . ' ASC'); ->order($db->quoteName('ordering') . ' ASC');
$db->setQuery($query); $db->setQuery($query);
@@ -60,7 +60,7 @@ class HtmlView extends BaseHtmlView
try { try {
$db = Factory::getDbo(); $db = Factory::getDbo();
// Find the update site ID linked to pkg_mokobackup // Find the update site ID linked to pkg_mokojoombackup
$query = $db->getQuery(true) $query = $db->getQuery(true)
->select($db->quoteName('us.update_site_id')) ->select($db->quoteName('us.update_site_id'))
->from($db->quoteName('#__update_sites', 'us')) ->from($db->quoteName('#__update_sites', 'us'))
@@ -74,7 +74,7 @@ class HtmlView extends BaseHtmlView
$db->quoteName('#__extensions', 'e') $db->quoteName('#__extensions', 'e')
. ' ON ' . $db->quoteName('e.extension_id') . ' = ' . $db->quoteName('use.extension_id') . ' ON ' . $db->quoteName('e.extension_id') . ' = ' . $db->quoteName('use.extension_id')
) )
->where($db->quoteName('e.element') . ' = ' . $db->quote('pkg_mokobackup')) ->where($db->quoteName('e.element') . ' = ' . $db->quote('pkg_mokojoombackup'))
->where($db->quoteName('e.type') . ' = ' . $db->quote('package')) ->where($db->quoteName('e.type') . ' = ' . $db->quote('package'))
->setLimit(1); ->setLimit(1);
@@ -87,12 +87,12 @@ class HtmlView extends BaseHtmlView
); );
Factory::getApplication()->enqueueMessage( Factory::getApplication()->enqueueMessage(
Text::sprintf('COM_MOKOBACKUP_UPDATE_SITE_NOTICE', $editUrl), Text::sprintf('COM_MOKOJOOMBACKUP_UPDATE_SITE_NOTICE', $editUrl),
'info' 'info'
); );
} else { } else {
Factory::getApplication()->enqueueMessage( Factory::getApplication()->enqueueMessage(
Text::_('COM_MOKOBACKUP_UPDATE_SITE_MISSING'), Text::_('COM_MOKOJOOMBACKUP_UPDATE_SITE_MISSING'),
'warning' 'warning'
); );
} }
@@ -103,11 +103,11 @@ class HtmlView extends BaseHtmlView
protected function addToolbar(): void protected function addToolbar(): void
{ {
ToolbarHelper::title(Text::_('COM_MOKOBACKUP_BACKUPS_TITLE'), 'database'); ToolbarHelper::title(Text::_('COM_MOKOJOOMBACKUP_BACKUPS_TITLE'), 'database');
ToolbarHelper::custom('backups.start', 'download', '', 'COM_MOKOBACKUP_TOOLBAR_BACKUP_NOW', false); ToolbarHelper::custom('backups.start', 'download', '', 'COM_MOKOJOOMBACKUP_TOOLBAR_BACKUP_NOW', false);
ToolbarHelper::custom('backups.restore', 'upload', '', 'COM_MOKOBACKUP_TOOLBAR_RESTORE', true); ToolbarHelper::custom('backups.restore', 'upload', '', 'COM_MOKOJOOMBACKUP_TOOLBAR_RESTORE', true);
ToolbarHelper::custom('backups.verify', 'shield', '', 'COM_MOKOBACKUP_TOOLBAR_VERIFY', true); ToolbarHelper::custom('backups.verify', 'shield', '', 'COM_MOKOJOOMBACKUP_TOOLBAR_VERIFY', true);
ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'backups.delete'); ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'backups.delete');
ToolbarHelper::preferences('com_mokobackup'); ToolbarHelper::preferences('com_mokojoombackup');
} }
} }
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\View\Dashboard; namespace Joomla\Component\MokoJoomBackup\Administrator\View\Dashboard;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -27,7 +27,7 @@ class HtmlView extends BaseHtmlView
public function display($tpl = null): void public function display($tpl = null): void
{ {
/** @var \Joomla\Component\MokoBackup\Administrator\Model\DashboardModel $model */ /** @var \Joomla\Component\MokoJoomBackup\Administrator\Model\DashboardModel $model */
$model = $this->getModel(); $model = $this->getModel();
$this->lastBackup = $model->getLastBackup(); $this->lastBackup = $model->getLastBackup();
@@ -44,7 +44,7 @@ class HtmlView extends BaseHtmlView
protected function addToolbar(): void protected function addToolbar(): void
{ {
ToolbarHelper::title(Text::_('COM_MOKOBACKUP_DASHBOARD_TITLE'), 'archive'); ToolbarHelper::title(Text::_('COM_MOKOJOOMBACKUP_DASHBOARD_TITLE'), 'archive');
ToolbarHelper::preferences('com_mokobackup'); ToolbarHelper::preferences('com_mokojoombackup');
} }
} }
@@ -2,13 +2,13 @@
/** /**
* @package MokoJoomBackup * @package MokoJoomBackup
* @subpackage com_mokobackup * @subpackage com_mokojoombackup
* @author Moko Consulting <hello@mokoconsulting.tech> * @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE * @license GNU General Public License version 3 or later; see LICENSE
*/ */
namespace Joomla\Component\MokoBackup\Administrator\View\Profile; namespace Joomla\Component\MokoJoomBackup\Administrator\View\Profile;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@@ -34,7 +34,7 @@ class HtmlView extends BaseHtmlView
protected function addToolbar(): void protected function addToolbar(): void
{ {
$isNew = empty($this->item->id); $isNew = empty($this->item->id);
$title = $isNew ? 'COM_MOKOBACKUP_PROFILE_NEW' : 'COM_MOKOBACKUP_PROFILE_EDIT'; $title = $isNew ? 'COM_MOKOJOOMBACKUP_PROFILE_NEW' : 'COM_MOKOJOOMBACKUP_PROFILE_EDIT';
ToolbarHelper::title(Text::_($title), 'cog'); ToolbarHelper::title(Text::_($title), 'cog');
ToolbarHelper::apply('profile.apply'); ToolbarHelper::apply('profile.apply');

Some files were not shown because too many files have changed in this diff Show More