PHP 8.3.31
Preview: DirectoryLoader.php Size: 1.43 KB
/home/getspomw/royalsquad.us/vendor/symfony/routing/Loader/DirectoryLoader.php

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Routing\Loader;

use Symfony\Component\Config\Loader\FileLoader;
use Symfony\Component\Config\Resource\DirectoryResource;
use Symfony\Component\Routing\RouteCollection;

class DirectoryLoader extends FileLoader
{
    public function load(mixed $file, ?string $type = null): mixed
    {
        $path = $this->locator->locate($file);

        $collection = new RouteCollection();
        $collection->addResource(new DirectoryResource($path));

        foreach (scandir($path) as $dir) {
            if ('.' !== $dir[0]) {
                $this->setCurrentDir($path);
                $subPath = $path.'/'.$dir;
                $subType = null;

                if (is_dir($subPath)) {
                    $subPath .= '/';
                    $subType = 'directory';
                }

                $subCollection = $this->import($subPath, $subType, false, $path);
                $collection->addCollection($subCollection);
            }
        }

        return $collection;
    }

    public function supports(mixed $resource, ?string $type = null): bool
    {
        // only when type is forced to directory, not to conflict with AttributeLoader

        return 'directory' === $type;
    }
}

Directory Contents

Dirs: 2 × Files: 13

Name Size Perms Modified Actions
- drwxrwxrwx 2026-04-21 08:55:18
Edit Download
schema DIR
- drwxrwxrwx 2025-09-17 06:53:20
Edit Download
13.90 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
2.56 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
4.29 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
919 B lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
929 B lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
1.43 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
12.74 KB lrw-r--r-- 2026-04-26 12:29:06
Edit Download
1010 B lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
2.60 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
2.12 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
3.18 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
17.62 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
11.81 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).