Undocumented method.

@param string $ApplicationName Undocumented variable.
@todo Document DisableApplication() method.
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');
   }
766998
void setAppName(final String appName) {
        if (clusterId.applicationName != null && !clusterId.applicationName.equals(appName))
            throw new IllegalStateException("Restting the application name on a cluster is not allowed.");
        clusterId = new ClusterId(appName, clusterId.clusterName);
    }
669260
final protected function checkAppName(string $appname):int
    {
        if ($appname == "App" || strpos($appname, "App") == false ||
            preg_match('/[\'^£$%&*()}{@#~?><>,|=+¬-]/', $appname)) {
            return (-1);
        }
        return (1);
    }
1264732
public void shutdownApplication( String applicationName ) throws ManagementWsException {
		this.logger.finer( "Removing application " + applicationName + "..." );

		WebResource path = this.resource
					.path( UrlConstants.APPLICATIONS )
					.path( applicationName )
					.path( "shutdown" );

		ClientResponse response = this.wsClient.createBuilder( path ).post( ClientResponse.class );
		String text = response.getEntity( String.class );
		this.logger.finer( text );
		if( Family.SUCCESSFUL != response.getStatusInfo().getFamily())
			throw new ManagementWsException( response.getStatusInfo().getStatusCode(), text );
	}
1002372
private function checkMethodName($methodName)
    {
        $methodRegex = '~^[[:alnum:]]+(\\' . $this->separator . '[[:alnum:]]+)+$~';

        if (preg_match($methodRegex, $methodName) !== 1) {
            throw new JsonRpc\Exception\Method();
        }
    }
580627
public static function createHimSelf(string $appname):bool
    {
        if (false == JL::exists(FEnv::get("framework.root")."apps/".
            $appname."/config.json")) {
            $file = new \stdClass();
            $file->visibility_dev = null;
            $file->visibility_prod = null;
            $file->hosts_allowed_dev = null;
            $file->hosts_denied_dev = null;
            $file->hosts_allowed_prod = null;
            $file->hosts_denied_prod = null;
            $file->locale_enabled = false;
            $file->prefer_locale = null;
            $file->locale_values = null;
            $file->trans_type = null;

            JsonListener::put(
                FEnv::get("framework.root")."apps/". $appname."/config.json",
                json_encode($file, JSON_PRETTY_PRINT)
            );
            return (JL::exists(FEnv::get("framework.root")."apps/".
                $appname."/config.json"));
        }
        return (false);
    }
632444
public void remove(String applicationName, Class<?> robotContext, boolean verbose) {
        logger.info("Remove application named [{}].", applicationName);
        removeApplicationPages(applicationName, robotContext, verbose);
        removeApplicationSteps(applicationName, robotContext, verbose);
        removeApplicationModel(applicationName, robotContext, verbose);
        removeApplicationContext(robotContext, applicationName, verbose);
        removeApplicationSelector(applicationName, verbose);
        removeApplicationInPropertiesFile(applicationName, robotContext.getSimpleName().replaceAll("Context", ""), verbose);
        removeApplicationInEnvPropertiesFile(applicationName, "ci", verbose);
        removeApplicationInEnvPropertiesFile(applicationName, "dev", verbose);
        removeApplicationInEnvPropertiesFile(applicationName, "prod", verbose);
    }
124014
public static function autoload(string $className): void
    {
        $classPath = str_replace('\\', DS, $className);
        $path = $classPath . '.php';

        if ((@include $path) === false) {
            // if we fail to include a file, let's throw an exception so we can see where it happened - it'll speed up troubleshooting
            $includePath = get_include_path();
            throw new ApplicationException("Unable to load class {$className} in current include path={$includePath}");
        }
    }
1264180
protected function setApplicationName($applicationName)
    {
        if ($applicationName != strtolower($applicationName)) {
            throw new InvalidArgumentException('Application name should be lowercase');
        }
        if (preg_match('/[^a-z0-9]/', $applicationName)) {
            throw new InvalidArgumentException('Application name should contains only alphanumeric chars');
        }

        if (strlen($applicationName) > 16) {
            $message = 'Application name should be no longer than 16 characters';
            throw new InvalidArgumentException($message);
        }

        $this->applicationName = $applicationName;
    }
