Disable an existing domain

@param string $domainName
@return bool|int
3670
public function disableDomain(string $domainName)
    {
        $domainClassCode = $this->fileMan->loadDomainCode($domainName);

        $domainClassCode = str_replace(
            "@SET\DomainEnabled(true)",
            "@SET\DomainEnabled(false)",
            $domainClassCode
        );

        return $this->fileMan->storeDomainCode($domainName, $domainClassCode, true);
    }
390342
public static function isTemporaryDomain(string $domain): bool
    {
        if (self::$domainsTemporary === null) {
            self::$domainsTemporary = self::getData('domainsTemporary');
        }

        if (\in_array($domain, self::$domainsTemporary, true)) {
            return true;
        }

        if (\preg_match('/.*\.(?:tk|ml|ga|cf|gq)$/si', $domain)) {
            return true;
        }

        return false;
    }
260424
public function cancelAddon($vpsName, $addonName)
    {
        return $this->getSoapClient(array_merge(array($vpsName, $addonName), array('__method' => 'cancelAddon')))->cancelAddon($vpsName, $addonName);
    }
73174
public static function domainToUnicode($domain)
    {
        return mb_strlen($domain, 'UTF-8') <= self::PHP_IDN_HANDLEABLE_LENGTH
            ? idn_to_utf8($domain, 0, INTL_IDNA_VARIANT_UTS46)
            : false;
    }
328271
public function deleteEnvironmentConfiguration(string $name)
    {
        if (array_key_exists($name, $this->environmentConfigurations)) {
            unset($this->environmentConfigurations[$name]);
        } else {
            throw new DomainException('There is no environment configuration with name' . $name);
        }
    }
354270
public function DisableApplication($ApplicationName) {
      // 1. Check to make sure that this application is allowed to be disabled
      $ApplicationInfo = ArrayValueI($ApplicationName, $this->AvailableApplications(), array());
      $ApplicationName = $ApplicationInfo['Index'];
      if (!ArrayValue('AllowDisable', $ApplicationInfo, TRUE))
         throw new Exception(sprintf(T('You cannot disable the %s application.'), $ApplicationName));

      // 2. Check to make sure that no other enabled applications rely on this one
      foreach ($this->EnabledApplications() as $CheckingName => $CheckingInfo) {
         $RequiredApplications = ArrayValue('RequiredApplications', $CheckingInfo, FALSE);
         if (is_array($RequiredApplications) && array_key_exists($ApplicationName, $RequiredApplications) === TRUE) {
            throw new Exception(sprintf(T('You cannot disable the %1$s application because the %2$s application requires it in order to function.'), $ApplicationName, $CheckingName));
         }
      }

      // 2. Disable it
      RemoveFromConfig("EnabledApplications.{$ApplicationName}");

      // Clear the object caches.
      Gdn_Autoloader::SmartFree(Gdn_Autoloader::CONTEXT_APPLICATION, $ApplicationInfo);

      // Redefine the locale manager's settings $Locale->Set($CurrentLocale, $EnabledApps, $EnabledPlugins, TRUE);
      $Locale = Gdn::Locale();
      $Locale->Set($Locale->Current(), $this->EnabledApplicationFolders(), Gdn::PluginManager()->EnabledPluginFolders(), TRUE);
      
      $this->EventArguments['AddonName'] = $ApplicationName;
      Gdn::PluginManager()->CallEventHandlers($this, 'ApplicationManager', 'AddonDisabled');
   }
854210
public function setDomain(Domain $domain)
    {
        $this->domain = $domain;
        $this->domainId = $domain->getDomainId();
    }
590374
protected function stripPort($domain)
    {
        if ($domainStripped = \preg_replace(self::PATTERN_STRIP_PROTOCOL, null, $domain)) {
            return $domainStripped;
        }

        return $domain;
    }
1358645
public function addDomain(Domain $domain)
    {
        $domain->setSite($this);

        $this->domains[] = $domain;

        return $this;
    }
364045
static function disable(string $name) {
        $pos = array_search($name, self::$_enableList);
        if ($pos === false)
            return;
        unset(self::$_enableList[$pos]);
    }
454868
public function useDomain($domain)
    {
        $old = $this->_currentDomain;
        $this->_currentDomain = $domain;
        textdomain($domain);
        return $old;
    }
799512
public function addPreinitDomain($domain) {
		$domain = (string) $domain;
		
		if (in_array($domain, $this->preinitDomains, true)) {
			return $this;
		}
		
		$this->preinitDomains[] = $domain;
		$this->preinitNeed      = true;
		
		return $this;
	}
1260609
public function remove($domain)
    {
        if (!$this->has($domain)) {
            throw new \InvalidArgumentException(sprintf(
                'Cannot remove the "%s" filesystem as it is not defined.',
                $domain
            ));
        }

        unset($this->filesystems[$domain]);
    }
1252124
public function addDomain(Domain $domain)
    {
        if ($this->domains->contains($domain)) {
            return $this;
        }

        $this->domains[] = $domain;

        return $this;
    }
1015158
private function setDomainName(?string $domainName): self
    {
        $this->updatePropertyValue(
            DomainNameFieldInterface::PROP_DOMAIN_NAME,
            $domainName
        );

        return $this;
    }
469475
public function disable($moduleName)
    {
        $module = $this->findOrFalse('module_name', $moduleName);
        if ($module)
        {
            if ($module->module_status)
            {
                $module->module_status = 0;
                $module->save();
                $this->app['events']->fire('modules.disable.'.$moduleName, null);
                return true;
            }
            return false;
        }
        return false;
    }
929610
public function removeTagsByName($tagName)
    {
        $this->tags = array_filter(
            $this->tags,
            function (TagInterface $tag) use ($tagName) {
                return $tag->getTagName() !== $tagName;
            }
        );
    }