Finds configurations files and returns a configuration array
Checks the current and parent folders for configuration files and to see if we're allowed to look for media file Supports explicit inheritance
| package |
OCA\Gallery\Service |
|---|
__construct(string $appName, \OCA\Gallery\Environment\Environment $environment, \OCP\ILogger $logger)
addSvgSupport(array<mixed,string> $supportedMimes, boolean $nativeSvgSupport) : array<mixed,string>
If it's enabled, but doesn't work, an exception will be raised when trying to generate a preview. If it's disabled, we support it via the browser's native support
array<mixed,string>
boolean
array<mixed,string>
buildErrorMessage(\OCA\Gallery\Config\ConfigException $exception, \OCP\Files\Folder $folder) : \OCA\Gallery\Service\array<array<string,string>,bool>
| fixme |
Missing translation |
|---|
\OCA\Gallery\Config\ConfigException
\OCP\Files\Folderthe current folder
\OCA\Gallery\Service\array,bool>
buildFolderConfig(\OCP\Files\Folder $folder, string $configName, array $collectedConfig, integer $level) : array
\OCP\Files\Folderthe current folder
stringname of the configuration file
arraythe configuration collected so far
integerthe starting level is 0 and we add 1 each time we visit a parent folder
array
collectConfig(\OCP\Files\Folder $folder, string $ignoreAlbum, string $configName, integer $level, array $configSoFar = array()) : array
Goes through all the parent folders until either we're told the album is private or we've reached the root folder
\OCP\Files\Folderthe current folder
stringname of the file which blacklists folders
stringname of the configuration file
integerthe starting level is 0 and we add 1 each time we visit a parent folder
arraythe configuration collected so far
array<null|array,bool>
configExists(\OCP\Files\Folder $rootFolder) : boolean
\OCP\Files\Folderthe virtual root folder
boolean
formatNodeData(string $imagePath, integer $nodeId, integer $mTime, string $etag, integer $size, boolean $sharedWithUser, $ownerData, integer $permissions) : array
string
integer
integer
string
integer
boolean
integer
array
getAllowedSubFolder(\OCP\Files\Folder $node, string $nodeType) : array|\OCP\Files\Folder
\OCP\Files\Folder
string
array|\OCP\Files\Folder
getConfig(\OCP\Files\Folder $folderNode, array $features) : array|null
| Throws |
|
|---|
\OCP\Files\Folderthe current folder
arraythe list of features retrieved fro the configuration file
array|null
getFeaturesList() : array<mixed,string>
array<mixed,string>
getFile(integer $nodeId) : \OCP\Files\Node
| Throws |
|
|---|
integerID of the resource to locate
\OCP\Files\Node
getFolderData(\OCP\Files\Folder $node) : \OCA\Gallery\Service\array<string,int|string|boolean|\OCA\Gallery\Service\array<string,int|\OCA\Gallery\Service\string>>
\OCP\Files\Folder
\OCA\Gallery\Service\array>
getNode(integer $nodeId) : \OCP\Files\Node
| Throws |
|
|---|
integerID of the resource to locate
\OCP\Files\Node
getNodeData(\OCP\Files\Node|\OCP\Files\File|\OCP\Files\Folder $node) : \OCA\Gallery\Service\array<string,int|string|boolean|\OCA\Gallery\Service\array<string,int|\OCA\Gallery\Service\string>>
\OCP\Files\Node|\OCP\Files\File|\OCP\Files\Folder
\OCA\Gallery\Service\array>
getNodes(\OCP\Files\Folder $folder, integer $subDepth) : array
If we can't find anything in the current folder, we throw an exception as there is no point in doing any more work, but if we're looking at a sub-folder, we return an empty array so that it can be simply ignored
\OCP\Files\Folder
integer
array
getNodeType(\OCP\Files\Node $node) : string
If there is a problem, we return an empty string so that the node can be ignored
\OCP\Files\Node
string
getOwnerData(\OCP\Files\Node $node) : null|\OCA\Gallery\Service\array<string,int|\OCA\Gallery\Service\string>
\OCP\Files\Node
null|\OCA\Gallery\Service\array
getParentConfig(\OCP\Files\Folder $folder, string $privacyChecker, string $configName, integer $level, array $collectedConfig) : \OCA\Gallery\Service\array<null|\OCA\Gallery\Service\array,bool>
We will look up to the virtual root of a shared folder, for privacy reasons
\OCP\Files\Folderthe current folder
stringname of the file which blacklists folders
stringname of the configuration file
integerthe starting level is 0 and we add 1 each time we visit a parent folder
arraythe configuration collected so far
\OCA\Gallery\Service\array
getSupportedMediaTypes(boolean $extraMediaTypes, boolean $nativeSvgSupport) : array<mixed,string>
| todo |
Native SVG could be disabled via admin settings |
|---|
boolean
boolean
array<mixed,string>all supported media types
isAllowed(\OCP\Files\Node $node) : boolean
\OCP\Files\Node
boolean
isAllowedAndAvailable(\OCP\Files\Node $node) : boolean
isMounted() doesn't include externally hosted shares, so we need to exclude those from the non-mounted nodes
\OCP\Files\Node
boolean
isAvailable(\OCP\Files\Node $node) : boolean
| todo |
Test to see by how much using file_exists slows things down |
|---|
\OCP\Files\Node
boolean
isExternalShare(\OCP\Files\Node $node) : boolean
\OCP\Files\Node
boolean
isExternalShareAllowed() : boolean
boolean
isMimeSupported(string $mimeType = '*') : boolean
In case of a failure, we just return that the media type is not supported
string
boolean
isRootFolder(\OCP\Files\Folder $folder, integer $level) : boolean
\OCP\Files\Folder
integer
boolean
recoverFromGetNodesError(integer $subDepth, \Exception $exception) : array
| Throws |
|
|---|
integer
\Exception
array
validateMimeType( $mimeType)
| Throws |
|
|---|
validateNode(\OCP\Files\Node $node)
| Throws |
|
|---|
\OCP\Files\Node
validatesInfoConfig(array $albumConfig) : array
This is for shared folders which have a virtual root
array
array
configName : string
| var |
|---|
string
completionStatus : array
| var |
<string,bool> |
|---|
array
configParser : \OCA\Gallery\Config\ConfigParser
previewManager : \OCA\Gallery\Preview\Preview
baseMimeTypes : array<mixed,string>
| todo |
This hard-coded array could be replaced by admin settings |
|---|---|
| var |
array<mixed,string>
virtualRootLevel : integer
| var |
|---|
integer
features : array<mixed,string>
| var |
|---|
array<mixed,string>
ignoreAlbum : string
| var |
|---|
string
appName : string
| var |
|---|
string
environment : \OCA\Gallery\Environment\Environment
logger : \OCP\ILogger
| var |
|---|
\OCP\ILogger