Returns the filesystem registered for the specified domain.

@param string $domain

@return FilesystemInterface

@throw  \InvalidArgumentException when there is no filesystem registered
for the specified domain
176559
public function get($domain)
    {
        if (!$this->has($domain)) {
            throw new \InvalidArgumentException(sprintf(
                'There is no filesystem defined for the "%s" domain.',
                $domain
            ));
        }

        return $this->filesystems[$domain];
    }
1202120
protected function getDnsRecord($domain)
    {
        if (filter_var($domain, FILTER_VALIDATE_URL) === false) {
            $this->eye->logger()->debug('DNS URL not valid', $domain);
            return false;
        }

        try {
            $dns = $this->pollDns($this->parseUrl($domain));
        } catch (Exception $e) {
            $this->eye->logger()->debug('DNS lookup failed', ['domain' => $domain,
                                                              'exception' => $e->getMessage()]);
            return false;
        }

        return $this->stripTtlFromDns($dns);
    }
617409
public function getResourcePaths($domain = null) {
        return isset($this->_paths[$domain]) ? $this->_paths[$domain] : $this->_paths;
    }
1122053
public function getSiteByDomain($domain)
    {
        $queryBuilder = $this->_em->createQueryBuilder();
        $queryBuilder->select('domain, site, primaryDomain')
            ->from(\Rcm\Entity\Domain::class, 'domain')
            ->leftJoin('domain.site', 'site')
            ->leftJoin('domain.primaryDomain', 'primaryDomain')
            ->where('domain.domain = :domainName')
            ->setParameter('domainName', $domain);

        try {
            /** @var \Rcm\Entity\Domain $domain */
            $domain = $queryBuilder->getQuery()->getSingleResult();
        } catch (NoResultException $e) {
            return null;
        }

        if ($domain->getPrimary()) {
            $site = $domain->getPrimary()->getSite();
            $this->_em->detach($site);
            $this->_em->detach($domain);
            $site->setDomain($domain);
        } else {
            $site = $domain->getSite();
        }

        return $site;
    }
305208
public function getUnit($domain, $key)
    {
        list($units, $translations) = $this->loadFiles();

        if (!isset($units[$domain][$key])) {
            throw new NotFoundException($domain, $key);
        }

        return $this->createUnitObject($domain, $key, $units[$domain][$key], $translations);
    }
1306371
public function load(InputInterface $input): ConfigInterface
    {
        $configFile = $input->getOption('config');
        if (!$configFile || !$this->filesystem->fileExists($configFile)) {
            throw InvalidArgumentException::invalidConfigFile();
        }
        $config = include $configFile;
        if (!$config instanceof ConfigInterface) {
            throw InvalidArgumentException::invalidConfigFile();
        }

        return $config;
    }
93935
public function getFileSystem($id)
    {
        if (!isset($this->filesystems[$id])) {
            $this->filesystems[$id] = new FileSystem($id, $this->getFlysystemAdapter($id));
        }
        return $this->filesystems[$id];
    }
103112
public function domain($domain = null)
    {
        deprecationWarning('Email::domain() is deprecated. Use Email::setDomain() or Email::getDomain() instead.');

        if ($domain === null) {
            return $this->getDomain();
        }

        return $this->setDomain($domain);
    }
783653
public static function getByDomain($domain)
    {
        $slot = new Cache\Slot\ServerByDomain($domain);
        if (false === ($server = $slot->load())) {

            $fields = self::getDbConnection()->fetchAssoc( 'SELECT B.* FROM server_aliases A LEFT JOIN dir_data B USING (ID) WHERE B.hidden<>1 and B.is_server<>0 and A.name = ?', array( $domain ) );
            
            if ($fields) {
                $server = self::fetch($fields); 
            } else {
                $server = self::getDefault();
                if (!$server) return FALSE;
            }
            $slot->addTag(new Cache\Tag\CatalogID($server->id));
            $slot->save($server);
        }
        return $server;
    }
