Register the given filesystem for the specified domain.

@param string     $domain
@param FilesystemInterface $filesystem

@throws \InvalidArgumentException when the specified domain contains
forbidden characters
551650
public function set($domain, FilesystemInterface $filesystem)
    {
        if (!preg_match('/^[-_a-zA-Z0-9]+$/', $domain)) {
            throw new \InvalidArgumentException(sprintf(
                'The specified domain "%s" is not a valid domain.',
                $domain
            ));
        }

        $this->filesystems[$domain] = $filesystem;
    }
46952
function register($engine, $extension)
    {
        if (!class_exists($engine)) {
            throw new \InvalidArgumentException("Class $engine is not defined");
        }

        if (!class_implements($engine, "\\MetaTemplate\\Template\\TemplateInterface")) {
            throw new \InvalidArgumentException(
                "An engine must implement \\MetaTemplate\\Template\\TemplateInterface."
            );
        }

        $extensions = (array) $extension;

        foreach ($extensions as $extension) {
            $extension = Template::normalizeExtension($extension);
            $this->engines[$extension] = $engine;
        }

        return $this;
    }
1149906
public function deletePath(FilesystemInterface $filesystem, $path)
    {
        $success = false;
        try {
            $success = $filesystem->delete($path);
        } catch (FileNotFoundException $e) {
            // TODO: log this?
        }

        return $success;
    }
1171112
public function register(ContainerInterface $container, Configurable $config)
    {
        if ( ! $config instanceof Config) {
            throw new \InvalidArgumentException('Wrong Config object');
        }

        $entityManager = EntityManager::create(
            $config->database,
            Setup::createAnnotationMetadataConfiguration(
                $config->annotationDirs, $config->dev, $config->proxyDir, $config->cache, false
            )
        );

        $container->add($config->getServiceName(), $entityManager);
    }
231060
protected function initCatalogForManyDomains($locale, $domains) {
		foreach ($domains as $domain) {
			$this->initCatalog($locale, $domain);
		}
	}
287865
public static function findDomainPath($string, $filePath)
    {
        $domains = Template::getDomains(TRUE);
        $filenamePath = null;
        if (!file_exists($filePath) && 0 < count($domains)) {
            foreach ($domains as $domain => $paths) {
                $domainFilename = str_replace($domain, $paths["public"], $string);
                if (file_exists($domainFilename)) {
                    $filenamePath = $domainFilename;
                    continue;
                }
            }
        }

        return $filenamePath;
    }
770944
static function setFilesystem(?\React\Filesystem\FilesystemInterface $filesystem) {
        if($filesystem === null) {
            $filesystem = false;
        }
        
        self::$filesystem = $filesystem;
    }
1356017
protected function createParentDirectory(Filesystem $filesystem, $directory)
    {
        if (! $filesystem->isDirectory($directory)) {
            $filesystem->makeDirectory($directory, 0755, true);
        }
    }
568461
public function setPublicFilesystem(Filesystem $filesystem)
    {
        if (!$filesystem->getAdapter() instanceof PublicAdapter) {
            throw new InvalidArgumentException("Configured adapter must implement PublicAdapter");
        }
        $this->publicFilesystem = $filesystem;
        return $this;
    }
515551
public function setDomain($domain)
    {
        if (mb_strpos($domain, ':') !== false) {
            throw new InvalidArgumentException(sprintf('Cookie domain "%s" should not contain a port', $domain));
        }

        $this->cookie['domain'] = $domain;
    }
695836
public function register($filename, $args, $pkg = false)
    {
        parent::register($filename, $args, $pkg);
        if (!empty($args['media'])) {
            $this->setAssetMedia($args['media']);
        }
    }
489853
protected function registerCache($cacheConfig)
    {
        switch ($cacheConfig['driver']) {
            case 'filesystem':
                $cacheDriver = new FilesystemCache($cacheConfig['dir']);
                break;
            default:
                $cacheDriver = new FilesystemCache(sys_get_temp_dir());
        }

        return $cacheDriver;
    }
1285927
protected function truncateDirectory($dirname, Filesystem $filesystem)
    {
        if ($dirname
            && ltrim(dirname($dirname), '.')
            && !$this->config()->get('keep_empty_dirs')
            && !$filesystem->listContents($dirname)
        ) {
            $filesystem->deleteDir($dirname);
        }
    }
1130253
public function register($binding)
    {
        $finder = new FileFinder(new Filesystem, $this->container['config']['view.paths.style']);
        $finder->addExtension('yml');
        $this->container->bind('view.viewfinder', new FileFinder(new Filesystem, $this->container['config']['view.paths.view']));
        $this->container->bind('view.stylefinder', $finder);
        $this->container->bind('view.styleparser', 'Encore\View\Parser\Style\Yaml');

        $this->container->bind('view', function() {
            return new Manager($this->container['view.viewfinder'], $this->container['view.viewparser'], $this->container['view.stylefinder'], $this->container['view.styleparser']);
        });
    }
207366
protected function initManyLocales($locale, $domain) {
		$source = $this->getCatalogContent($locale, $domain);
		
		if ($source !== false) {
			$locales = parse_ini_string($source, true);
			
			if ($locales === false) {
				throw new ParseError('Error has occurred while parsing INI file for the domain: "' . $domain . '"');
			}
			
			foreach ($locales as $locale => $catalog) {
				$this->catalogs = array_replace_recursive($this->catalogs, [
					$locale => [
						$domain => $catalog
					]
				]);
			}
		}

		if (! isset($this->initializedCatalogs[$locale])) {
			$this->initializedCatalogs[$locale] = [];
		}

		foreach (array_keys($locales) as $locale) {
			$this->initializedCatalogs[$locale][$domain] = true;
		}
	}
285984
public ZAuth configurePlain(String domain, String filename)
    {
        Objects.requireNonNull(domain, "Domain has to be supplied");
        Objects.requireNonNull(filename, "File name has to be supplied");
        return send(Mechanism.PLAIN.name(), domain, filename);
    }
631144
protected function publishFiles(Filesystem $filesystem, array $paths, $force = false)
    {
        foreach ($paths as $from => $to) {
            if ($filesystem->isFile($from)) {
                $this->publishFile($filesystem, $from, $to, $force);
            } elseif ($filesystem->isDirectory($from)) {
                $this->publishDirectory($from, $to, $force);
            } else {
                $this->error("Can't locate path: <{$from}>");
            }
        }
    }