@param string $siteAccessName

@return \eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher|Map|null
172984
public function reverseMatch($siteAccessName)
    {
        $reverseMap = $this->getReverseMap($siteAccessName);

        if (!isset($reverseMap[$siteAccessName])) {
            return null;
        }

        $this->setMapKey($reverseMap[$siteAccessName]);

        return $this;
    }
97598
protected function resolveHostMatching($siteaccessSettings)
    {
        switch ($siteaccessSettings['HostMatchType']) {
            case 'disabled':
                return false;

            case 'map':
                return ['Map\\Host' => $this->resolveMapMatch($siteaccessSettings['HostMatchMapItems'])];

            case 'element':
                return ['HostElement' => $siteaccessSettings['HostMatchElement']];

            case 'text':
                return ['HostText' => $this->resolveTextMatch($siteaccessSettings, 'HostMatchSubtextPre', 'HostMatchSubtextPost')];

            case 'regexp':
                return ['Regex\\Host' => [$siteaccessSettings['HostMatchRegexp'], $siteaccessSettings['HostMatchRegexpItem']]];

            default:
                throw new InvalidArgumentException('HostMatchType', "Invalid value for legacy setting site.ini '{$siteaccessSettings['HostMatchType']}'");
        }
    }
108629
function createSiteAccess( $params )
    {
        $srcSiteaccess = $params['src']['siteaccess'];
        $dstSiteaccess = $params['dst']['siteaccess'];
        $dstSettings   = isset( $params['dst']['settings'] ) ? $params['dst']['settings'] : array();

        // Create the siteaccess directory
        $srcSiteaccessDir = "settings/siteaccess/" . $srcSiteaccess;
        $dstSiteaccessDir = "settings/siteaccess/" . $dstSiteaccess;
        eZDir::mkdir( $dstSiteaccessDir, false, true );
        eZDir::copy( $srcSiteaccessDir, $dstSiteaccessDir, false, true );

        // Update settings
        foreach ( $dstSettings as $iniFile => $settingGroups )
        {
            $ini = eZINI::instance( $iniFile . ".append.php", $dstSiteaccessDir, null, false, null, true );

            foreach ( $settingGroups as $settingGroup => $settings )
            {
                foreach ( $settings as $name => $value )
                {
                    $ini->setVariable( $settingGroup, $name, $value );
                }
            }

            $ini->save(  false, false, false, false, true, true );
            unset( $ini );
        }

        // Create roles
        $role = eZRole::fetchByName( "Anonymous" );
        $role->appendPolicy( "user", "login", array( "SiteAccess" => array( eZSys::ezcrc32( $dstSiteaccess ) ) ) );
        $role->store();
    }
763584
public function getSiteNotAvailableRedirectUrl(Site $site)
    {
        if ($site->isSiteAvailable()) {
            return null;
        }

        $defaultDomain = $this->domainService->getDefaultDomainName();

        if (empty($defaultDomain)) {
            return null;
        }

        if ($defaultDomain == $site->getDomain()->getDomainName()) {
            return null;
        }

        return $defaultDomain;
    }
1283040
public function offsetGet($name)
    {
        deprecationWarning(
            'The ArrayAccess methods will be removed in 4.0.0.' .
            'Use getParam(), getData() and getQuery() instead.'
        );

        if (isset($this->params[$name])) {
            return $this->params[$name];
        }
        if ($name === 'url') {
            return $this->query;
        }
        if ($name === 'data') {
            return $this->data;
        }

        return null;
    }
272571
public function changeConfigScope($siteAccessName)
    {
        $event = new ScopeChangeEvent($this->siteAccessRouter->matchByName($siteAccessName));
        $this->eventDispatcher->dispatch(MVCEvents::CONFIG_SCOPE_CHANGE, $event);

        return $event->getSiteAccess();
    }
516017
private function getAccessLevels($email)
    {
        foreach ($this->hostedDomains as $hostedDomain) {
            if (preg_match('/'.$hostedDomain['domain_name'].'$/', $email)) {
                return $hostedDomain['access_levels'];
            }
        }

        return null;
    }
34733
protected function getSiteByName($sites, $site_name)
    {
        $site_found = collect($sites)->filter(function ($site) use ($site_name) {
            return $site->name === $site_name;
        })->first();

        if ($site_found) {
            return $site_found;
        }
        return null;
    }
377213
public function getResources($match = null) {

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

		$permissions = [];
		$match 		 = null === $match ? '.*?' : $match;

		foreach($this -> permissions as $permission) {

			foreach($permission as $type => $value) {

				if(preg_match(sprintf('#%s#', str_replace('#', '\#', $match)), $type)) {
					$permissions[] = $type;			
				}
			}
		}

		return array_unique($permissions);
	}
