< Home | Architecture | Troubleshooting >
Development Guide
Local Setup
git clone https://git.mokoconsulting.tech/MokoConsulting/MokoGalleryCalendar.git
cd MokoGalleryCalendar
The installable plugin source lives in src/. Everything outside src/ (workflows, docs, README) is repo-level infrastructure.
Building a ZIP
cd src
zip -r ../mokojgdpc.zip . \
-x ".ftpignore" "sftp-config*" "*.ppk" "*.pem" "*.key" ".env*"
Or trigger the release workflow via Gitea Actions (see CI/CD below).
Testing Locally
- Symlink or copy
src/into your Joomla installation:plugins/system/mokojgdpc/ -> src/ - Discover and enable the plugin via System > Manage > Extensions > Discover
- The install script will create the mapping table and seed existing events
Key Methods
MokoJGDPC.php
| Method | Visibility | Purpose |
|---|---|---|
onContentAfterSave() |
public | Entry point for event creation/update |
onContentAfterDelete() |
public | Entry point for event deletion |
onAfterRoute() |
public | 7-day fallback for pending processing |
processTask() |
private | Task Scheduler entry point |
processPendingMappings() |
private | Core logic: find and create overdue categories |
createGalleryCategory() |
private | Nested set insert + access/rules |
createCategoryAsset() |
private | ACL asset record creation |
deleteGalleryCategory() |
private | Nested set delete + gap close |
deleteCategoryAsset() |
private | ACL asset cleanup |
resolvePermissionRules() |
private | Load rules from template category |
uniqueAlias() |
private | Deduplicate URL aliases |
extractEventDate() |
private | Parse event start date (site timezone) |
script.php
| Method | Purpose |
|---|---|
install() |
Create table, seed events, register scheduled task |
update() |
Ensure table, migrate schema, ensure task |
uninstall() |
Drop table, remove task, clean cache file |
seedExistingEvents() |
Map all unmapped DPCalendar events on first install |
migrateSchema() |
Add event_date column if upgrading from pre-01.00.01 |
ensureScheduledTask() |
Idempotent task registration in #__scheduler_tasks |
Branching and Releases
| Branch | Purpose |
|---|---|
main |
Stable releases |
dev |
Development (PRs target here) |
Releases are triggered via the release.yml workflow (workflow_dispatch). Dev releases use stability development; stable releases use stable.
CI/CD Workflows
release.yml
-
Triggered by tag push (
XX.YY.ZZ) or manual dispatch -
Auto-bumps patch version in README.md, manifest, and updates.xml
-
Builds ZIP from
src/, creates Gitea release, uploads asset -
Updates
updates.xmlwith SHA-256 hash -
Triggered on push to
dev/alpha/beta/rcbranches (whensrc/changes) -
Builds ZIP + tar.gz packages
-
Creates/updates Gitea releases per stability channel
-
Generates
updates.xmlentries for Joomla's update system -
Optionally deploys to dev server via SFTP
Adding a New Config Field
- Add the
<field>element tosrc/mokojgdpc.xmlinside<fieldset name="basic"> - Add label and description language strings to both
en-GBanden-US.inifiles - Read the value in PHP via
$this->params->get('field_name', 'default') - If the field affects seeding, also read it in
script.phpfrom$pluginParams
Modifying the Database Schema
- Update the
CREATE TABLEstatement inscript.php::createTable() - Add an
ALTER TABLEinscript.php::migrateSchema()for upgrades - The migration checks
$db->getTableColumns()-- only runs if the column doesn't exist yet
Repo: MokoGalleryCalendar . MokoStandards
| Revision | Date | Author | Description |
|---|---|---|---|
| 1.1 | 2026-05-10 | Moko Consulting | Add nav links, clean formatting |
| 1.0 | 2026-05-09 | Moko Consulting | Initial version |