Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

dependencies.php 1.1KB

3 anos atrás
1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Symfony\Component\DependencyInjection\Loader\Configurator;
  3. return function(ContainerConfigurator $configurator) {
  4. $services = $configurator->services();
  5. $baseDirectoryDependency = dirname(__FILE__).'/../src/Dependency/';
  6. $directoriesDenpendencyInjection = scandir($baseDirectoryDependency);
  7. $dependencies = [];
  8. foreach($directoriesDenpendencyInjection as $directory) {
  9. if($directory != '.' && $directory != '..' && is_dir($baseDirectoryDependency.$directory)) {
  10. $filesDenpendencyInjection = scandir($baseDirectoryDependency.$directory);
  11. foreach($filesDenpendencyInjection as $file) {
  12. if($file != '.' && $file != '..') {
  13. $classDependency = 'App\Dependency\\'.$directory.'\\'.str_replace('.php', '', $file) ;
  14. $dependencies[] = new $classDependency;
  15. }
  16. }
  17. }
  18. }
  19. foreach($dependencies as $dependency) {
  20. $aliases = $dependency->getAliases();
  21. foreach($aliases as $alias => $final) {
  22. $services->alias($alias, $final);
  23. }
  24. }
  25. };