CKFinder 3 – PHP Connector Documentation
Config Class Reference

Public Member Functions

 __construct ($config)
 
 get ($name)
 
 getDefaultResourceTypes ()
 
 getResourceTypes ()
 
 getResourceTypeNode ($resourceType)
 
 getHideFilesRegex ()
 
 getHideFoldersRegex ()
 
 extend ($nodeName, array $values)
 
 getPrivateDirPath ($privateDirIdentifier)
 
 isDebugLoggerEnabled ($loggerName)
 
 getBackendNode ($backendName)
 

Protected Member Functions

 mergeDefaultOptions ($options)
 
 validate ()
 
 process ()
 

Protected Attributes

 $options
 

Detailed Description

The Config class.

Contains all configuration options and a set of config helper methods.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $config)

Constructor.

Depending on the type of the parameter passed to this function, config array is used directly or it is loaded from a file.

Important: If you use a PHP file to store your config, remember to use the return statement inside the file scope to return the array.

Parameters
array | string$config
Exceptions
InvalidConfigExceptionif config was not loaded properly

Member Function Documentation

◆ extend()

extend (   $nodeName,
array  $values 
)

If the config node does not exist, creates the node with a given name and values. Otherwise extends the config node with additional (default) values.

Parameters
string$nodeName

◆ get()

get (   $name)

Returns the configuration node under the path defined in the parameter.

For easier access to nested configuration options the config $name parameter can be passed also as a dot-separated path. For example, to check if thumbnails are enabled you can use:

$config->get('thumbnails.enabled')

Parameters
string$nameconfig node name
Returns
mixed config node value

◆ getBackendNode()

getBackendNode (   $backendName)

Returns backend configuration by name.

Parameters
string$backendName
Returns
array backend configuration node
Exceptions

InvalidArgumentException

◆ getDefaultResourceTypes()

getDefaultResourceTypes ( )

Returns the default resource types names.

Returns
array

◆ getHideFilesRegex()

getHideFilesRegex ( )

Returns the regex used for hidden files check.

Returns
string

◆ getHideFoldersRegex()

getHideFoldersRegex ( )

Returns the regex used for hidden folders check.

Returns
string

◆ getPrivateDirPath()

getPrivateDirPath (   $privateDirIdentifier)

Returns the backend-relative private directory path.

Parameters
string$privateDirIdentifier
Returns
mixed

◆ getResourceTypeNode()

getResourceTypeNode (   $resourceType)

Returns the configuration node for a given resource type.

Parameters
string$resourceTyperesource type name
Returns
array configuration node for the resource type
Exceptions
InvalidResourceTypeExceptionif the resource type does not exist

◆ getResourceTypes()

getResourceTypes ( )

Returns all defined resource types names.

Returns
array

◆ isDebugLoggerEnabled()

isDebugLoggerEnabled (   $loggerName)

Checks if the debug logger with a given name is enabled.

Parameters
string$loggerNamedebug logger name
Returns
bool true if enabled

◆ mergeDefaultOptions()

mergeDefaultOptions (   $options)
protected

Merges default or missing configuration options.

Parameters
array$optionsoptions passed to CKFinder
Returns
array

◆ process()

process ( )
protected

Processes the configuration array.

◆ validate()

validate ( )
protected

Validates the config array structure.

Exceptions
InvalidConfigExceptionif config structure is invalid

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