comparison vendor/symfony/dependency-injection/Loader/DirectoryLoader.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
8 * For the full copyright and license information, please view the LICENSE 8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code. 9 * file that was distributed with this source code.
10 */ 10 */
11 11
12 namespace Symfony\Component\DependencyInjection\Loader; 12 namespace Symfony\Component\DependencyInjection\Loader;
13
14 use Symfony\Component\Config\Resource\DirectoryResource;
15 13
16 /** 14 /**
17 * DirectoryLoader is a recursive loader to go through directories. 15 * DirectoryLoader is a recursive loader to go through directories.
18 * 16 *
19 * @author Sebastien Lavoie <seb@wemakecustom.com> 17 * @author Sebastien Lavoie <seb@wemakecustom.com>
25 */ 23 */
26 public function load($file, $type = null) 24 public function load($file, $type = null)
27 { 25 {
28 $file = rtrim($file, '/'); 26 $file = rtrim($file, '/');
29 $path = $this->locator->locate($file); 27 $path = $this->locator->locate($file);
30 $this->container->addResource(new DirectoryResource($path)); 28 $this->container->fileExists($path, false);
31 29
32 foreach (scandir($path) as $dir) { 30 foreach (scandir($path) as $dir) {
33 if ('.' !== $dir[0]) { 31 if ('.' !== $dir[0]) {
34 if (is_dir($path.'/'.$dir)) { 32 if (is_dir($path.'/'.$dir)) {
35 $dir .= '/'; // append / to allow recursion 33 $dir .= '/'; // append / to allow recursion