Guest User

Untitled

a guest
May 26th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. <?php
  2. /**
  3. * Doctrine ORM Configuration
  4. *
  5. * If you have a ./configs/autoload/ directory set up for your project, you can
  6. * drop this config file in it and change the values as you wish. This file is intended
  7. * to be used with a standard Doctrine ORM setup. If you have something more advanced
  8. * you may override the Zend\Di configuration manually (see module.config.php).
  9. */
  10. $settings = array(
  11. // if disabled will not register annotations
  12. 'use_annotations' => true,
  13.  
  14. // if use_annotations (above) is set to true this file will be registered
  15. 'annotation_file' => __DIR__ . '/../../vendor/DoctrineORMModule/vendor/doctrine-orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php',
  16.  
  17. // enables production mode by disabling generation of proxies
  18. 'production' => false,
  19.  
  20. // sets the cache to use for metadata: one of 'array', 'apc', or 'memcache'
  21. 'cache' => 'array',
  22.  
  23. // only used if cache is set to memcache
  24. 'memcache' => array(
  25. 'host' => '127.0.0.1',
  26. 'port' => '11211'
  27. ),
  28.  
  29. // connection parameters
  30. 'connection' => array(
  31. 'driver' => 'pdo_mysql',
  32. 'host' => 'localhost',
  33. 'port' => '3306',
  34. 'user' => 'frisr',
  35. 'password' => 'mangePenge',
  36. 'dbname' => 'frisr',
  37. ),
  38.  
  39. // driver settings
  40. 'driver' => array(
  41. 'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
  42. 'namespace' => 'Application\Entity',
  43. 'paths' => array('module/Application/src/Application/Entity')
  44. ),
  45.  
  46. // namespace aliases for annotations
  47. 'namespace_aliases' => array(
  48. ),
  49. );
  50.  
  51. /**
  52. * YOU DO NOT NEED TO EDIT BELOW THIS LINE.
  53. */
  54. $cache = array('array', 'memcache', 'apc');
  55. if (!in_array($settings['cache'], $cache)) {
  56. throw new InvalidArgumentException(sprintf(
  57. 'cache must be one of: %s',
  58. implode(', ', $cache)
  59. ));
  60. }
  61. $settings['cache'] = 'doctrine_cache_' . $settings['cache'];
  62.  
  63. return array(
  64. 'doctrine_orm_module' => array(
  65. 'annotation_file' => $settings['annotation_file'],
  66. 'use_annotations' => $settings['use_annotations'],
  67. ),
  68. 'di' => array(
  69. 'instance' => array(
  70. 'doctrine_memcache' => array(
  71. 'parameters' => $settings['memcache']
  72. ),
  73. 'orm_config' => array(
  74. 'parameters' => array(
  75. 'opts' => array(
  76. 'entity_namespaces' => $settings['namespace_aliases'],
  77. 'auto_generate_proxies' => !$settings['production']
  78. ),
  79. 'metadataCache' => $settings['cache'],
  80. 'queryCache' => $settings['cache'],
  81. 'resultCache' => $settings['cache'],
  82. )
  83. ),
  84. 'orm_connection' => array(
  85. 'parameters' => array(
  86. 'params' => $settings['connection']
  87. ),
  88. ),
  89. 'orm_driver_chain' => array(
  90. 'parameters' => array(
  91. 'drivers' => array(
  92. 'application_annotation_driver' => $settings['driver']
  93. ),
  94. 'cache' => $settings['cache']
  95. )
  96. ),
  97. ),
  98. ),
  99. );
Add Comment
Please, Sign In to add comment