20624
public function getLangCache($sCacheName)
    {
        $aLangCache = null;
        $sFilePath = $this->getCacheFilePath($sCacheName);
        if (file_exists($sFilePath) && is_readable($sFilePath)) {
            include $sFilePath;
        }

        return $aLangCache;
    }
755235
private function createSiteModule($siteName)
	{
	    $results = array(
	        'success' => false,
	        'message' => null,
	    );
	    $melisSitesDir = $_SERVER['DOCUMENT_ROOT'].'/../module/MelisSites';
	    
	    if (is_dir($melisSitesDir))
	    {
	        if (is_writable($melisSitesDir))
	        {
	            $moduleSvc = $this->getServiceLocator()->get('ModulesService');
	            
	            $melisCmsDir = $moduleSvc->getModulePath('MelisCms');
	            
	            $siteSampleDir = $melisCmsDir.'/etc/SiteSample';
	            
	            if (is_dir($siteSampleDir))
	            {
	                if (!is_dir($melisSitesDir.'/'.$siteName))
	                {
	                    $res = $this->xcopy($siteSampleDir, $melisSitesDir.'/'.$siteName, 0777);
	                    
	                    if ($res)
	                    {
	                        // replace file contents using the weptoption value as target module name with the new Module Name
	                        $this->mapDirectory($melisSitesDir.'/'.$siteName, 'SiteSample', $siteName);
	                        
	                        $results['success'] = true;
	                    }
	                }
	                else
	                {
	                    // The Site directory target is already exist
	                    $results['message'] = 'tr_meliscms_tool_site_directory_exist';
	                }
	            }
	        }
	        else
	        {
	            // MelisSites dir not writable
	            $results['message'] = 'tr_meliscms_tool_site_directory_not_writable';
	        }
	    }
	    else
	    {
	        // MelisSites directory not exist
	        $results['message'] = 'tr_meliscms_tool_site_melissites_directory_not_exist';
	    }
	    
	    return $results;
	    
	}
14792
public function setSiteAccess(SiteAccess $siteAccess = null)
    {
        if ($siteAccess === null) {
            return;
        }

        $this->matchConfig = $this->configResolver->getParameter('block_view', 'ezsettings', $siteAccess->name);
    }
1357839
protected function isSiteAccessAwareRoute($routeName)
    {
        foreach ($this->nonSiteAccessAwareRoutes as $ignoredPrefix) {
            if (strpos($routeName, $ignoredPrefix) === 0) {
                return false;
            }
        }

        return true;
    }
714618
public function getGroup($groupName, $file = null, $siteaccess = null)
    {
        if ($file === null && $siteaccess === null) {
            // in this case we want the "global" value, no need to use the
            // legacy kernel, the legacy resolver is enough
            return $this->legacyResolver->getGroup($groupName);
        }

        return $this->legacyKernel->runCallback(
            static function () use ($file, $groupName, $siteaccess) {
                // @todo: do reset injected settings everytime
                // and make sure to restore the previous injected settings
                eZINI::injectSettings([]);

                return eZSiteAccess::getIni($siteaccess, $file)->group($groupName);
            },
            false,
            false
        );
    }
307992
public function getSiteAccessesByMandatorId($mandatorId = null)
    {
        if ($mandatorId === null) {
            return array($this->siteAccess->name);
        }

        $siteAccesses = array();

        foreach ($this->siteAccessConfig as $siteAccessName => $config) {
            if (!isset($config['yoochoose']['customer_id']) || (int)$config['yoochoose']['customer_id'] !== $mandatorId) {
                continue;
            }

            $siteAccesses[$siteAccessName] = $siteAccessName;

            if ($this->isDefaultSiteAccessChanged()
                && $this->isSiteAccessSameAsSystemDefault($siteAccessName)
                && $this->isMandatorIdConfigured($mandatorId)
            ) {
                // default siteAccess name is changed and configuration should be adjusted
                $siteAccesses[$this->defaultSiteAccessName] = $this->defaultSiteAccessName;
            }
        }

        if (empty($siteAccesses)) {
            throw new NotFoundException('configuration for eZ Recommendation', "mandatorId: {$mandatorId}");
        }

        return array_values($siteAccesses);
    }
303635
protected function getSiteAccessIni()
    {
        if ( $this->destinationSiteAccessIni === null )
        {
            $this->destinationSiteAccessIni = eZSiteAccess::getIni( $this->destinationSiteAccess, 'site.ini' );
        }
        return $this->destinationSiteAccessIni;
    }
1247800
public function getToken($username)
	{
		return isset($this->access_tokens[$username]) ? $this->access_tokens[$username] : null;
	}