3.9 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What this is
AeonDumpManager is a Shopware 6 plugin (shopware-platform-plugin) that manages database dumps for
Shopware 6 development environments. It lists, creates, and deletes gzip-compressed mysqldump/
mariadb-dump SQL dumps, both from a Settings-page admin UI (async creation with a polling progress
bar) and via aeon:dump:{list,create,remove} console commands (sync creation). Design decisions and
the full build spec live under .scratch/admin-dump-manager/ and .scratch/dump-manager-implementation-spec/
(Wayfinder maps) — consult those before changing the dump-creation/retention/ACL behavior.
- Plugin bootstrap class:
src/AeonDumpManager.php(extendsShopware\Core\Framework\Plugin) — this is the entry point Shopware calls for install/uninstall/activate/deactivate/update lifecycle hooks. - Plugin class name is wired via
composer.json→extra.shopware-plugin-class. - Services are registered manually in
src/Resources/config/services.xml(Symfony DI, XML format, autowiring is not configured — every new service/command/task must be added here explicitly with its tag, e.g.console.commandorshopware.scheduled.task). - Plugin store-config UI fields (e.g.
maxDumps,retantionDays) are defined insrc/Resources/config/config.xmland read at runtime via Shopware's SystemConfigService. src/Resources/app/administration/holds the admin UI module (Vue-based Shopware Administration extension), currently just theswag-examplescaffold module.
Running the plugin
There is no standalone runtime — this plugin only runs inside a Shopware 6 instance. Local dev uses
docker-compose.yml, which mounts the repo into a dockware/shopware container at
custom/plugins/AeonDumpManager:
docker compose up -d
Shop/Admin/Adminer are all served on port 80/443; SSH into the container on port 22
(SSH_USER=shopware / SSH_PWD=shopware); admin-watcher and storefront-watcher proxies are exposed
on 8888/9998/9999 for bin/build-administration.sh --watch style workflows run inside the container.
Plugin install/activate must be done through Shopware's own tooling inside the container (e.g.
bin/console plugin:refresh, bin/console plugin:install --activate AeonDumpManager) — there is no
composer script for this in this repo.
The container's internal processes run as uid/gid 33 (www-data). The repo directory on the host is
group-owned by that group with setgid bit set (chgrp -R 33 + chmod g+s), so both the container and
host users in group 33 can write without ownership fights.
Tests
PHPUnit, bootstrapped through Shopware's own TestBootstrapper (tests/TestBootstrap.php), which
activates this plugin inside a real Shopware kernel for the test run (KERNEL_CLASS is set to
Shopware\Core\Kernel in phpunit.xml). This means tests require a working Shopware installation/DB
to bootstrap against — they are not runnable as an isolated PHP package.
vendor/bin/phpunit # full suite
vendor/bin/phpunit --filter TestClassName # single test class
vendor/bin/phpunit tests/SomeTest.php # single file
Dependencies
- PHP
^8.1,shopware/core~6.6.0(fromcomposer.json);phpunit/phpunit^10.0as the only dev dependency. - PSR-4 autoload:
AeonDumpManager\→src/,AeonDumpManager\Tests\→tests/.
Adding functionality
- New console commands go in
src/Command/, new scheduled tasks insrc/ScheduledTask/— both must be registered insrc/Resources/config/services.xmlwith the appropriate tag or Shopware will not discover them. - Scheduled tasks need a matching handler (tagged
messenger.message_handler) to actually run; a bareScheduledTasksubclass likeExampleTaskonly defines the schedule, not the behavior.