AppManager

class OC\App\AppManager
Source:lib/private/App/AppManager.php#54
Implements:OCP\App\IAppManager

Properties

protected static property OC\App\AppManager::$protectedAppTypes
Apps with these types can not be enabled for certain groups only
Source:lib/private/App/AppManager.php#60
Type:string[]

Methods

public OC\App\AppManager::__construct($userSession, $config, $appConfig, $groupManager, $memCacheFactory, $dispatcher, $logger)
Source:lib/private/App/AppManager.php#107
public OC\App\AppManager::getInstalledApps()
List all installed apps
Source:lib/private/App/AppManager.php#148
Returns:string[]
public OC\App\AppManager::getEnabledAppsForUser($user)
List all apps enabled for a user
Source:

lib/private/App/AppManager.php#158

Parameters:
Returns:

string[]

public OC\App\AppManager::getEnabledAppsForGroup($group)
Source:

lib/private/App/AppManager.php#170

Parameters:
Returns:

array

public OC\App\AppManager::getAutoDisabledApps()
Source:lib/private/App/AppManager.php#181
Returns:array
public OC\App\AppManager::getAppRestriction($appId)
Source:

lib/private/App/AppManager.php#189

Parameters:
  • $appId (string)
Returns:

array

public OC\App\AppManager::isEnabledForUser($appId, $user=null)
Check if an app is enabled for user
Source:

lib/private/App/AppManager.php#210

Parameters:
  • $appId (string)
  • $user (OCP\IUser) (optional) if not defined, the currently logged in user will be used
Returns:

bool

public OC\App\AppManager::isInstalled($appId)
Check if an app is enabled in the instance
Notice: This actually checks if the app is enabled and not only if it is installed.
Source:

lib/private/App/AppManager.php#294

Parameters:
  • $appId (string)
Returns:

bool

public OC\App\AppManager::ignoreNextcloudRequirementForApp($appId)
Source:lib/private/App/AppManager.php#299
public OC\App\AppManager::enableApp($appId, $forceEnable=false)
Enable an app for every user
Source:

lib/private/App/AppManager.php#314

Parameters:
  • $appId (string)
  • $forceEnable (bool)
Throws:

\OCP\App\AppPathNotFoundException

public OC\App\AppManager::hasProtectedAppType($types)
Whether a list of types contains a protected app type
Source:

lib/private/App/AppManager.php#336

Parameters:
  • $types (string[])
Returns:

bool

public OC\App\AppManager::enableAppForGroups($appId, $groups, $forceEnable=false)
Enable an app only for specific groups
Source:

lib/private/App/AppManager.php#354

Parameters:
  • $appId (string)
  • $groups (OCP\IGroup[])
  • $forceEnable (bool)
Throws:

\InvalidArgumentException if app can’t be enabled for groups

Throws:

\OCP\App\AppPathNotFoundException

Throws:

\InvalidArgumentException if app can’t be enabled for groups

Throws:

\OCP\App\AppPathNotFoundException

public OC\App\AppManager::disableApp($appId, $automaticDisabled=false)
Disable an app for every user
Source:

lib/private/App/AppManager.php#389

Parameters:
  • $appId (string)
  • $automaticDisabled (bool)
Throws:

\Exception if app can’t be disabled

public OC\App\AppManager::getAppPath($appId)
Get the directory for the given app.
Source:

lib/private/App/AppManager.php#420

Parameters:
  • $appId (string)
Returns:

string

Throws:

\OCP\App\AppPathNotFoundException if app folder can’t be found

public OC\App\AppManager::getAppWebPath($appId)
Get the web path for the given app.
Source:

lib/private/App/AppManager.php#435

Parameters:
  • $appId (string)
Returns:

string

Throws:

\OCP\App\AppPathNotFoundException if app path can’t be found

public OC\App\AppManager::clearAppsCache()
Clear the cached list of apps when enabling/disabling an app
Source:lib/private/App/AppManager.php#446
public OC\App\AppManager::getAppsNeedingUpgrade($version)
Returns a list of apps that need upgrade
Source:

lib/private/App/AppManager.php#460

Parameters:
  • $version (string) Nextcloud version as array of version components
Returns:

array list of app info from apps that need an upgrade

public OC\App\AppManager::getAppInfo($appId, $path=false, $lang=null)
Returns the app information from “appinfo/info.xml”.
Source:

lib/private/App/AppManager.php#487

Parameters:
  • $appId (string) app id
  • $path (bool)
  • $lang (null)
Returns:

array | null app info

public OC\App\AppManager::getAppVersion($appId, $useCache=true)
Source:lib/private/App/AppManager.php#516
public OC\App\AppManager::getIncompatibleApps($version)
Returns a list of apps incompatible with the given version
Source:

lib/private/App/AppManager.php#533

Parameters:
  • $version (string) Nextcloud version as array of version components
Returns:

array list of app info from incompatible apps

public OC\App\AppManager::isShipped($appId)
Source:lib/private/App/AppManager.php#551
public OC\App\AppManager::getAlwaysEnabledApps()
Source:lib/private/App/AppManager.php#580