Execute updates on a specific site.
@param string $multisite
15897
protected function updateSite($multisite) {
    $this->say("Deploying updates to <comment>$multisite</comment>...");
    $this->switchSiteContext($multisite);

    $this->invokeCommand('drupal:update');

    $this->say("Finished deploying updates to $multisite.");
  }
1346754
public void updateSite(CmsObject cms, CmsSite oldSite, CmsSite newSite) throws CmsException {

        if (oldSite != null) {
            // remove the old site
            removeSite(cms, oldSite);
        }

        if (newSite != null) {
            // add the new site
            addSite(cms, newSite);
        }
    }
676719
public function setActiveSite($siteID) {
		if($this->owner->config()->use_active_site_session) {
			Multisites::inst()->setActiveSite($siteID);
		} else {
			$this->owner->getRequest()->getSession()->set($this->getActiveSiteSessionKey(), $siteID);
		}
	}
452791
public function execute($objectContext)
    {
        if (method_exists($objectContext, $this->method))
        {
            if (!empty($this->parameters))
            {
                $objectContext->{$this->method}($this->parameters);
            }
            else
            {
                $objectContext->{$this->method}($this->parameters);
            }
        }
    }
692435
public function updateV1Website($name, $ipAddress, $https, array $domains, array $siteApps)
    {
        return $this->send('update_website', $name, $ipAddress, $https, $domains, ...$siteApps);
    }
1068959
public function handle($request, Closure $next, $site)
    {
        Config::set('multisite.site', $site);

        return $next($request);
    }
1314155
public function compose(View $view)
    {
        if (! $this->site) {
            $this->site = Site::where('slug', Config::get('multisite.site'))->first();
        }

        $view->with('currentSite', $this->site);
    }
774970
public function deleteAll($idSite)
    {
        Piwik::checkUserHasSuperUserAccess();

        $this->checkSingleIdSite($idSite, $extraMessage = "Note: Cannot delete annotations from multiple sites.");

        $annotations = new AnnotationList($idSite);

        // remove the notes & save the list
        $annotations->removeAll($idSite);
        $annotations->save($idSite);
    }
535829
public function setSite($site)
  {
    if ($site === '?' || $site === '') {
      $this->site = null;
    } elseif (strlen(preg_replace('/[^a-zA-Z]/', '', $site) < 2)) {
      // Some sites have been non-letter gibberish.
      $this->site = null;
    } else {
      $site = Util::foreignLettersToEnglishLetters($site);
      $site = Util::titleCaseIfCurrentlyAllCaps($site);
      $this->site = $site;
    }
  }
301273
public function update($props)
    {
        if (isset($props['server_aliases']) || isset($props['alias'])) {
    	    self::getDbConnection()->executeQuery("DELETE FROM server_aliases WHERE id=".$this->id);
    	    if (isset($props['server_aliases'])){
                $alias = json_decode($props['server_aliases']);
                unset($props['server_aliases']);
            } else {
                $alias = array();
            }
    	    if (isset($props['alias'])) $alias[] = $props['alias'];
    	    foreach($alias as $al) if ($al) {
			   self::getDbConnection()->insert('server_aliases', array(
			       'id'   => $this->id,
				   'name' => $al
			   ));
        	   $slot = new Cache\Slot\ServerByDomain($al);
        	   $slot->remove();
    	    }
        }
        
        self::getDbConnection()->update('dir_data', array('templateDir' => $props['templateDir']), array('id'=>$this->id));
    
        parent::update($props);
    }
857591
@RequirePOST
    public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException {
        Jenkins hudson = Jenkins.getInstance();
        hudson.checkPermission(CONFIGURE_UPDATECENTER);
        UpdateCenter uc = hudson.getUpdateCenter();
        PersistedList<UpdateSite> sites = uc.getSites();
        for (UpdateSite s : sites) {
            if (s.getId().equals(UpdateCenter.ID_DEFAULT))
                sites.remove(s);
        }
        sites.add(new UpdateSite(UpdateCenter.ID_DEFAULT, site));

        return new HttpRedirect("advanced");
    }
1221875
def update_site(sender, **kwargs):
    
    Site = apps.get_model('sites', 'Site')
    domain = settings.SITE_DOMAIN
    if settings.SITE_PORT:
        domain += ':%s' % settings.SITE_PORT
    Site.objects.update_or_create(
        pk=settings.SITE_ID,
        defaults=dict(
            domain=domain,
            name=settings.SITE_NAME))

    # We set an explicit pk instead of relying on auto-incrementation,
    # so we need to reset the database sequence.
    sequence_sql = connection.ops.sequence_reset_sql(no_style(), [Site])
    if sequence_sql:
        cursor = connection.cursor()
        for command in sequence_sql:
            cursor.execute(command)
609461
public function updateLocation(Location $location, $andFlush = true)
    {
        $this->objectManager->persist($location);
        if ($andFlush) {
            $this->objectManager->flush();
        }
    }