142449
public function getFilesystem($scheme)
    {
        if (empty($scheme) || !is_string($scheme)) {
            throw new RuntimeError('Scheme (prefix) of filesystem must be a non-empty string.');
        }

        if (!StringToolkit::endsWith($scheme, self::SCHEME_SEPARATOR)) {
            $scheme .= self::SCHEME_SEPARATOR;
        }

        return $this->mount_manager->getAdapter($scheme);
    }
78340
public function getStorage($name)
    {
        $class = sprintf('\\MwbExporter\\Storage\\%sStorage', ucfirst($name));
        if (class_exists($class)) {
            $storage = new $class();

            return $storage;
        }

        throw new \InvalidArgumentException(sprintf('Storage %s not found.', $class));
    }
791554
public function getWhoisServer($domain)
    {
        $domain = strtolower($domain);

        $tld = $this->getTld($domain);

        if (!isset($this->server[$tld])) {
            throw new UnknownTldException("$tld is not in the list of servers.");
        }

        return $this->server[$tld];
    }
1244463
public function offsetGet($offset)
    {
        if (isset($this->storage[$offset])) {
            return $this->storage[$offset];
        }
        if (!isset($this->storageDefs[$offset])) {
            if (empty($this->allowsUndefinedKey)) {
                throw new InvalidArgumentException(
                    sprintf("Key '%s' does not exists", $offset)
                );
            }
            return;
        }
        if (is_array($def = $this->storageDefs[$offset])) {
            if (isset($def['getter'])) {
                return $this->{$def['getter']}();
            }
            if (isset($def['default'])) {
                if (   is_int($def['default'])
                    && isset($def['enum'][$def['default']])
                ) {
                    return $this->storage[$offset] = $def['enum'][$def['default']];
                }
                return $this->storage[$offset] = $def['default'];
            }
        }
    }
116611
protected function getBaseDirectory()
    {
        if (! $this->fileSystem) {
            $this->fileSystem = $this->getServiceLocator()
                ->get(FileSystemService::SERVICE_ID)
                ->getDirectory($this->getFileSystemId());
        }

        return $this->fileSystem;
    }
598861
protected function getCatalogPath($locale, $domain) {
		if ($this->basePath === null) {
			throw new NoPath('Base path definition required');
		}
		
		// Path to the file resolve
		$pathParts = [$this->basePath];
		
		foreach ($this->pathTemplate as $part) {
			if ($part === self::TPL_LOCALE) {
				$pathParts[] = $locale;
				continue;
			}
			
			if ($part === self::TPL_DOMAIN) {
				$pathParts[] = $domain;
			}
		}
		
		// Filename resolve
		$flenameParts = [];
		
		foreach ($this->filenameTemplate as $part) {
			if ($part === self::TPL_LOCALE) {
				$flenameParts[] = $locale;
				continue;
			}
			
			if ($part === self::TPL_DOMAIN) {
				$flenameParts[] = $domain;
			}
		}
		
		$filename = implode($this->filenameSeparator, $flenameParts);
		
		// Extension resolve
		if ($this->filenameExtension !== null) {
			$filename .= '.' . $this->filenameExtension;
		}
		
		$pathParts[] = $filename;
		
		return implode(DIRECTORY_SEPARATOR, $pathParts);
	}
1356296
public function domain($domain = null) {

		if(null !== $domain) {

			if(false === is_string($domain)) {
				return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($domain)), E_USER_ERROR);
			}

			//Check if identifier exists
			if(false === Router :: routeExists($this -> identifier, $domain)) {
				return trigger_error(sprintf('Identifier "%s" with domain "%s" does not exists', $this -> identifier, $domain), E_USER_ERROR);	
			}

			$this -> domain = $domain;
		}

		return $this;
	}
62511
public static function getSecondDomain() {
        $serverName = filter_input(INPUT_SERVER, 'SERVER_NAME');
        $serverArr = explode('.', $serverName);
        $domain = array_shift($serverArr);

        return $domain;
    }