Skip to content

Releases: dravek/local_devtools

Release v1.0.1

05 Mar 18:28
5d11ccb

Choose a tag to compare

local_devtools

local_devtools is a Moodle local plugin that adds a Developer Tools dropdown to the top navigation bar for authorized users.

The dropdown provides quick admin/developer actions without leaving the current page:

  • Purge all caches
  • Run cron
  • Run a specific scheduled task

What it does

When a user with the local/devtools:use capability is logged in:

  1. A wrench icon appears in the navbar.
  2. Clicking it opens a dropdown with quick actions.
  3. Actions are executed via Moodle external functions (AJAX).
  4. Success/error feedback is shown in-page.

For scheduled tasks, the plugin loads available task classes and lets you pick one.

Permission model

Capability:

  • local/devtools:use

By default, this is allowed for the manager archetype in db/access.php.

Technical notes

  • AJAX services are declared in db/services.php:
    • local_devtools_purge_caches
    • local_devtools_run_cron
    • local_devtools_run_scheduled_task
  • Cron and scheduled tasks are executed through CLI scripts using the configured PHP binary ($CFG->pathtophp, fallback php).
  • CLI script resolution supports both standard and mixed public/ webroot layouts.
  • Scheduled task selector is enhanced using Moodle form autocomplete.

Installation

  1. Place the plugin in:

    local/devtools

  2. Visit:

    Site administration -> Notifications

  3. Complete the Moodle upgrade/install flow.

Usage

  1. Log in as a user with local/devtools:use.
  2. Click the wrench icon in the top navbar.
  3. Choose one of the actions:
    • Purge All Caches
    • Run Cron
    • Run Scheduled Task (select task, then click Run Task)
    • Enable/Disable debug messages

Troubleshooting

  • Wrench icon does not appear

    • Verify the plugin is installed and upgraded.
    • Verify user capability local/devtools:use.
  • Cron/task execution fails

    • Verify CLI scripts are available/readable under admin/cli/.
    • Verify PHP CLI is available ($CFG->pathtophp or php on PATH).
  • Task autocomplete/search not showing

    • Purge caches and rebuild frontend assets if needed.
    • Ensure JavaScript is enabled and not blocked by browser policy.

Initial release

05 Mar 17:43
08722c5

Choose a tag to compare

local_devtools

local_devtools is a Moodle local plugin that adds a Developer Tools dropdown to the top navigation bar for authorized users.

The dropdown provides quick admin/developer actions without leaving the current page:

  • Purge all caches
  • Run cron
  • Run a specific scheduled task

What it does

When a user with the local/devtools:use capability is logged in:

  1. A wrench icon appears in the navbar.
  2. Clicking it opens a dropdown with quick actions.
  3. Actions are executed via Moodle external functions (AJAX).
  4. Success/error feedback is shown in-page.

For scheduled tasks, the plugin loads available task classes and lets you pick one.

Permission model

Capability:

  • local/devtools:use

By default, this is allowed for the manager archetype in db/access.php.

Technical notes

  • AJAX services are declared in db/services.php:
    • local_devtools_purge_caches
    • local_devtools_run_cron
    • local_devtools_run_scheduled_task
  • Cron and scheduled tasks are executed through CLI scripts using the configured PHP binary ($CFG->pathtophp, fallback php).
  • CLI script resolution supports both standard and mixed public/ webroot layouts.
  • Scheduled task selector is enhanced using Moodle form autocomplete.

Installation

  1. Place the plugin in:

    local/devtools

  2. Visit:

    Site administration -> Notifications

  3. Complete the Moodle upgrade/install flow.

Usage

  1. Log in as a user with local/devtools:use.
  2. Click the wrench icon in the top navbar.
  3. Choose one of the actions:
    • Purge All Caches
    • Run Cron
    • Run Scheduled Task (select task, then click Run Task)

Troubleshooting

  • Wrench icon does not appear

    • Verify the plugin is installed and upgraded.
    • Verify user capability local/devtools:use.
  • Cron/task execution fails

    • Verify CLI scripts are available/readable under admin/cli/.
    • Verify PHP CLI is available ($CFG->pathtophp or php on PATH).
  • Task autocomplete/search not showing

    • Purge caches and rebuild frontend assets if needed.
    • Ensure JavaScript is enabled and not blocked by browser policy.