Getting Started
Install the bundle as a development dependency in a project that matches its legacy Symfony/PHP constraints:
composer require --dev kunstmaan/generator-bundle
Register it only in the dev/test environment in app/AppKernel.php:
if (in_array($this->getEnvironment(), ['dev', 'test'])) {
$bundles[] = new Kunstmaan\GeneratorBundle\KunstmaanGeneratorBundle();
}
Then clear cache and inspect the available commands:
app/console cache:clear --env=dev
app/console list kuma:generate
app/console help kuma:generate:bundle
Look first at:
- The package README for supported Symfony/Kunstmaan CMS versions.
Command/ for the actual command names, options, and prompts.
Resources/skeleton/ for the generated file layout and conventions.
The first practical use case is scaffolding: generate a new bundle or an admin list in a Kunstmaan CMS project, inspect the generated files, then adapt them to your domain. Treat the output as a starting point, not production-ready code.
Implementation Patterns
Use the generator bundle as a local scaffolding tool rather than a runtime dependency. Generate into a clean branch, review the diff, and commit the generated files.
Typical workflows:
- New bundle scaffolding: run the bundle generator, answer namespace/bundle prompts, then verify autoloading with
composer dump-autoload. Move or rename generated files only after the skeleton works.
- Admin list generation: generate the admin list for an existing entity or a new one, then manually adjust entity fields, admin list configuration, templates, translations, and permissions.
- Default website bootstrap: use the default-site generator as a reference implementation for Kunstmaan CMS page parts, templates, and routing. Expect to strip out demo content and replace it with project-specific structure.
- Repeatable house style: keep generator templates and command classes close at hand; if your team repeats the same modifications, wrap the generated output with your own script or fork the relevant skeleton templates instead of editing
vendor/ directly.
- Review-then-merge: run generators in a throwaway branch, diff generated files against your conventions, and cherry-pick only the useful pieces. This avoids coupling your application structure to the generator’s assumptions.
Integration tips:
- Check each command’s
--help output before scripting it; old Symfony generators often have interactive prompts and limited non-interactive support.
- After generating an admin list, review routing, services, Doctrine mappings, and schema/migration steps manually.
- Keep the bundle out of production registration so generator commands are not exposed in prod.
- If the generated code references Kunstmaan CMS bundles or conventions, confirm those dependencies are already installed and configured.
Gotchas and Tips
- Legacy compatibility is the main risk. The last release was in 2014, so this is Symfony 2 / PHP 5-era tooling. Pin versions carefully and do not assume compatibility with modern Symfony, PHP, or MakerBundle workflows.
- It is Kunstmaan CMS-oriented. Generators may assume specific bundle namespaces, directory layouts, admin list conventions, and template structures. It is not a general-purpose Symfony scaffolder.
- Inspect before overwriting. Generators can create or modify files that conflict with existing code. Run them on a clean working tree, commit or stash first, and review every generated diff.
- Command names and options vary by version. Use
app/console list kuma:generate and app/console help <command> rather than relying on remembered command names.
- Autoloading and cache issues are common. After generating a bundle, run
composer dump-autoload and clear the dev cache. If commands are missing, confirm the bundle is registered in the correct environment.
- Generated code is intentionally generic. Expect to rewrite placeholders, entity fields, templates, translations, permissions, and routing. Do not treat generated admin lists or default sites as finished features.
- Avoid editing vendor skeletons for permanent customization. Copy, override, or fork the generator templates, or build a small internal wrapper command. Direct
vendor/ edits disappear on Composer updates.
- Debug by reading the generator source. For unexpected output, inspect the relevant class under
Command/ and the corresponding files under Resources/skeleton/; that is usually faster than guessing from the generated result.
- Keep it dev-only. Register the bundle only in
dev/test, and do not ship generator commands or dependencies to production unless your deployment process explicitly requires them.