Tag Archives: php

Profiling a Dockerized Moodle with Xdebug and QCachegrind on macOS

If you run Moodle under moodle-docker on a Mac and a page feels slow, eyeballing the code only gets you so far. The honest answer is a profiler. 🐳 Here’s how I wired up Xdebug for both step-debugging and on-demand … Continue reading

Posted in Moodle | Tagged , , , , | Leave a comment

A Quick Tour of Mustache Templating in PHP (and Everywhere Else)

If you’ve worked in a large PHP codebase like Moodle, you’ve bumped into files ending in .mustache and wondered what those double curly braces are doing. 🐘 The short version: Mustache is a logic-less templating language, and the syntax you … Continue reading

Posted in PHP, Web Development | Tagged , , | Leave a comment

Adding a Moodle cron sidecar to moodle-docker via local.yml

The moodle-docker stack is designed primarily for automated testing — Behat, PHPUnit, and so on — which is why it doesn’t ship a cron container. A background scheduler would interfere with deterministic test runs, so the README’s only nod to … Continue reading

Posted in Moodle | Tagged , , | Comments Off on Adding a Moodle cron sidecar to moodle-docker via local.yml

Creating a new theme and changing font on Moodle 5

I wanted to swap the default font in a Moodle 5 install. Specifically: keep Boost, the stock Moodle theme, but use Inter from Google Fonts instead of the Bootstrap system stack. The official path is “make a child theme of … Continue reading

Posted in Moodle | Tagged , , , , | Comments Off on Creating a new theme and changing font on Moodle 5

Multi tenancy in Laravel using stancl/tenancy

I spent a day inside stancl/tenancy (the database-per-tenant Laravel package) shipping a real change to a multi-tenant Software-as-a-Service (SaaS) application, and a few things finally clicked for me — none of which were obvious from the documentation alone. 💡 Here … Continue reading

Posted in Laravel, PHP | Tagged , , , , | Comments Off on Multi tenancy in Laravel using stancl/tenancy

Moodle Plugin Development: version.php, install.xml, upgrade.php, and tasks.php Explained

Moodle is one of the largest Learning Management System (LMS) platforms in the world, and one of its quietly excellent superpowers is its plugin architecture. Every feature you can add — a new activity, a block, a report, an authentication … Continue reading

Posted in PHP | Tagged , , , | Comments Off on Moodle Plugin Development: version.php, install.xml, upgrade.php, and tasks.php Explained

Using PHP with Mustache: Practical Examples and Gotchas

If you want clean templates in PHP without pulling in a full framework, Mustache is a great fit. It keeps logic out of views, which forces you to prepare data in PHP first and makes templates easier to scan later. … Continue reading

Posted in PHP | Tagged , | Comments Off on Using PHP with Mustache: Practical Examples and Gotchas

Reading Laravel Config From a Queued Job — and the env() Trap That Bites You in Production

Today’s lesson came from a perfectly innocent-looking change in a Laravel app. We had a magic number — a chunk size — sprinkled across three call sites: 123foreach (array_chunk($userIds, 100) as $chunk) {     SendOnboardingEmailJob::dispatch($chunk); } One reviewer flagged … Continue reading

Posted in Laravel, PHP | Tagged , , | Comments Off on Reading Laravel Config From a Queued Job — and the env() Trap That Bites You in Production

When a Composer package vanishes from GitHub: don’t panic, and don’t delete vendor/

Today our CI/CD pipeline went red on a job that hadn’t been touched in months. The .gitlab-ci.yml was untouched. The branch built fine yesterday. composer install exploded. The relevant chunk of the failure log: 12345678Failed to download acme/some-nova-tool from dist: … Continue reading

Posted in PHP | Tagged , , , , | Comments Off on When a Composer package vanishes from GitHub: don’t panic, and don’t delete vendor/

Spatie activity_log: which method writes to which column? 🐘

If you’re using spatie/laravel-activitylog, you’ve probably written something like activity()->event(…)->log(…) a hundred times without thinking about where each piece lands in the database. The fluent API is friendly, but the column mapping isn’t obvious until you go look — so … Continue reading

Posted in PHP | Tagged , , , | Comments Off on Spatie activity_log: which method writes to which column? 🐘