Configuration.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace Michel\PaperORMBundle\DependencyInjection;
  3. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  4. use Symfony\Component\Config\Definition\ConfigurationInterface;
  5. final class Configuration implements ConfigurationInterface
  6. {
  7. public function getConfigTreeBuilder(): TreeBuilder
  8. {
  9. $treeBuilder = new TreeBuilder('paper_orm');
  10. $rootNode = $treeBuilder->getRootNode();
  11. $rootNode
  12. ->children()
  13. ->scalarNode('dsn')
  14. ->info('Database DSN for PaperORM (ex: mysql://user:pass@127.0.0.1:3306/db)')
  15. ->isRequired()
  16. ->end()
  17. ->booleanNode('debug')
  18. ->info('Enable debug mode (more verbose logging, strict checks)')
  19. ->defaultFalse()
  20. ->end()
  21. ->scalarNode('logger')
  22. ->info('Logger service ID (set null to disable logging)')
  23. ->defaultNull()
  24. ->end()
  25. ->scalarNode('entity_dir')
  26. ->info('Directory containing your entities')
  27. ->defaultValue('%kernel.project_dir%/src/Entity')
  28. ->end()
  29. ->scalarNode('migrations_dir')
  30. ->info('Directory where PaperORM will generate/read migrations')
  31. ->defaultValue('%kernel.project_dir%/migrations')
  32. ->end()
  33. ->scalarNode('migrations_table')
  34. ->info('Database table name used to track executed migrations')
  35. ->defaultValue('mig_versions')
  36. ->end()
  37. ->booleanNode('proxy_autoload')
  38. ->info('Enable proxy autoload')
  39. ->defaultFalse()
  40. ->end()
  41. ->end()
  42. ;
  43. return $treeBuilder;
  44. }
  45. }