Activates a site

@param Site $site Site to activate
@return void
435861
public function activateSiteAction(Site $site)
    {
        $site->setState($site::STATE_ONLINE);
        $this->siteRepository->update($site);
        $this->addFlashMessage('The site "%s" has been activated.', 'Site activated', Message::SEVERITY_OK, [htmlspecialchars($site->getName())], 1412372881);
        $this->unsetLastVisitedNodeAndRedirect('index');
    }
774294
private function getCurrentSite(Site $site = null)
    {
        if (null !== $site) {
            return $site;
        }

        if (null !== $this->application) {
            return $this->application->getSite();
        }

        return null;
    }
471848
public function task($site, $taskId)
    {
        $variables = array(
            'site' => $site,
            'task' => $taskId,
        );
        $request = $this->get(array('{+base_path}/sites/{site}/tasks/{task}.json', $variables));
        return new Response\Task($request);
    }
718708
private function delegate_connection( $sites = null ) {
            $this->_logger->entrance();

            $this->_admin_notices->remove_sticky( 'connect_account' );

            if ( is_null( $sites ) ) {
                // All sites delegation.
                $this->_storage->store( 'is_delegated_connection', true, true, true );
            } else {
                // Specified sites delegation.
                foreach ( $sites as $site ) {
                    $this->delegate_site_connection( $site['blog_id'] );
                }
            }

            $this->network_upgrade_mode_completed();
        }
128795
public function andSiteIs(Site $site)
    {
        $suffix = $this->getSuffix();

        return $this->andWhere($this->getSectionAlias().'._site = :site'.$suffix)
                        ->setParameter('site'.$suffix, $site);
    }
854332
protected function updateSites($site, $target_env) {
    if (EnvironmentDetector::isAhOdeEnv($target_env)) {
      $this->updateOdeSites();
    }
    else {
      $this->updateAceSites($target_env);
    }
  }
364632
public function activateCommand($hostname)
    {
        $domains = $this->findDomainsByHostnamePattern($hostname);
        if (empty($domains)) {
            $this->outputLine('<error>No domain found for hostname-pattern "%s".</error>', [$hostname]);
            $this->quit(1);
        }
        foreach ($domains as $domain) {
            $domain->setActive(true);
            $this->domainRepository->update($domain);
            $this->outputLine('Domain entry "%s" was activated.', [$domain->getHostname()]);
        }
    }
235099
public function createForSite(SiteInterface $site)
    {
        $listRedirection = $this->redirectionRepository->findBySiteId($site->getSiteId());
        $siteLanguages = $site->getLanguages();
        $routes = array();

        foreach ($siteLanguages as $language) {
            $nodes = $this->nodeRepository->findPublishedByLanguageAndSiteId($language, $site->getSiteId());
            $routePattern = $this->nodeRepository->findAllRoutePattern($language, $site->getSiteId());
            $routePattern = $this->computeRoutePattern($routePattern);
            foreach ($nodes as $node) {
                $routes = array_merge($this->generateRoutesForNode($node, $site, $routePattern), $routes);
            }
        }

        foreach ($listRedirection as $redirection) {
            $routes = array_merge($this->generateRoutesForRedirection($redirection, $site), $routes);
        }

        return $routes;
    }
282659
public void addSite(String site) {
		if (siteModel.getIndexOf(site) < 0) {
			siteModel.addElement(site);
			if (currentSite == null) {
				// First site added, automatically select it
				siteModel.setSelectedItem(site);
			}
		}
	}
929844
public function softDeleteGroupsBySite(SiteInterface $site)
    {
        $this->createQueryBuilder()
            ->updateMany()
            ->field('site')->equals($site)
            ->field('deleted')->set(true)
            ->getQuery()
            ->execute();
    }
1005833
public function onSuccess($locale, SiteInterface $site)
    {
        $this->siteManager->save();
        $this->eventDispatcher->dispatch(SiteEvents::EDIT_SUCCESS, new SiteEvent($locale, $site));

        $alert = $this->alertManager->create();
        $alert->addSuccess($this->translator->trans('success.site_save', array(), 'SilvestraSite'));
        $this->alertManager->setFlashAlert($alert);
    }
