Returns the name of the enabled application based on $ApplicationFolder.

@param string The application folder related to the application name you want to return.
965038
public function EnabledApplication($ApplicationFolder = '') {
      if ($ApplicationFolder == '')
         $ApplicationFolder = $this->_ApplicationFolder;

      foreach (Gdn::ApplicationManager()->AvailableApplications() as $ApplicationName => $ApplicationInfo) {
         if (GetValue('Folder', $ApplicationInfo, FALSE) === $ApplicationFolder) {
            $EnabledApplication = $ApplicationName;
            $this->EventArguments['EnabledApplication'] = $EnabledApplication;
            $this->FireEvent('AfterEnabledApplication');
            return $EnabledApplication;
         }
      }
      return FALSE;
   }
1200269
private function getBundleClassnameFromFolder($folderName)
    {
        if (substr($folderName, -6) == 'Bundle') {
            $folderName = substr($folderName, 0, -6);
        }

        return sprintf(self::BUNDLE_NAME_MASK, $folderName);
    }
906466
protected function get_ns($path,$app_dir) {
        //base filename of the controller
        $class = basename($path, '.php');
        preg_match("/(?<=$app_dir).*?(?=$class)/s", $path, $match);
        return str_replace("/","\\",$app_dir.$match[0]);
    }
788350
public static function getApplicationVersion():?string
    {
        if (self::isCliApp()) {
            return self::$APPLICATION_VERSION;
        }

        return MSession::get(MCoreApplication::APPLICATION_VERSION);
    }
257894
public static function getDetectedStage($application = 'application', $path = null)
    {
        $folderRegex = '[a-zA-Z0-9_-]+';

        $current = $path ?: realpath(__DIR__);
        $pattern = sprintf('/%s\/(%s)\/%s\/([0-9]{14})/', $application, $folderRegex, $folderRegex);
        preg_match($pattern, $current, $matches);

        return isset($matches[1]) ? $matches[1] : false;
    }
1074682
public function getApplicationDocument(Application $application, $namespace = null)
    {
        $dom = new \DOMDocument('1.0', 'UTF-8');
        $dom->appendChild($rootXml = $dom->createElement('symfony'));

        if ('UNKNOWN' !== $application->getName()) {
            $rootXml->setAttribute('name', $application->getName());
            if ('UNKNOWN' !== $application->getVersion()) {
                $rootXml->setAttribute('version', $application->getVersion());
            }
        }

        $rootXml->appendChild($commandsXML = $dom->createElement('commands'));

        $description = new ApplicationDescription($application, $namespace, true);

        if ($namespace) {
            $commandsXML->setAttribute('namespace', $namespace);
        }

        foreach ($description->getCommands() as $command) {
            $this->appendDocument($commandsXML, $this->getCommandDocument($command));
        }

        if (!$namespace) {
            $rootXml->appendChild($namespacesXML = $dom->createElement('namespaces'));

            foreach ($description->getNamespaces() as $namespaceDescription) {
                $namespacesXML->appendChild($namespaceArrayXML = $dom->createElement('namespace'));
                $namespaceArrayXML->setAttribute('id', $namespaceDescription['id']);

                foreach ($namespaceDescription['commands'] as $name) {
                    $namespaceArrayXML->appendChild($commandXML = $dom->createElement('command'));
                    $commandXML->appendChild($dom->createTextNode($name));
                }
            }
        }

        return $dom;
    }
1262033
public function getSLOurl($application_index = null)
    {
        $url = null;
        $idpData = $this->_settings->getIdPData();
        if (isset($idpData['singleLogoutService']) && isset($idpData['singleLogoutService'][$application_index]) && isset($idpData['singleLogoutService'][$application_index]['url'])) {
            $url = $idpData['singleLogoutService'][$application_index]['url'];
        }
        return $url;
    }
417069
public static String getAppName() {
		String appName=System.getProperty(JKContextConstants.JK_APP_NAME);
		if (appName == null) {
			String mainClassName = JKDebugUtil.getMainClassName();
			return mainClassName.substring(0, mainClassName.lastIndexOf("."));
		}
		return appName;
	}
789859
public static function getRootFolder()
    {
        $filesystem = new Filesystem();
        $folder     = $filesystem->normalizePath(__DIR__ . '/../');

        if (! is_dir($folder)) {
            throw new RuntimeException(
                sprintf(
                    'Could not find a matching folder for folder name "%1$s".',
                    $folder
                )
            );
        }

        return $folder;
    }
94756
public function getFolderByName(
       $folderName,
       $includeTrash = false,
       \Google_Service_Drive_DriveFile $parent = null,
       $createIfNotFound = false
    ) {
        return $this->getFileByName($folderName, self::MIME_FOLDER, $includeTrash, $parent,
           $createIfNotFound);
    }
738146
private function getAppKey(): string
    {
        $appUUID = $this
            ->getRepositoryReference()
            ->getAppUUID();

        return $appUUID instanceof AppUUID
            ? $appUUID->getId()
            : '';
    }
141244
final protected function showAppsRegister()
    {
        $file = json_decode(file_get_contents(FEnvFcm::get("framework.config.core.apps.file")));
        $i = 1;
        if (count($file) == 0) {
            Output::outputAsError("Ops! You have no app registered. Please create an app with app");
        }
        $str = "";
        foreach ($file as $val) {
            $str .= $i.") ".$val->name.(($val->enabled == "yes")? " : Enabled" : "Disabled")."\n";
            array_push($this->params['applist'], $val->name);
            $i++;
        }

        Output::outputAsNormal("Your apps \n------------\n".$str, "none");
        return (false);
    }
285237
public function setApp(Application $app)
    {
        $this->app = $app;
        AppSingleton::set($app);
        $this->pathResolver = $app['path_resolver'];

        // if RM is passed directly into Application c.v.a won't be set
        // but if called later then we don't want to override the value if someone else has changed it,
        // unless disableApacheChecks has been called.
        $default = true;
        if (isset($this->app['config.validator.apache_enabled'])) {
            $default = $this->app['config.validator.apache_enabled'];
        }
        $this->app['config.validator.apache_enabled'] = function () use ($default) {
            return $this->disableApacheChecks ? false : $default;
        };
    }
137341
protected String getAppName() {
        if (appName == null && FrameworkUtil.isInitialized()) {
            setAppName(FrameworkUtil.getAppName());
        }
        
        return appName;
    }
887554
protected function validateFileName($fileName)
    {
        if (!FileHelper::validatePath($fileName, $this->maxNesting)) {
            throw new ApplicationException(Lang::get('cms::lang.cms_object.invalid_file', [
                'name' => $fileName
            ]));
        }

        if (!strlen(File::extension($fileName))) {
            $fileName .= '.'.$this->defaultExtension;
        }

        return $fileName;
    }
853999
@JsonIgnore
	public String getUsername() {
		if (App.isRoot(user.getAppid())) {
			return user.getIdentifier();
		} else {
			return user.getAppid() + "/" + user.getIdentifier();
		}
	}
121691
public function getViewFolderName()
    {
        if ($this->_viewFolderName === null) {
            $name = $this->getName();
            
            if (StringHelper::endsWith($name, $this->suffix, false)) {
                $name = substr($name, 0, -(strlen($this->suffix)));
            }
            
            $this->_viewFolderName = strtolower($name);
        }

        return $this->_viewFolderName;
    }