235495
public function setApplication(Application $application = null)
    {
        parent::setApplication($application);

        if (!$this->getHelperSet()) {
            throw new \Exception('Helper set is not set.');
        }
        $this->getHelperSet()->set(new SimpleQuestionHelper());
    }
88147
public function Applications($Filter = '', $ApplicationName = '', $TransientKey = '') {
      $this->Permission('Garden.Settings.Manage');
      
      // Page setup
      $this->AddJsFile('addons.js');
      $this->AddJsFile('applications.js');
      $this->Title(T('Applications'));
      $this->AddSideMenu('dashboard/settings/applications');
      
      // Validate & set parameters
      $Session = Gdn::Session();
      $ApplicationName = $Session->ValidateTransientKey($TransientKey) ? $ApplicationName : '';
      if (!in_array($Filter, array('enabled', 'disabled')))
         $Filter = 'all';
      $this->Filter = $Filter;
      $AuthenticatedPostBack = $this->Form->AuthenticatedPostBack();      
      
      $ApplicationManager = new Gdn_ApplicationManager();
      $this->AvailableApplications = $ApplicationManager->AvailableVisibleApplications();
      $this->EnabledApplications = $ApplicationManager->EnabledVisibleApplications();
      
      if ($ApplicationName != '') {
         $this->EventArguments['ApplicationName'] = $ApplicationName;
         if (array_key_exists($ApplicationName, $this->EnabledApplications) === TRUE) {
            try {
               $ApplicationManager->DisableApplication($ApplicationName);
               Gdn_LibraryMap::ClearCache();
               $this->FireEvent('AfterDisableApplication');
            } catch (Exception $e) {
               $this->Form->AddError(strip_tags($e->getMessage()));
            }
         } else {
            try {
               $ApplicationManager->CheckRequirements($ApplicationName);
            } catch (Exception $e) {
               $this->Form->AddError(strip_tags($e->getMessage()));
            }
            if ($this->Form->ErrorCount() == 0) {
               $Validation = new Gdn_Validation();
               $ApplicationManager->RegisterPermissions($ApplicationName, $Validation);
               $ApplicationManager->EnableApplication($ApplicationName, $Validation);
               Gdn_LibraryMap::ClearCache();
               $this->Form->SetValidationResults($Validation->Results());
               
               $this->EventArguments['Validation'] = $Validation;
               $this->FireEvent('AfterEnableApplication');
            }
            
         }
         if ($this->Form->ErrorCount() == 0)
            Redirect('settings/applications/'.$this->Filter);
      }
      $this->Render();
   }
90178
public function deleteGeneratorTablesFor($documentName)
    {
        $class  = $this->dm->getClassMetadata($documentName);
        $tables = $this->getGeneratorTablesFor($class);

        foreach ($tables as $tableName => $definition) {
            $this->doCreateTable($tableName, $definition);
        }
    }
725497
public function save()
    {
        $this->validateFileName();

        $fullPath = $this->getFilePath();

        if (File::isFile($fullPath) && $this->originalFileName !== $this->fileName) {
            throw new ApplicationException(Lang::get(
                'cms::lang.cms_object.file_already_exists',
                ['name'=>$this->fileName]
            ));
        }

        $dirPath = $this->theme->getPath().'/'.$this->dirName;
        if (!file_exists($dirPath) || !is_dir($dirPath)) {
            if (!File::makeDirectory($dirPath, 0777, true, true)) {
                throw new ApplicationException(Lang::get(
                    'cms::lang.cms_object.error_creating_directory',
                    ['name'=>$dirPath]
                ));
            }
        }

        if (($pos = strpos($this->fileName, '/')) !== false) {
            $dirPath = dirname($fullPath);

            if (!is_dir($dirPath) && !File::makeDirectory($dirPath, 0777, true, true)) {
                throw new ApplicationException(Lang::get(
                    'cms::lang.cms_object.error_creating_directory',
                    ['name'=>$dirPath]
                ));
            }
        }

        $newFullPath = $fullPath;
        if (@File::put($fullPath, $this->content) === false) {
            throw new ApplicationException(Lang::get(
                'cms::lang.cms_object.error_saving',
                ['name'=>$this->fileName]
            ));
        }

        if (strlen($this->originalFileName) && $this->originalFileName !== $this->fileName) {
            $fullPath = $this->getFilePath($this->originalFileName);

            if (File::isFile($fullPath)) {
                @unlink($fullPath);
            }
        }

        clearstatcache();

        $this->mtime = @File::lastModified($newFullPath);
        $this->originalFileName = $this->fileName;
        $this->exists = true;
    }
