Composer plugin providing DRBL backup service integration for the MyAdmin control panel via Symfony EventDispatcher hooks.
composer install # install deps including phpunit/phpunit ^9.6
vendor/bin/phpunit # run tests (uses phpunit.xml.dist)Entry: src/Plugin.php · namespace Detain\MyAdminDrbl\ · PSR-4 via composer.json
Tests: tests/PluginTest.php · namespace Detain\MyAdminDrbl\Tests\ · bootstrap vendor/autoload.php
CI/CD: .github/ contains workflows for automated testing and deployment pipelines
IDE Config: .idea/ contains inspectionProfiles, deployment.xml, and encodings.xml for project setup
Plugin static methods — all receive Symfony\Component\EventDispatcher\GenericEvent $event:
getHooks()— returns array of event hook bindingsgetMenu($event)— registers admin menu entries (checks$GLOBALS['tf']->ima == 'admin'+has_acl)getRequirements($event)— calls$loader->add_requirement('identifier', 'path')for class/function lazy-loadsgetSettings($event)— integrates with MyAdmin settings via$event->getSubject()
- All plugin methods are
public static— no instance state - ACL checks:
function_requirements('has_acl')beforehas_acl('client_billing') - Tests use PHPUnit 9.6; config in
phpunit.xml.dist - Indentation: tabs (enforced by
.scrutinizer.yml) - Commit messages: lowercase, descriptive
// in src/Plugin.php getRequirements()
$loader->add_requirement('my_function', '/../vendor/[package]/src/file.inc.php');// in getHooks() return array:
return [
'drbl_event_name' => ['\\Detain\\MyAdminDrbl\\Plugin', 'myHandler'],
];IMPORTANT: Before every git commit, you MUST ensure Caliber syncs agent configs with the latest code changes.
First, check if the pre-commit hook is already installed:
grep -q "caliber" .git/hooks/pre-commit 2>/dev/null && echo "hook-active" || echo "no-hook"- If hook-active: the hook handles sync automatically — just commit normally. Tell the user: "Caliber will sync your agent configs automatically via the pre-commit hook."
- If no-hook: run Caliber manually before committing:
- Tell the user: "Caliber: Syncing agent configs with your latest changes..."
- Run:
caliber refresh && git add CLAUDE.md .claude/ .cursor/ .cursorrules .github/copilot-instructions.md .github/instructions/ AGENTS.md CALIBER_LEARNINGS.md 2>/dev/null - After it completes, briefly tell the user what Caliber updated. Then proceed with the commit.
If caliber is not found, tell the user: "This project uses Caliber for agent config sync. Run /setup-caliber to get set up."
Read CALIBER_LEARNINGS.md for patterns and anti-patterns learned from previous sessions.
These are auto-extracted from real tool usage — treat them as project-specific rules.