OC_App¶
-
class
OC_App
¶ - This class manages the apps. It allows them to register and integrate in theownCloud ecosystem. Furthermore, this class is responsible for installing,upgrading and removing apps.
Source: lib/private/legacy/OC_App.php#71
Constants¶
-
supportedApp = 300
Source: lib/private/legacy/OC_App.php#78
-
officialApp = 200
Source: lib/private/legacy/OC_App.php#79
Properties¶
Methods¶
-
public static
OC_App::
cleanAppId
($app)¶ - clean the appId
Source: Parameters: - $app (string) AppId that needs to be cleaned
Returns: string
-
public static
OC_App::
isAppLoaded
($app)¶ - Check if an app is loaded
Source: Parameters: - $app (string)
Returns: bool
-
public static
OC_App::
loadApps
($types=[])¶ - loads all apps
Source: Parameters: - $types (string[])
Returns: bool This function walks through the ownCloud directory and loads all apps it can find. A directory contains an app if the file /appinfo/info.xml exists.
if $types is set to non-empty array, only apps of those types will be loaded
-
public static
OC_App::
loadApp
($app)¶ - load a single app
Source: Parameters: - $app (string)
Throws: \Exception
-
public static
OC_App::
registerAutoloading
($app, $path, $force=\false)¶ Source: Parameters: - $app (string)
- $path (string)
- $force (bool)
-
public static
OC_App::
isType
($app, $types)¶ - check if an app is of a specific type
Source: Parameters: - $app (string)
- $types (array)
Returns: bool
-
public static
OC_App::
setAppTypes
($app)¶ - read app types from info.xml and cache them in the database
Source: lib/private/legacy/OC_App.php#345
-
public static
OC_App::
getEnabledApps
($forceRefresh=\false, $all=\false)¶ - Returns apps enabled for the current user.
Source: Parameters: - $forceRefresh (bool) whether to refresh the cache
- $all (bool) whether to return apps for all users, not only the
currently logged in one
Returns: string[]
-
public static
OC_App::
isEnabled
($app)¶ - checks whether or not an app is enabled
Source: Parameters: - $app (string) app
Returns: bool
Deprecated: 13.0.0 use \OC::$server->getAppManager()->isEnabledForUser($appId)
This function checks whether or not an app is enabled.
-
public
OC_App::
enable
($appId, $groups=[])¶ - enables an app
Source: Parameters: - $appId (string)
- $groups (array) (optional) when set, only these groups will have access to the app
Throws: \Exception
Returns: void This function set an app as enabled in appconfig.
-
public static
OC_App::
getInstallPath
()¶ - Get the path where to install apps
Source: lib/private/legacy/OC_App.php#462 Returns: string | bool
-
public static
OC_App::
findAppInDirectories
($appId)¶ - search for an app in all app-directories
Source: Parameters: - $appId (string)
Returns: bool | string
-
public static
OC_App::
getAppPath
($appId)¶ - Get the directory for the given app.If the app is defined in multiple directories, the first one is taken. (false if not found)
Source: Parameters: - $appId (string)
Returns: string | bool
Deprecated: 11.0.0 use \OC::$server->getAppManager()->getAppPath()
-
public static
OC_App::
getAppWebPath
($appId)¶ - Get the path for the given app on the accessIf the app is defined in multiple directories, the first one is taken. (false if not found)
Source: Parameters: - $appId (string)
Returns: string | bool
Deprecated: 18.0.0 use \OC::$server->getAppManager()->getAppWebPath()
-
public static
OC_App::
getAppVersion
($appId, $useCache=\true)¶ - get the last version of the app from appinfo/info.xml
Source: Parameters: - $appId (string)
- $useCache (bool)
Returns: string
Deprecated: 14.0.0 use \OC::$server->getAppManager()->getAppVersion()
-
public static
OC_App::
getAppVersionByPath
($path)¶ - get app’s version based on it’s path
Source: Parameters: - $path (string)
Returns: string
-
public static
OC_App::
getAppInfo
($appId, $path=\false, $lang=\null)¶ - Read all app metadata from the info.xml file
Source: Parameters: - $appId (string) id of the app or the path of the info.xml file
- $path (bool)
- $lang (string)
Returns: array | null
Deprecated: 14.0.0 use \OC::$server->getAppManager()->getAppInfo()
- Returns the navigation
Source: Returns: array
Deprecated: 14.0.0 use \OC::$server->getNavigationManager()->getAll()
This function returns an array containing all entries added. The entries are sorted by the key ‘order’ ascending. Additional to the keys given for each app the following keys exist:
- active: boolean, signals if the user is on this navigation entry
- Returns the Settings Navigation
Source: Returns: string[]
Deprecated: 14.0.0 use \OC::$server->getNavigationManager()->getAll(‘settings’)
This function returns an array containing all settings pages added. The entries are sorted by the key ‘order’ ascending.
-
public static
OC_App::
getCurrentApp
()¶ - get the id of loaded app
Source: lib/private/legacy/OC_App.php#633 Returns: string
-
public static
OC_App::
getForms
($type)¶ Source: Parameters: - $type (string)
Returns: array
-
public static
OC_App::
registerAdmin
($app, $page)¶ - register an admin form to be shown
Source: Parameters: - $app (string)
- $page (string)
-
public static
OC_App::
registerPersonal
($app, $page)¶ - register a personal form to be shown
Source: Parameters: - $app (string)
- $page (string)
-
public static
OC_App::
registerLogIn
($entry)¶ Source: Parameters: - $entry (array)
Deprecated: 20.0.0 Please register your alternative login option using the registerAlternativeLogin() on the RegistrationContext in your Application class implementing the OCP\Authentication\IAlternativeLogin interface
-
public static
OC_App::
getAlternativeLogIns
()¶ Source: lib/private/legacy/OC_App.php#704 Returns: array
-
public static
OC_App::
getAllApps
()¶ - get a list of all apps in the apps folder
Source: lib/private/legacy/OC_App.php#755 Returns: string[] an array of app names (string IDs)
-
public
OC_App::
listAllApps
()¶ - List all apps, this is used in apps.php
Source: lib/private/legacy/OC_App.php#784 Returns: array
-
public static
OC_App::
shouldUpgrade
($app)¶ Source: lib/private/legacy/OC_App.php#871
-
public static
OC_App::
isAppCompatible
($ocVersion, $appInfo, $ignoreMax=\false)¶ - Check whether the current ownCloud version matches the givenapplication’s version requirements.The comparison is made based on the number of parts that theapp info version has. For example for ownCloud 6.0.3 if theapp info version is expecting version 6.0, the comparison ismade on the first two parts of the ownCloud version.This means that it’s possible to specify “requiremin” => 6and “requiremax” => 6 and it will still match ownCloud 6.0.3.
Source: Parameters: - $ocVersion (string) ownCloud version to check against
- $appInfo (array) app info (from xml)
Returns: bool true if compatible, otherwise false
-
public static
OC_App::
getAppVersions
()¶ - get the installed version of all apps
Source: lib/private/legacy/OC_App.php#960
-
public static
OC_App::
updateApp
($appId)¶ - update the database for the app and call the update script
Source: Parameters: - $appId (string)
Returns: bool
-
public static
OC_App::
executeRepairSteps
($appId, $steps)¶ Source: Parameters: - $appId (string)
- $steps (string[])
Throws:
-
public static
OC_App::
setupBackgroundJobs
($jobs)¶ Source: lib/private/legacy/OC_App.php#1066
-
public static
OC_App::
getStorage
($appId)¶ Source: Parameters: - $appId (string)
Returns: \OC\Files\View
| bool
-
protected static
OC_App::
findBestL10NOption
($options, $lang)¶ Source: lib/private/legacy/OC_App.php#1108
-
public static
OC_App::
parseAppInfo
($data, $lang=\null)¶ - parses the app data array and enhanced the ‘description’ value
Source: Parameters: - $data (array) the app data
- $lang (string)
Returns: array improved app data
-
public static
OC_App::
checkAppDependencies
($config, $l, $info, $ignoreMax)¶ Source: Parameters: - $config (
OCP\IConfig
) - $l (
OCP\IL10N
) - $info (array)
Throws: \Exception
- $config (