CKFinder 3 – PHP Connector Documentation
Backend Class Reference
Inheritance diagram for Backend:

Public Member Functions

 __construct (array $backendConfig, CKFinder $app, FilesystemAdapter $adapter, array $filesystemConfig=[])
 
 getName ()
 
 getTrackedOperations ()
 
 buildPath (ResourceType $resourceType, string $path)
 
 directories (ResourceType $resourceType, string $path='', bool $recursive=false)
 
 files (ResourceType $resourceType, string $path='', bool $recursive=false)
 
 containsDirectories (ResourceType $resourceType, string $path='')
 
 isHiddenFile ($fileName)
 
 isHiddenFolder ($folderName)
 
 isHiddenPath ($path)
 
 deleteDirectory (string $dirname)
 
 deleteContents ($dirname)
 
 hasDirectory (string $directoryPath)
 
 getFileUrl (ResourceType $resourceType, string $folderPath, string $fileName, string $thumbnailFileName=null)
 
 getBaseUrl ()
 
 getRootDirectory ()
 
 usesProxyCommand ()
 
 createWriteStream (string $path)
 
 rename ($path, $newPath)
 
 getBaseAdapter ()
 

Protected Attributes

 $app
 
 $acl
 
 $ckConfig
 
 $backendConfig
 
 $adapter
 

Detailed Description

The Backend file system class.

A wrapper class for League\Flysystem\Filesystem with CKFinder customizations.

Constructor & Destructor Documentation

◆ __construct()

__construct ( array  $backendConfig,
CKFinder  $app,
FilesystemAdapter  $adapter,
array  $filesystemConfig = [] 
)

Constructor.

Parameters
array$backendConfigthe backend configuration node
CKFinder$appthe CKFinder app container
FilesystemAdapter$adapterthe adapter
array$filesystemConfigthe configuration

Member Function Documentation

◆ buildPath()

buildPath ( ResourceType  $resourceType,
string  $path 
)

Returns a path based on the resource type and the resource type relative path.

Parameters
ResourceType$resourceTypethe resource type
string$paththe resource type relative path
Returns
string path to be used with the backend adapter

◆ containsDirectories()

containsDirectories ( ResourceType  $resourceType,
string  $path = '' 
)

Check if the directory for a given path contains subdirectories.

Returns
bool true if the directory contains subdirectories
Exceptions
FilesystemException

◆ createWriteStream()

createWriteStream ( string  $path)

Creates a stream for writing.

Parameters
string$pathfile path
Returns
null|resource a stream to a file or null if the backend does not support writing streams

◆ deleteContents()

deleteContents (   $dirname)

Delete all contents of the given directory.

Parameters
string$dirname
Exceptions
FilesystemException

◆ deleteDirectory()

deleteDirectory ( string  $dirname)

Deletes a directory.

Exceptions
FilesystemException

◆ directories()

directories ( ResourceType  $resourceType,
string  $path = '',
bool  $recursive = false 
)

Returns a filtered list of directories for a given resource type and path.

Exceptions
FilesystemException

◆ files()

files ( ResourceType  $resourceType,
string  $path = '',
bool  $recursive = false 
)

Returns a filtered list of files for a given resource type and path.

Exceptions
FilesystemException

◆ getBaseAdapter()

getBaseAdapter ( )

Returns a base adapter used by this backend.

◆ getBaseUrl()

getBaseUrl ( )

Returns the base URL used to build the direct URL to files stored in this backend.

Returns
null|string base URL or null if the base URL for a backend was not defined

◆ getFileUrl()

getFileUrl ( ResourceType  $resourceType,
string  $folderPath,
string  $fileName,
string  $thumbnailFileName = null 
)

Returns a URL to a file.

If the useProxyCommand option is set for a backend, the returned URL will point to the CKFinder connector Proxy command.

Parameters
ResourceType$resourceTypethe file resource type
string$folderPaththe resource-type relative folder path
string$fileNamethe file name
null | string$thumbnailFileNamethe thumbnail file name - if the file is a thumbnail
Returns
null|string URL to a file or null if the backend does not support it

◆ getName()

getName ( )

Returns the name of the backend.

Returns
string name of the backend

◆ getRootDirectory()

getRootDirectory ( )

Returns the root directory defined for the backend.

Returns
null|string root directory or null if the root directory was not defined

◆ getTrackedOperations()

getTrackedOperations ( )

Returns an array of commands that should use operation tracking.

◆ hasDirectory()

hasDirectory ( string  $directoryPath)

Checks if a backend contains a directory.

The Backend::has() method is not always reliable and may work differently for various adapters. Checking for directory should be done with this method.

◆ isHiddenFile()

isHiddenFile (   $fileName)

Checks if the file with a given name is hidden.

Parameters
string$fileName
Returns
bool true if the file is hidden

◆ isHiddenFolder()

isHiddenFolder (   $folderName)

Checks if the directory with a given name is hidden.

Parameters
string$folderName
Returns
bool true if the directory is hidden

◆ isHiddenPath()

isHiddenPath (   $path)

Checks if the path is hidden.

Parameters
string$path
Returns
bool true if the path is hidden

◆ rename()

rename (   $path,
  $newPath 
)

Renames the object for a given path.

Parameters
mixed$path
mixed$newPath
Returns
null|bool true on success, false on failure
Exceptions
AccessDeniedException

◆ usesProxyCommand()

usesProxyCommand ( )

Returns a Boolean value telling if the backend uses the Proxy command.

Member Data Documentation

◆ $adapter

$adapter
protected

Filesystem adapter.

◆ $backendConfig

$backendConfig
protected

Backend configuration array.


The documentation for this class was generated from the following file: