Skip to content

Add more reference example modules (cron, worker, datatable, acl, firewall, integration, language pack)#2

Open
jorikfon wants to merge 1 commit into
masterfrom
add-more-example-modules
Open

Add more reference example modules (cron, worker, datatable, acl, firewall, integration, language pack)#2
jorikfon wants to merge 1 commit into
masterfrom
add-more-example-modules

Conversation

@jorikfon
Copy link
Copy Markdown
Contributor

@jorikfon jorikfon commented Jun 1, 2026

Second batch of exemplary reference modules, each built against primary Core source and verified live on a real MikoPBX (2026.2.118). Targets MikoPBX 2025.1.1, PHP 8.4, Phalcon 5.9.3. Modules are added incrementally as each is verified.

Verified

  • Workers/ModuleExampleCron — scheduled work via createCronTasks() + a supervisor-registered worker (CHECK_BY_PID_NOT_ALERT), funneled through Processes::processPHPWorker() for dedup; onAfterModuleEnable/DisableCronConf::reStart(). Live-verified full lifecycle (enable→crontab line + scheduled runs with distinct PIDs, dedup no-op proven; disable→line removed, no orphans).

In progress (will be pushed to this branch as verified)

  • Workers/ModuleExampleWorker — standalone Beanstalk queue worker (graceful shutdown + retry)
  • WebInterface/ModuleExampleDataTable — server-paginated grid over REST v3 CRUD
  • WebInterface/ModuleExampleAcl — per-role gating of menu + REST (data-driven via ModuleUsersUI)
  • Integration/ModuleExampleFirewall — custom port + fail2ban jail/filter
  • Integration/ModuleExampleIntegration — outbound webhook on call events + click-to-call
  • LanguagePacks/ModuleExampleLanguagePack — installable translations + sound

Demonstrates scheduled work two idiomatic ways, both funneling through one
deduplicated launcher so the job never stacks:
- createCronTasks() appends an every-minute crontab line running the starter
- getModuleWorkers() registers the worker with CHECK_BY_PID_NOT_ALERT
- the starter calls Processes::processPHPWorker() (dedup by process title)
- onAfterModuleEnable/Disable call CronConf::reStart() to regenerate cron

Verified live on MikoPBX 2026.2.118: enable generates the crontab line and the
worker runs on schedule (distinct PIDs, no overlap — dedup no-op proven);
disable removes the line and halts activity with no orphans. All Core APIs
traced to source; php -l clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant