artur-gajewski/documentor-bundle
Installation:
composer require-dev artur-gajewski/documentor-bundle
Add to AppKernel.php under dev/test environment:
$bundles[] = new Aga\DocumentorBundle\DocumentorBundle();
First Run:
php app/console documentation:create
Access generated docs at:
http://yourproject.dev/app_dev.php/bundles/documentor/index.html
Key Files:
app/console (for CLI commands)web/bundles/documentor/ (output directory)src/ (default source directory, configurable)Development Workflow:
documentation:create after code changes:
php app/console documentation:create --force # Overwrite existing docs
CI/CD Integration:
- name: Generate Docs
run: php app/console documentation:create
web/bundles/documentor/ for artifact uploads.Custom Source Paths:
src/ path via config (config.yml):
aga_documentor:
source_dirs: ['src', 'lib']
assets:install post-generation. Disable if using custom asset workflows:
php app/console documentation:create --no-assets
phpdoc via --phpdoc-args:
php app/console documentation:create --phpdoc-args="--template=responsive"
dev/test to avoid bloating production.Permission Issues:
web/bundles/documentor/ must be writable by the web server (e.g., chmod -R 775 web/bundles/).assets:install manually if docs fail to copy:
php app/console assets:install --symlink
phpDocumentor2 Dependencies:
phpdoc is globally available. If missing:
composer global require phpdocumentor/phpdocumentor2
--phpdoc-path:
php app/console documentation:create --phpdoc-path=./vendor/bin/phpdoc
Caching Quirks:
--force to bypass:
php app/console documentation:create --force
php app/console documentation:create -vvv
app/logs/dev.log for phpDocumentor2 errors (e.g., missing @property tags).phpDocumentor2's config:
aga_documentor:
phpdoc_config:
templates:
- responsive
DocumentorBundle:
// services.yml
services:
my.post_doc_hook:
class: AppBundle\Service\PostDocHook
tags:
- { name: kernel.event_listener, event: documentor.post_generate, method: onPostGenerate }
aga_documentor:
source_dirs:
- { path: src, exclude: ['Tests', 'Entity/Listener'] }
```markdown
### Pro Tips
- **Symlink Docs**:
For local development, symlink `web/bundles/documentor` to a global `~/docs` folder for quick access across projects:
```bash
ln -sf ~/projects/myapp/web/bundles/documentor ~/docs/myapp
web/bundles/documentor/v1.0) to support multiple versions:
aga_documentor:
target_dir: "%kernel.root_dir%/../web/bundles/documentor/v{{ app.version }}"
phpdoc's parallel processing:
php app/console documentation:create --phpdoc-args="--processes=4"
How can I help you explore Laravel packages today?