Check site and abort.

@param null $site
771156
protected function checkSiteAndAbort($site = null)
    {
        $site = $site ? $site : fp_env('ACACHA_FORGE_SITE');
        if (! $this->checkSite($site)) {
            $this->error('Site ' . $site . '  not valid');
            die();
        }
    }
1123250
protected function doExit()
    {
        if (FLOW_SAPITYPE === 'Web') {
            header('HTTP/1.1 503 Service Temporarily Unavailable');
            readfile($this->lockHoldingPage);
        } else {
            $expiresIn = abs((time() - self::LOCKFILE_MAXIMUM_AGE - filemtime($this->lockFlagPathAndFilename)));
            echo 'Site is currently locked, exiting.' . PHP_EOL . 'The current lock will expire after ' . $expiresIn . ' seconds.' . PHP_EOL;
        }
        exit(1);
    }
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();
    }
752264
public function setSite($site)
    {
        if (empty($site)) return $this;

        $this->checkSite($site);

        return $this->addMeta('site', $site);
    }
503072
public function removeEmptyPages(Site $site)
    {
        $q = $this->createQueryBuilder('p')
            ->select()
            ->andWhere('p._contentset IS NULL')
            ->andWhere('p._site = :site')
            ->orderBy('p._leftnode', 'desc')
            ->setParameter('site', $site);

        foreach ($q->getQuery()->execute() as $page) {
            $this->deletePage($page);
        }
    }
1176972
protected function CanEdit(Site $site)
    {
        return self::Guard()->Allow(BackendAction::Edit(), $site) && 
                self::Guard()->Allow(BackendAction::UseIt(), new SiteForm());
    }
774294
private function getCurrentSite(Site $site = null)
    {
        if (null !== $site) {
            return $site;
        }

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

        return null;
    }
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;
    }
410288
public function hasSite(Site $site)
    {
        return $this->sites()
            ->where(SiteModel::ATTR_ID, '=', $site->getId())
            ->exists();
    }
369545
public function createEntity(Site $site = null)
    {
        if (!$site) {
            $site = new Site($this->config);
        } else {
            $site->updateSiteConfigRepository($this->config);
        }
        return $site;
    }
1250700
protected function abortCommandExecution()
    {
        $this->server = $this->checkEnv('server', 'ACACHA_FORGE_SERVER');
        $this->domain = $this->checkEnv('domain', 'ACACHA_FORGE_DOMAIN');

        if (! File::exists($this->localPath = base_path('.env.production'))) {
            $this->error('File ' . $this->localPath . ' not found!');
            die();
        }

        $this->abortIfNoSSHConnection();
    }
1026604
def remove_site (site)
      return nil unless @sites.map{|s| s[:name]}.include? site
      @sites.reject!{|s| s[:name] == site}
      @need_to_update = true
    end
359360
protected function checkSite()
    {
        $sites = $this->fetchSites(fp_env('ACACHA_FORGE_SERVER'));
        return in_array(fp_env('ACACHA_FORGE_SITE'), collect($sites)->pluck('id')->toArray());
    }
1180682
protected function checkRequirements()
    {
        $statusRepository = $this->container->get('open_orchestra_model.repository.status');
        $this->abortIf((null === $statusRepository->findOnebyAutoUnpublishTo()), "Require offline status");
        $this->abortIf((null === $statusRepository->findOneByTranslationState()), "Require to translate status");

        $siteRepository = $this->container->get('open_orchestra_model.repository.site');
        $sites = $siteRepository->findByDeleted(false);

        /** @var SiteInterface $site */
        foreach ($sites as $site) {
            $this->abortIf((null === $site->getTemplateSet()), "Site " . $site->getSiteId() . " require a template set");
            $this->abortIf((null === $site->getTemplateNodeRoot()), "TemplateNodeRoot of site " . $site->getSiteId() . " must be set");
        }
    }
155039
private function SiteHostCondition(Site $site)
    {
        $siteUrl = $site->GetUrl();
        $host = parse_url($siteUrl, PHP_URL_HOST);
        return new RewriteCondition(new Variable(ServerVariable::HttpHost()), $host);
    }
1326624
def killer(site):
    """"""
    config = load_site_config(site)
    crawl_q.empty()
    consume_q.empty()

    for site_set in get_site_sets(site, config):
        site_set.destroy()
481650
public function check( $method = NULL ){
		$method			= $this->method;
		if( $method && $this->validateMethod( $method ) )
			$method		= $method;
		$currentStatus	= $this->status;
		switch( $method ){
			case self::METHOD_SOCKET:
				$this->checkUsingSocket();
				break;
			case self::METHOD_PING:
				$this->checkUsingSystemPing();
				break;
		}
		if( $this->status !== $currentStatus ){
			if( $this->callbackOnChange ){
				call_user_func_array( $this->callbackOnChange, array( $this->status ) );
			}
		}
	}