113937
protected function activate($targetDir)
    {
        if (!is_dir($targetDir)) {
            mkdir($targetDir, 0777, true);
        }

        if (!is_writable($targetDir)) {
            $this->cleanup();
            throw new \RuntimeException(
                sprintf('Can\'t move sitemaps to "%s" - directory is not writeable', $targetDir)
            );
        }
        $this->deleteExistingSitemaps($targetDir);

        // no need to delete the root file as it always exists, it will be overwritten
        $this->filesystem->mirror($this->tmpFolder, $targetDir, null, array('override' => true));
        $this->cleanup();
    }
588420
function activate() {
		if( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG )
			return;

		activate_plugin( 'debug-bar/debug-bar.php', null, is_multisite() );
		activate_plugin( 'debug-bar-slow-actions/debug-bar-slow-actions.php', null, is_multisite() );
		activate_plugin( 'kint-debugger/Kint.class.php', null, is_multisite() );
		activate_plugin( 'debug-bar-timber/debug-bar-timber.php', null, is_multisite() );
	}
196277
public function tasks($site)
    {
        $variables = array(
            'site' => $site,
        );
        $request = $this->get(array('{+base_path}/sites/{site}/tasks.json', $variables));
        return new Response\Tasks($request);
    }
1260584
public function updateAcsfSites($site, $target_env) {
    $this->say("Running updates for site <comment>$site</comment> in environment <comment>$target_env</comment>.");
    $this->switchSiteContext($site);
    $this->invokeCommand('artifact:update:drupal');
  }
351250
public function viewAction(Site $site)
    {
        $requester = user_load($site->uid);
        if (!$requester) {
            $requester = drupal_anonymous_user();
        }

        $template = null;
        if ($site->template_id) {
            try {
                $template = $this->getSiteManager()->getStorage()->findOne($site->template_id);
                $template = l($template->title, 'admin/dashboard/site/' . $template->id);
            } catch (\Exception $e) {
                $template = '<span class="text-muted>' . t("Template does not exist anymore") . '</span>';
            }
        } else {
            $template = '';
        }

        $states = SiteState::getList();

        $uri = 'http://' . $site->http_host;

        $table = $this->createAdminTable('ucms_site_details', ['site' => $site])
            ->addHeader(t("Identification"))
            ->addRow(t("HTTP hostname"), l($uri, $uri))
            ->addRow(t("State"), t($states[$site->state]))
            ->addRow(t("Title"), check_plain($site->title))
            ->addRow(t("Created at"), format_date($site->ts_created->getTimestamp()))
            ->addRow(t("Lastest update"), format_date($site->ts_changed->getTimestamp()))
            ->addRow(t("Requester"), check_plain(format_username($requester)))
            ->addHeader(t("Description"))
            ->addRow(t("Description"), check_markup($site->title_admin))
            ->addRow(t("Replaces"), check_markup($site->replacement_of))
            ->addRow(t("HTTP redirections"), check_markup($site->http_redirects))
            ->addHeader(t("Display information"))
            ->addRow(t("Theme"), check_plain($site->theme))
            ->addRow(t("Is a template"), $site->is_template ? '<strong>' . t("yes") . '</strong>' : t("No"))
        ;

        if ($template) {
            $table->addRow(t("Site template"), $template);
        }

        $this->addArbitraryAttributesToTable($table, $site->getAttributes());

        return $table->render();
    }
151954
public function activateCommand($siteNode)
    {
        $sites = $this->findSitesByNodeNamePattern($siteNode);
        if (empty($sites)) {
            $this->outputLine('<error>No Site found for pattern "%s".</error>', [$siteNode]);
            $this->quit(1);
        }
        foreach ($sites as $site) {
            $site->setState(Site::STATE_ONLINE);
            $this->siteRepository->update($site);
            $this->outputLine('Site "%s" was activated.', [$site->getNodeName()]);
        }
    }