619557
public void updateSite(String siteRoot) {

        try {
            CmsObject cloneCms = OpenCms.initCmsObject(m_cms);
            if (siteRoot == null) {
                siteRoot = "/system";
            }
            cloneCms.getRequestContext().setSiteRoot(siteRoot);
            m_cms = cloneCms;
        } catch (CmsException e1) {
            LOG.error(e1.getLocalizedMessage(), e1);
        }
        updateValidation();
    }
1317201
protected function update($step)
    {
        $userGroupCollection = $this->matchUserGroups('update', $step);

        if (count($userGroupCollection) > 1 && isset($step->dsl['references'])) {
            throw new \Exception("Can not execute Group update because multiple groups match, and a references section is specified in the dsl. References can be set when only 1 group matches");
        }

        $userService = $this->repository->getUserService();
        $contentService = $this->repository->getContentService();

        foreach ($userGroupCollection as $key => $userGroup) {

            /** @var $updateStruct \eZ\Publish\API\Repository\Values\User\UserGroupUpdateStruct */
            $updateStruct = $userService->newUserGroupUpdateStruct();

            /** @var $contentUpdateStruct \eZ\Publish\API\Repository\Values\Content\ContentUpdateStruct */
            $contentUpdateStruct = $contentService->newContentUpdateStruct();

            if (isset($step->dsl['name'])) {
                $contentUpdateStruct->setField('name', $step->dsl['name']);
            }

            if (isset($step->dsl['remote_id'])) {
                $contentUpdateStruct->remoteId = $step->dsl['remote_id'];
            }

            if (isset($step->dsl['description'])) {
                $contentUpdateStruct->setField('description', $step->dsl['description']);
            }

            $updateStruct->contentUpdateStruct = $contentUpdateStruct;

            $userGroup = $userService->updateUserGroup($userGroup, $updateStruct);

            if (isset($step->dsl['parent_group_id'])) {
                $parentGroupId = $step->dsl['parent_group_id'];
                $parentGroupId = $this->referenceResolver->resolveReference($parentGroupId);
                $newParentGroup = $this->userGroupMatcher->matchOneByKey($parentGroupId);

                // Move group to new parent
                $userService->moveUserGroup($userGroup, $newParentGroup);

                // reload user group to be able to set refs correctly
                $userGroup = $userService->loadUserGroup($userGroup->id);
            }

            if (isset($step->dsl['section'])) {
                $this->setSection($userGroup, $step->dsl['section']);

                /// @todo if we allow to set references to the group's section, here we should reload it
            }

            $userGroupCollection[$key] = $userGroup;
        }

        $this->setReferences($userGroupCollection, $step);

        return $userGroupCollection;
    }
601172
function reloadSites() {
    function reload() {
      sites.get()
      .then(function(sites) {
        $scope.ui.sites = sites;
      });
    }
    /*
     * Reload sites mutliple times, because sometimes updates to list of sites
     * aren't ready immediately.
     */
    // Reload sites immediately.
    reload();
    // Reload sites again after 5 seconds.
    setTimeout(reload, 1000 * 5);
    // Reload sites again after 15 seconds.
    setTimeout(reload, 1000 * 15);
  }
1086139
protected function editSettings()
    {
        $multiSiteSettingsFile = sprintf(
            '%s/sites/'.$this->explodeDirectory[0].'/settings.php',
            $this->appRoot
        );
        if (!$this->fs->exists($multiSiteSettingsFile)) {
            $multiSiteSettingsFile = sprintf(
                '%s/sites/'.$this->directory.'/settings.php',
                $this->appRoot
            );
        }

        $databases = [];
        $config_directories = [];

        if (file_exists($multiSiteSettingsFile)) {
            include $multiSiteSettingsFile;
        }

        try {
            if (!empty($databases) || !empty($config_directories)) {
                //Replace $databases['default']['default']['database']
                $line = explode('/', $databases['default']['default']['database']);
                $string_to_replace= $databases['default']['default']['database'];
                $replace_with="sites/".$this->explodeDirectory[0]."/files/".end($line);
                $content=file_get_contents($multiSiteSettingsFile);
                $content_chunks=explode($string_to_replace, $content);
                $content=implode($replace_with, $content_chunks);

                //Replace $config_directories['sync']
                $string_to_replace= $config_directories['sync'];
                $replace_with=str_replace($this->uri, $this->directory, $config_directories['sync']);
                $content_chunks=explode($string_to_replace, $content);
                $content=implode($replace_with, $content_chunks);
                file_put_contents($multiSiteSettingsFile, $content);
            }
        } catch (IOExceptionInterface $e) {
            $this->getIo()->error(
                sprintf(
                    $this->trans('commands.multisite.update.messages.write-fail'),
                    $multiSiteSettingsFile
                )
            );
            return 1;
        }
    }