809482
function unsetLocalVariable( $varName, $rootNamespace )
    {
        if ( !$this->hasLocalVariable( $varName, $rootNamespace ) )
            return;

        $this->unsetVariable( $varName, $rootNamespace );
        unset( $this->CurrentLocalVariablesNames[$rootNamespace][$varName] );
    }
20256
function ignore($methodName, $_ = null)
    {
        $ignoredMethods = func_get_args();
        foreach($ignoredMethods as $im)
            $this->_t_options__ignored[] = (string) $im;

        return $this;
    }
785671
protected function recordMethodInvocation($methodName)
    {
        if ($this->in_static_mode) {
            $this->expectedStaticMethodCalls[] = $methodName;
        } else {
            $this->expectedInstanceMethodCalls[] = $methodName;
        }
    }
114126
public function removeUndefinedProperties($workspaceName, /** @noinspection PhpUnusedParameterInspection */$dryRun, NodeType $nodeType = null)
    {
        $this->dispatch(self::EVENT_NOTICE, 'Checking for undefined properties ...');

        /** @var \Neos\ContentRepository\Domain\Model\Workspace $workspace */
        $workspace = $this->workspaceRepository->findByIdentifier($workspaceName);

        $nodesWithUndefinedPropertiesNodes = [];
        $undefinedPropertiesCount = 0;
        $nodes = $nodeType !== null ? $this->getNodeDataByNodeTypeAndWorkspace($nodeType, $workspaceName) : $this->nodeDataRepository->findByWorkspace($workspace);
        foreach ($nodes as $nodeData) {
            try {
                /** @var NodeData $nodeData */
                if ($nodeData->getNodeType()->getName() === 'unstructured') {
                    continue;
                }
                $context = $this->nodeFactory->createContextMatchingNodeData($nodeData);
                $node = $this->nodeFactory->createFromNodeData($nodeData, $context);
                if (!$node instanceof NodeInterface) {
                    continue;
                }
                $nodeType = $node->getNodeType();

                $nodeTypePropertyNames = array_keys($nodeType->getProperties());
                $undefinedProperties = [];

                foreach ($node->getProperties() as $propertyName => $propertyValue) {
                    if (!in_array($propertyName, $nodeTypePropertyNames)) {
                        $undefinedProperties[] = $propertyName;
                    }
                }
                if ($undefinedProperties !== []) {
                    $nodesWithUndefinedPropertiesNodes[$node->getIdentifier()] = ['node' => $node, 'undefinedProperties' => $undefinedProperties];
                    foreach ($undefinedProperties as $undefinedProperty) {
                        $undefinedPropertiesCount++;
                        $this->dispatch(self::EVENT_NOTICE, sprintf('Found undefined property named "<i>%s</i>" in "<i>%s</i>" (<i>%s</i>)', $undefinedProperty, $node->getPath(), $node->getNodeType()->getName()));
                    }
                }
            } /** @noinspection PhpRedundantCatchClauseInspection */ catch (NodeTypeNotFoundException $exception) {
                $this->dispatch(self::EVENT_NOTICE, sprintf('Skipped undefined node type in "%s"', $nodeData->getPath()));
            }
        }

        if ($undefinedPropertiesCount > 0) {
            $taskDescription = sprintf('Remove <i>%d</i> undefined propert%s.', $undefinedPropertiesCount, $undefinedPropertiesCount > 1 ? 'ies' : 'y');
            $taskClosure = function () use ($nodesWithUndefinedPropertiesNodes) {
                foreach ($nodesWithUndefinedPropertiesNodes as $nodesWithUndefinedPropertiesNode) {
                    /** @var NodeInterface $node */
                    $node = $nodesWithUndefinedPropertiesNode['node'];
                    foreach ($nodesWithUndefinedPropertiesNode['undefinedProperties'] as $undefinedProperty) {
                        if ($node->hasProperty($undefinedProperty)) {
                            $node->removeProperty($undefinedProperty);
                        }
                    }
                }
            };
            $taskRequiresConfirmation = true;
            $this->dispatch(self::EVENT_TASK, $taskDescription, $taskClosure, $taskRequiresConfirmation);
        }

        $this->persistenceManager->persistAll();
    }