Newscoop\File\Manager\LocalManager::__construct PHP Method

__construct() public method

public __construct ( string $path, string $root, TemplateRepository $repository )
$path string
$root string
$repository Newscoop\Entity\Repository\TemplateRepository
    public function __construct($path, $root, TemplateRepository $repository)
    {
        $rootpath = "{$root}/{$path}";
        $realpath = realpath($rootpath);
        if (!$realpath) {
            throw new \InvalidArgumentException($rootpath);
        }
        $this->root = realpath($root);
        $this->path = str_replace("{$this->root}/", '', $realpath);
        $this->files = array_merge(glob("{$realpath}/*", GLOB_ONLYDIR), glob("{$realpath}/*.*"));
        // get sorted dirs + sorted files
        $this->repository = $repository;
    }