OC_Util¶
-
class
OC_Util
¶ Source: lib/private/legacy/OC_Util.php#77
Properties¶
-
public property
OC_Util::$
scripts
¶ Source: lib/private/legacy/OC_Util.php#78
-
public property
OC_Util::$
styles
¶ Source: lib/private/legacy/OC_Util.php#79
-
public property
OC_Util::$
headers
¶ Source: lib/private/legacy/OC_Util.php#80
Methods¶
-
protected static
OC_Util::
getAppManager
()¶ Source: lib/private/legacy/OC_Util.php#87
-
public static
OC_Util::
setupFS
($user="")¶ - Can be set up
Source: Parameters: - $user (string)
Returns: bool
-
public static
OC_Util::
isPublicLinkPasswordRequired
()¶ - check if a password is required for each public link
Source: lib/private/legacy/OC_Util.php#338 Returns: bool
-
public static
OC_Util::
isSharingDisabledForUser
($config, $groupManager, $user)¶ - check if sharing is disabled for the current user
Source: Parameters: - $config (
OCP\IConfig
) - $groupManager (
OCP\IGroupManager
) - $user (
OCP\IUser
| null)
Returns: bool
- $config (
-
public static
OC_Util::
isDefaultExpireDateEnforced
()¶ - check if share API enforces a default expire date
Source: lib/private/legacy/OC_Util.php#378 Returns: bool
-
public static
OC_Util::
getUserQuota
($user)¶ - Get the quota of a user
Source: Parameters: - $user (
OCP\IUser
| null)
Returns: float Quota bytes
- $user (
-
public static
OC_Util::
copySkeleton
($userId, $userDirectory)¶ - copies the skeleton to the users /files
Source: Parameters: - $userId (string)
- $userDirectory (
OCP\Files\Folder
)
Throws: Throws: Throws: Throws:
-
public static
OC_Util::
copyr
($source, $target)¶ - copies a directory recursively by using streams
Source: Parameters: - $source (string)
- $target (
OCP\Files\Folder
)
Returns: void
-
public static
OC_Util::
tearDownFS
()¶ Source: lib/private/legacy/OC_Util.php#500 Returns: void
-
public static
OC_Util::
getVersion
()¶ - get the current installed version of ownCloud
Source: lib/private/legacy/OC_Util.php#512 Returns: array
-
public static
OC_Util::
getVersionString
()¶ - get the current installed version string of ownCloud
Source: lib/private/legacy/OC_Util.php#522 Returns: string
-
public static
OC_Util::
getEditionString
()¶ Source: lib/private/legacy/OC_Util.php#531 Deprecated: the value is of no use anymore Returns: string
-
public static
OC_Util::
getChannel
()¶ Source: lib/private/legacy/OC_Util.php#539 Returns: string
-
public static
OC_Util::
getBuild
()¶ Source: lib/private/legacy/OC_Util.php#548 Returns: string
-
public static
OC_Util::
addScript
($application, $file=\null, $prepend=\false)¶ - add a javascript file
Source: Parameters: - $application (string) application id
- $file (string | null) filename
- $prepend (bool) prepend the Script to the beginning of the list
Returns: void
-
public static
OC_Util::
addVendorScript
($application, $file=\null, $prepend=\false)¶ - add a javascript file from the vendor sub folder
Source: Parameters: - $application (string) application id
- $file (string | null) filename
- $prepend (bool) prepend the Script to the beginning of the list
Returns: void
-
public static
OC_Util::
addTranslations
($application, $languageCode=\null, $prepend=\false)¶ - add a translation JS file
Source: Parameters: - $application (string) application id
- $languageCode (string | null) language code, defaults to the current language
- $prepend (bool | null) prepend the Script to the beginning of the list
-
public static
OC_Util::
addStyle
($application, $file=\null, $prepend=\false)¶ - add a css file
Source: Parameters: - $application (string) application id
- $file (string | null) filename
- $prepend (bool) prepend the Style to the beginning of the list
Returns: void
-
public static
OC_Util::
addVendorStyle
($application, $file=\null, $prepend=\false)¶ - add a css file from the vendor sub folder
Source: Parameters: - $application (string) application id
- $file (string | null) filename
- $prepend (bool) prepend the Style to the beginning of the list
Returns: void
-
public static
OC_Util::
addHeader
($tag, $attributes, $text=\null, $prepend=\false)¶ - Add a custom element to the headerIf $text is null then the element will be written as empty element.So use “” to get a closing tag.
Source: Parameters: - $tag (string) tag name of the element
- $attributes (array) array of attributes for the element
- $text (string) the text content for the element
- $prepend (bool) prepend the header to the beginning of the list
-
public static
OC_Util::
checkServer
($config)¶ - check if the current server configuration is suitable for ownCloud
Source: Parameters: - $config (
OC\SystemConfig
)
Returns: array arrays with error messages and hints
- $config (
-
public static
OC_Util::
checkDatabaseVersion
()¶ - Check the database version
Source: lib/private/legacy/OC_Util.php#982 Returns: array errors array
-
public static
OC_Util::
checkDataDirectoryPermissions
($dataDirectory)¶ - Check for correct file permissions of data directory
Source: Parameters: - $dataDirectory (string)
Returns: array arrays with error messages and hints
-
public static
OC_Util::
checkDataDirectoryValidity
($dataDirectory)¶ - Check that the data directory exists and is valid bychecking the existence of the ”.ocdata” file.
Source: Parameters: - $dataDirectory (string) data directory path
Returns: array errors found
-
public static
OC_Util::
checkLoggedIn
()¶ - Check if the user is logged in, redirects to home if not. Withredirect URL parameter to the request URI.
Source: lib/private/legacy/OC_Util.php#1069 Returns: void
-
public static
OC_Util::
checkAdminUser
()¶ - Check if the user is a admin, redirects to home if not
Source: lib/private/legacy/OC_Util.php#1093 Returns: void
-
public static
OC_Util::
getDefaultPageUrl
()¶ - Returns the URL of the default pagebased on the system configuration andthe apps visible for the current user
Source: lib/private/legacy/OC_Util.php#1109 Returns: string URL
-
public static
OC_Util::
redirectToDefaultPage
()¶ - Redirect to the user default page
Source: lib/private/legacy/OC_Util.php#1157 Returns: void
-
public static
OC_Util::
getInstanceId
()¶ - get an id unique for this instance
Source: lib/private/legacy/OC_Util.php#1168 Returns: string
-
public static
OC_Util::
sanitizeHTML
($value)¶ - Public function to sanitize HTMLThis function is used to sanitize HTML and should be applied on anystring or array of strings before displaying it on a web page.
Source: Parameters: - $value (string | array)
Returns: string | array an array of sanitized strings or a single sanitized string, depends on the input parameter.
-
public static
OC_Util::
encodePath
($component)¶ - Public function to encode url parametersThis function is used to encode path to file before output.Encoding is done according to RFC 3986 with one exception:Character ‘/’ is preserved as is.
Source: Parameters: - $component (string) part of URI to encode
Returns: string
-
public
OC_Util::
createHtaccessTestFile
($config)¶ Source: lib/private/legacy/OC_Util.php#1216
-
public
OC_Util::
isHtaccessWorking
($config)¶ - Check if the .htaccess file is working
Source: Parameters: - $config (
OCP\IConfig
)
Returns: bool
Throws: \Exception
Throws: \OC\HintException
If the test file can’t get written.Throws: \Exception
Throws: \OC\HintException
If the test file can’t get written. - $config (
-
public static
OC_Util::
isSetLocaleWorking
()¶ - Check if the setlocal call does not work. This can happen if the rightlocal packages are not available on the server.
Source: lib/private/legacy/OC_Util.php#1300 Returns: bool
-
public static
OC_Util::
isAnnotationsWorking
()¶ - Check if it’s possible to get the inline annotations
Source: lib/private/legacy/OC_Util.php#1319 Returns: bool
-
public static
OC_Util::
fileInfoLoaded
()¶ - Check if the PHP module fileinfo is loaded.
Source: lib/private/legacy/OC_Util.php#1331 Returns: bool
-
public static
OC_Util::
obEnd
()¶ - clear all levels of output buffering
Source: lib/private/legacy/OC_Util.php#1340 Returns: void
-
public static
OC_Util::
runningOnMac
()¶ - Checks whether the server is running on Mac OS X
Source: lib/private/legacy/OC_Util.php#1351 Returns: bool true if running on Mac OS X, false otherwise
-
public static
OC_Util::
getTheme
()¶ - Handles the case that there may not be a theme, then check if a “default”theme exists and take that one
Source: lib/private/legacy/OC_Util.php#1361 Returns: string the theme
-
public static
OC_Util::
normalizeUnicode
($value)¶ - Normalize a unicode string
Source: Parameters: - $value (string) a not normalized string
Returns: bool | string
-
public static
OC_Util::
getHumanVersion
()¶ - A human readable string is generated based on version and build number
Source: lib/private/legacy/OC_Util.php#1398 Returns: string
-
public static
OC_Util::
isValidFileName
($file)¶ - Returns whether the given file name is valid
Source: Parameters: - $file (string) file name to check
Returns: bool true if the file name is valid, false otherwise
Deprecated: use \OC\Files\View::verifyPath()
-
public static
OC_Util::
needUpgrade
($config)¶ - Check whether the instance needs to perform an upgrade,either when the core version is higher or any app requiresan upgrade.
Source: Parameters: - $config (
OC\SystemConfig
)
Returns: bool whether the core or any app needs an upgrade
Throws: \OC\HintException
When the upgrade from the given version is not allowed - $config (
-
public static
OC_Util::
isIe
()¶ - is this Internet explorer ?
Source: lib/private/legacy/OC_Util.php#1490 Returns: bool