You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 3 години
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. };