getPath())) { $providerRepository = $registry->getProviderRepository(); foreach (new DirectoryIterator($this->getPath()) as $item) { if ($item->isFile() && (($suffixStart = strpos($item->getFilename(), 'Provider.php')) !== false)) { $className = substr($item->getFilename(), 0, $suffixStart+8); // $loadableFiles[$className] = $item->getPathname(); include_once $item->getPathname(); $providerRepository->addProvider(new $className()); } } } } }