Set legacy config values
This sets `concrete.site` to the current site's sitename.

@deprecated In a future major version this will be part of HTTP middleware

@return Response|void Returns a response if an error occurs
972381
protected function registerLegacyConfigValues()
    {
        $config = $this->getConfig();
        $name = $this->getSiteService()->getSite()->getSiteName();

        $config->set('concrete.site', $name);
    }
856673
public function setCoreSiteName($value)
    {
        $this->setFieldName('site_name');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
691711
public function switchSiteContext($site_name) {
    $this->logger->debug("Switching site context to <comment>$site_name</comment>.");
    $config_initializer = new ConfigInitializer($this->getConfigValue('repo.root'), $this->input());
    $config_initializer->setSite($site_name);
    $new_config = $config_initializer->initialize();

    // Replaces config.
    $this->getConfig()->import($new_config->export());
  }
1161278
protected function symlinkLegacyExtensionSiteAccesses(string $legacyExtensionPath, OutputInterface $output): void
    {
        $legacyRootDir = $this->getContainer()->getParameter('ezpublish_legacy.root_dir');

        /** @var \DirectoryIterator[] $directories */
        $directories = [];

        $path = $legacyExtensionPath . '/root_' . $this->environment . '/settings/siteaccess/';
        if ($this->fileSystem->exists($path)) {
            $directories[] = new DirectoryIterator($path);
        }

        $path = $legacyExtensionPath . '/root/settings/siteaccess/';
        if ($this->fileSystem->exists($path)) {
            $directories[] = new DirectoryIterator($path);
        }

        $processedSiteAccesses = [];
        foreach ($directories as $directory) {
            foreach ($directory as $item) {
                if (!$item->isDir() || $item->isDot()) {
                    continue;
                }

                // We want root_* to have priority, so any siteaccess which we already "processed" will be skipped
                if (!in_array($item->getBasename(), $processedSiteAccesses, true)) {
                    $this->verifyAndSymlinkDirectory(
                        $item->getPathname(),
                        $legacyRootDir . '/settings/siteaccess/' . $item->getBasename(),
                        $output
                    );

                    $processedSiteAccesses[] = $item->getBasename();
                }
            }
        }
    }
1145399
public function setup() {
    $this->say("Setting up local environment for site <comment>{$this->getConfigValue('site')}</comment>.");
    if ($this->getConfigValue('drush.alias')) {
      $this->say("Using drush alias <comment>@{$this->getConfigValue('drush.alias')}</comment>");
    }

    $commands = [
      'source:build',
      'drupal:deployment-identifier:init',
    ];

    switch ($this->getConfigValue('setup.strategy')) {
      case 'install':
        $commands[] = 'drupal:install';
        $commands[] = 'drupal:toggle:modules';
        break;

      case 'sync':
        $commands[] = 'drupal:sync:default:site';
        break;

      case 'import':
        $commands[] = 'drupal:sql:import';
        $commands[] = 'drupal:update';
        break;
    }

    $commands[] = 'blt:init:shell-alias';

    $this->invokeCommands($commands);
  }
126773
final public function setEnvironmentValue()
    {
        /**
         * Env file existence is verified in the controller.
         */
        $this->config()->setEnv(trim((string)file_get_contents($this->projectPath . '.env')));

        return true;
    }
1002077
protected function initConfiguration()
    {
        parent::initConfiguration();

        // Check custom index expiration (from connector)
        /** @var \Metaseo\Metaseo\Connector $connector */
        $connector    = $this->objectManager->get('Metaseo\\Metaseo\\Connector');
        $sitemapStore = $connector->getStore('sitemap');

        // Set new expiration date
        if (!empty($sitemapStore['expiration'])) {
            $this->indexExpiration = $_SERVER['REQUEST_TIME'] + ($sitemapStore['expiration'] * 24 * 60 * 60);
        }
    }
65860
public function setSiteConfig($siteConfig)
    {
        $siteConfig = $siteConfig === null ? FoxyStripeSetting::current_foxystripe_setting() : $siteConfig;
        if ($siteConfig instanceof FoxyStripeSetting) {
            $this->site_config = $siteConfig;

            return $this;
        }
        throw new \InvalidArgumentException('$siteConfig needs to be an instance of FoxyStripeSetting.');
    }
914094
def prepare_site_db_and_overrides():
    '''
    '''
    _SITE_DB.clear()
    _SITE_DB[_MAIN_LANG] = _MAIN_SITEURL
    # make sure it works for both root-relative and absolute
    main_siteurl = '/' if _MAIN_SITEURL == '' else _MAIN_SITEURL
    for lang, overrides in _SUBSITE_QUEUE.items():
        if 'SITEURL' not in overrides:
            overrides['SITEURL'] = posixpath.join(main_siteurl, lang)
        _SITE_DB[lang] = overrides['SITEURL']
        # default subsite hierarchy
        if 'OUTPUT_PATH' not in overrides:
            overrides['OUTPUT_PATH'] = os.path.join(
                _MAIN_SETTINGS['OUTPUT_PATH'], lang)
        if 'CACHE_PATH' not in overrides:
            overrides['CACHE_PATH'] = os.path.join(
                _MAIN_SETTINGS['CACHE_PATH'], lang)
        if 'STATIC_PATHS' not in overrides:
            overrides['STATIC_PATHS'] = []
        if ('THEME' not in overrides and 'THEME_STATIC_DIR' not in overrides and
                'THEME_STATIC_PATHS' not in overrides):
            relpath = relpath_to_site(lang, _MAIN_LANG)
            overrides['THEME_STATIC_DIR'] = posixpath.join(
                relpath, _MAIN_SETTINGS['THEME_STATIC_DIR'])
            overrides['THEME_STATIC_PATHS'] = []
        # to change what is perceived as translations
        overrides['DEFAULT_LANG'] = lang
752264
public function setSite($site)
    {
        if (empty($site)) return $this;

        $this->checkSite($site);

        return $this->addMeta('site', $site);
    }
747640
public function set()
    {
        try {
            $this->loadEnv();
            $this->setPhpIni(getenv('WP_ENV') ?: 'development');
            $this->setConfig(getenv('WP_ENV') ?: 'development');
            $this->registerMuLoaderLoader();
            $this->registerMultiSitePath();
        } catch (\RuntimeException $e) {
            die('<h1>Configuration could not be loaded.</h1>');
        }
        return $this;
    }
95062
public function setConfig()
    {
        // error
        if (func_num_args() < 2 || func_num_args() > 3) {
            throw new InvalidArgumentException('Invalid Call of method "config"');
        }

        // default main config
        if (func_num_args() == 2) {
            return $this->setConfig('main', func_get_arg(0), func_get_arg(1));
        }

        // default global config
        return $this->configObject(func_get_arg(0))->setConfig(func_get_arg(1), func_get_arg(2));
    }
734776
protected function setGlobalConstants()
    {
        parent::setGlobalConstants();
        $testConfig = $this->getTestConfig();

        /** @deprecated use TestConfig::getShopUrl() */
        define('shopURL', $testConfig->getShopUrl());

        /** @deprecated use TestConfig::getShopId() */
        define('oxSHOPID', $testConfig->getShopId());

        /** @deprecated use TestConfig::isSubShop() */
        define('isSUBSHOP', $testConfig->isSubShop());
    }
817854
public function setSite(\BlackForest\PiwikBundle\Entity\PiwikSite $site = null)
    {
        $this->site = $site;

        return $this;
    }
1092830
protected function generateServerConfig(): void
    {
        $settings = [];

        // Siteaccess match settings

        $settings['ezpublish']['siteaccess']['match']['URIElement'] = '1';

        // Config specific files

        $kernelDir = $this->container->getParameter('kernel.project_dir') . '/' . $this->container->getParameter('kernel.name');
        $serverEnv = $this->container->getParameter('server_environment');

        file_put_contents(
            $kernelDir . '/config/server/' . $serverEnv . '/ezplatform_siteaccess.yml',
            Yaml::dump($settings, 7)
        );

        // Root settings file

        $rootSettings = [
            'imports' => [
                [
                    'resource' => $serverEnv . '/ezplatform_siteaccess.yml',
                ],
            ],
        ];

        file_put_contents(
            $kernelDir . '/config/server/' . $serverEnv . '.yml',
            Yaml::dump($rootSettings, 7)
        );
    }
25906
public function site($site)
    {
        $variables = array('site' => $site);
        $request = $this->get(array('{+base_path}/sites/{site}.json', $variables));
        return new Response\Site($request);
    }
89178
public function site()
    {
        $site = Config::get('decoy.site.name');
        if (is_callable($site)) {
            $site = call_user_func($site);
        }

        return $site;
    }