\Pydio\Conf\BootBootConfLoader

Implementation of the configuration driver on serial files

Summary

Methods
Properties
Constants
init()
loadPluginConfig()
_loadPluginConfig()
savePluginConfig()
_savePluginConfig()
listRepositories()
listRepositoriesWithCriteria()
getRepositoryById()
getRepositoryByAlias()
saveRepository()
deleteRepository()
listRoles()
saveRoles()
updateRole()
deleteRole()
rolesLastUpdated()
countAdminUsers()
saveBinary()
loadBinary()
deleteBinary()
saveTemporaryKey()
loadTemporaryKey()
deleteTemporaryKey()
pruneTemporaryKeys()
createUserObject()
deleteUser()
instantiateAbstractUserImpl()
getUserClassFileName()
getUserChildren()
getRolesForRepository()
countUsersForRepository()
filterUsersByGroup()
groupExists()
createGroup()
deleteGroup()
relabelGroup()
getChildrenGroups()
getOption()
getExposedPreferences()
switchAction()
getUserRoleList()
publishPermissionsMask()
__construct()
__clone()
getWorkDirForPluginId()
performChecks()
isEnabled()
loadManifest()
getManifestLabel()
getManifestDescription()
serialize()
unserialize()
getManifestRawContent()
getRegistryContributions()
updateDependencies()
dependsOn()
getActiveDependencies()
getConfigsDefinitions()
loadConfigs()
getConfigs()
getClassFile()
missingExtensions()
hasMissingExtensions()
manifestLoaded()
getId()
getName()
getType()
getBaseDir()
getDependencies()
logDebug()
logInfo()
logNotice()
logWarning()
logError()
detectStreamWrapper()
getPluginInformation()
getPluginInformationHTML()
reloadXPath()
hasMixin()
getServerUuid()
printFormFromServerSettings()
loadInstallerForm()
applyInstallerForm()
sendInstallResult()
setAdditionalData()
feedPluginsOptions()
createBootstrapConf()
updateHtAccess()
createUsers()
testConnexions()
$driverType
$loadingState
No constants found
parseSpecificContributions()
pluginUsesBootConf()
getPluginWorkDir()
getPluginCacheDir()
getXPath()
getContextualOption()
loadRegistryContributions()
initXmlContributionFile()
unserializeManifest()
loadDependencies()
cachedNodesFromManifest()
loadConfigsDefinitions()
loadOptionsDefaults()
exposeConfigInManifest()
loadMixins()
nodeAttrToHash()
nodesEqual()
authLegacyToBootConf()
$options
$baseDir
$id
$name
$type
$manifestLoaded
$externalFilesAppended
$enabled
$registryContributions
$contributionsLoaded
$pluginConf
$pluginConfDefinition
$dependencies
$extensionsDependencies
$streamData
$mixins
$cachedXPathResults
$manifestDoc
N/A
getInternalConf()
$xPath
$manifestXML
$serializableAttributes
$internalConf
N/A

Properties

$driverType

$driverType : 

Type

$loadingState

$loadingState : 

Type

$options

$options : array

Type

array

$baseDir

$baseDir : 

Type

$id

$id : 

Type

$name

$name : 

Type

$type

$type : 

Type

$manifestLoaded

$manifestLoaded : 

Type

$externalFilesAppended

$externalFilesAppended : 

Type

$enabled

$enabled : 

Type

$registryContributions

$registryContributions : 

Type

$contributionsLoaded

$contributionsLoaded : 

Type

$pluginConf

$pluginConf : 

Type

$pluginConfDefinition

$pluginConfDefinition : 

Type

$dependencies

$dependencies : 

Type

$extensionsDependencies

$extensionsDependencies : 

Type

$streamData

$streamData : 

Type

$mixins

$mixins : 

Type

$cachedXPathResults

$cachedXPathResults : 

Type

$manifestDoc

$manifestDoc : \DOMDocument

The manifest.xml loaded

Type

\DOMDocument

$xPath

$xPath : \DOMXPath

XPath query

Type

\DOMXPath

$manifestXML

$manifestXML : string

Internally store XML during serialization state.

Type

string

$serializableAttributes

$serializableAttributes : 

Type

$internalConf

$internalConf : 

Type

Methods

loadPluginConfig()

loadPluginConfig(String  $pluginType, String  $pluginName) : array

Returns an array of options=>values merged from various sources (.inc.php, implementation source)

Parameters

String $pluginType
String $pluginName

Returns

array

_loadPluginConfig()

_loadPluginConfig(string  $pluginId, array  $options) : mixed

Parameters

string $pluginId
array $options

Returns

mixed

savePluginConfig()

savePluginConfig(String  $pluginId, array  $options) 

Intercept CONF and AUTH configs to use the BootConf Storage

Parameters

String $pluginId
array $options

_savePluginConfig()

_savePluginConfig(String  $pluginId, String  $options) 

Parameters

String $pluginId
String $options

listRepositories()

listRepositories(\Pydio\Conf\Core\AbstractUser  $user = null) : array

Returns a list of available repositories (dynamic ones only, not the ones defined in the config file).

Parameters

\Pydio\Conf\Core\AbstractUser $user

Returns

array

listRepositoriesWithCriteria()

listRepositoriesWithCriteria(array  $criteria, integer  $count = null) : array

Returns a list of available repositories (dynamic ones only, not the ones defined in the config file).

Parameters

array $criteria

This parameter can take the following keys

  • Search keys "uuid", "parent_uuid", "owner_user_id", "display", "accessType", "isTemplate", "slug", "groupPath", Search values can be either string, array of string, AJXP_FILTER_EMPTY, AJXP_FILTER_NOT_EMPTY or regexp:RegexpString
  • or "role" => AJXP_Role object: will search repositories accessible to this role
  • ORDERBY = array("KEY"=>"", "DIR"=>""), GROUPBY, CURSOR = array("OFFSET" => 0, "LIMIT", 30)
  • COUNT_ONLY
integer $count

int fill this integer with a count

Returns

array

getRepositoryById()

getRepositoryById(String  $repositoryId) : \Pydio\Access\Core\Model\Repository

Retrieve a Repository given its unique ID.

Parameters

String $repositoryId

Returns

\Pydio\Access\Core\Model\Repository

getRepositoryByAlias()

getRepositoryByAlias(String  $repositorySlug) : \Pydio\Access\Core\Model\Repository

Retrieve a Repository given its alias.

Parameters

String $repositorySlug

Returns

\Pydio\Access\Core\Model\Repository

saveRepository()

saveRepository(\Pydio\Access\Core\Model\Repository  $repositoryObject, Boolean  $update = false) : integer

Stores a repository, new or not.

Parameters

\Pydio\Access\Core\Model\Repository $repositoryObject
Boolean $update

Returns

integer —

-1 if failed

deleteRepository()

deleteRepository(String  $repositoryId) 

Delete a repository, given its unique ID.

Parameters

String $repositoryId

listRoles()

listRoles(array  $roleIds = array(), boolean  $excludeReserved = false) : array

Must return an associative array of roleId => AjxpRole objects.

Parameters

array $roleIds
boolean $excludeReserved

,

Returns

array —

AjxpRole[]

saveRoles()

saveRoles(array<mixed,\Pydio\Conf\Core\AJXP_Role>  $roles) : mixed

Parameters

array<mixed,\Pydio\Conf\Core\AJXP_Role> $roles

Returns

mixed

rolesLastUpdated()

rolesLastUpdated(  $rolesIdsList) : integer

Compute the most recent date where one of these roles where updated.

Parameters

$rolesIdsList

Returns

integer

countAdminUsers()

countAdminUsers() 

Specific queries

saveBinary()

saveBinary(array  $context, String  $fileName, String  $ID = null) : String

Parameters

array $context
String $fileName
String $ID

Returns

String —

$ID

loadBinary()

loadBinary(array  $context, String  $ID, resource  $outputStream = null) : boolean

Parameters

array $context
String $ID
resource $outputStream

Returns

boolean

deleteBinary()

deleteBinary(array  $context, String  $ID) : boolean

Parameters

array $context
String $ID

Returns

boolean

saveTemporaryKey()

saveTemporaryKey(String  $keyType, String  $keyId, String  $userId, array  $data) : boolean

Parameters

String $keyType
String $keyId
String $userId
array $data

Returns

boolean

loadTemporaryKey()

loadTemporaryKey(String  $keyType, String  $keyId) : array

Parameters

String $keyType
String $keyId

Returns

array

deleteTemporaryKey()

deleteTemporaryKey(String  $keyType, String  $keyId) : boolean

Parameters

String $keyType
String $keyId

Returns

boolean

pruneTemporaryKeys()

pruneTemporaryKeys(String  $keyType, String  $expiration) : null

Parameters

String $keyType
String $expiration

Returns

null

createUserObject()

createUserObject(String  $userId) : \Pydio\Core\Model\UserInterface

Instantiate a new UserInterface

Parameters

String $userId

Returns

\Pydio\Core\Model\UserInterface

deleteUser()

deleteUser(String  $userId, array  $deletedSubUsers) : array

Function for deleting a user

Parameters

String $userId
array $deletedSubUsers

Returns

array

instantiateAbstractUserImpl()

instantiateAbstractUserImpl(string  $userId) : \Pydio\Conf\Core\AbstractUser

Instantiate the right class

Parameters

string $userId

Returns

\Pydio\Conf\Core\AbstractUser

getUserClassFileName()

getUserClassFileName() : string

Returns

string

getUserChildren()

getUserChildren(  $userId) : array<mixed,\Pydio\Conf\Core\AbstractUser>

Parameters

$userId

Returns

array<mixed,\Pydio\Conf\Core\AbstractUser>

getRolesForRepository()

getRolesForRepository(string  $repositoryId, string  $rolePrefix = '', boolean  $countOnly = false) : \Pydio\Conf\Boot\array()

Parameters

string $repositoryId
string $rolePrefix
boolean $countOnly

Returns

\Pydio\Conf\Boot\array()

countUsersForRepository()

countUsersForRepository(\Pydio\Core\Model\ContextInterface  $ctx, string  $repositoryId, boolean  $details = false, boolean  $admin = false) : array

Parameters

\Pydio\Core\Model\ContextInterface $ctx

ContextInterface

string $repositoryId
boolean $details
boolean $admin

Returns

array

filterUsersByGroup()

filterUsersByGroup(array<mixed,\Pydio\Conf\Core\AbstractUser>  $flatUsersList, string  $baseGroup = "/", boolean  $fullTree = false) : void

Parameters

array<mixed,\Pydio\Conf\Core\AbstractUser> $flatUsersList
string $baseGroup
boolean $fullTree

groupExists()

groupExists(string  $groupPath) : boolean

Check if group already exists

Parameters

string $groupPath

Returns

boolean

createGroup()

createGroup(string  $groupPath, string  $groupLabel) : mixed

Parameters

string $groupPath
string $groupLabel

Returns

mixed

deleteGroup()

deleteGroup(  $groupPath) : void

Parameters

$groupPath

relabelGroup()

relabelGroup(string  $groupPath, string  $groupLabel) : void

Parameters

string $groupPath
string $groupLabel

getChildrenGroups()

getChildrenGroups(string  $baseGroup = "/") : array<mixed,string>

Parameters

string $baseGroup

Returns

array<mixed,string>

getOption()

getOption(  $optionName) 

Parameters

$optionName

getExposedPreferences()

getExposedPreferences(\Pydio\Core\Model\UserInterface  $userObject) : \Pydio\Conf\Core\array()

Parameters

\Pydio\Core\Model\UserInterface $userObject

Returns

\Pydio\Conf\Core\array()

switchAction()

switchAction(\Psr\Http\Message\ServerRequestInterface  $requestInterface, \Psr\Http\Message\ResponseInterface  $responseInterface) 

Parameters

\Psr\Http\Message\ServerRequestInterface $requestInterface
\Psr\Http\Message\ResponseInterface $responseInterface

Throws

\Pydio\Core\Exception\PydioException
\Exception
\Pydio\Core\Exception\UserNotFoundException

getUserRoleList()

getUserRoleList(\Pydio\Core\Model\UserInterface  $userObject, string  $rolePrefix, string  $includeString, string  $excludeString, boolean  $byUserRoles = false) : array

Parameters

\Pydio\Core\Model\UserInterface $userObject
string $rolePrefix

get all roles with prefix

string $includeString

get roles in this string

string $excludeString

eliminate roles in this string

boolean $byUserRoles

Returns

array

publishPermissionsMask()

publishPermissionsMask(\Psr\Http\Message\ServerRequestInterface  $requestInterface, \Psr\Http\Message\ResponseInterface  $responseInterface) 

Parameters

\Psr\Http\Message\ServerRequestInterface $requestInterface
\Psr\Http\Message\ResponseInterface $responseInterface

__construct()

__construct(string  $id, string  $baseDir) 

Construction method

Parameters

string $id
string $baseDir

__clone()

__clone() 

Make sure to clone the XML manifest document, otherwise if the plugin changes it dynamically, it can mess up things.

getWorkDirForPluginId()

getWorkDirForPluginId(  $pluginId) : string

Parameters

$pluginId

Returns

string

performChecks()

performChecks() 

Perform initialization checks, and throw exception if problems found.

Throws

\Exception

isEnabled()

isEnabled() : boolean

Returns

boolean

loadManifest()

loadManifest() 

getManifestLabel()

getManifestLabel() : mixed|string

Get the plugin label as defined in the manifest file (label attribute)

Returns

mixed|string

getManifestDescription()

getManifestDescription() : mixed|string

Get the plugin description as defined in the manifest file (description attribute)

Returns

mixed|string

serialize()

serialize() : string

Serialized all declared attributes and return a serialized representation of this plugin.

The XML Manifest is base64 encoded before serialization.

Returns

string

unserialize()

unserialize(  $string) : void

Load this plugin from its serialized reprensation. The manifest XML is base64 decoded.

Parameters

$string

getManifestRawContent()

getManifestRawContent(string  $xmlNodeName = "", string  $format = "string", boolean  $externalFiles = false) : \DOMElement|\DOMNodeList|string

Legacy function, should better be used to return XML Nodes than string. Perform a query on the manifest.

Parameters

string $xmlNodeName
string $format
boolean $externalFiles

Returns

\DOMElement|\DOMNodeList|string

getRegistryContributions()

getRegistryContributions(\Pydio\Core\Model\ContextInterface  $ctx, boolean  $extendedVersion = true) : array<mixed,\DOMElement>

Return the registry contributions. The parameter can be used by subclasses to optimize the size of the XML returned : the extended version is called when sending to the client, whereas the "small" version is loaded to find and apply actions.

Parameters

\Pydio\Core\Model\ContextInterface $ctx
boolean $extendedVersion

Can be used by subclasses to optimize the size of the XML returned.

Returns

array<mixed,\DOMElement>

dependsOn()

dependsOn(string  $pluginName) : boolean

Check if this plugin depends on another one.

Parameters

string $pluginName

Returns

boolean

getActiveDependencies()

getActiveDependencies(\Pydio\Core\PluginFramework\PluginsService  $pluginService) : array

Get dependencies

Parameters

\Pydio\Core\PluginFramework\PluginsService $pluginService

Returns

array

getConfigsDefinitions()

getConfigsDefinitions() : array

Returns

array

loadConfigs()

loadConfigs(array  $configData) : void

Load the configs passed as parameter. This method will + Parse the config definitions and load the default values + Merge these values with the $configData parameter + Publish their value in the manifest if the global_param is "exposed" to the client.

Parameters

array $configData

getConfigs()

getConfigs() : array

Return this plugin configs, merged with its associated "core" configs.

Returns

array

getClassFile()

getClassFile() : array|boolean

Return the file path of the specific class to load

Returns

array|boolean

missingExtensions()

missingExtensions() : array

Returns

array

hasMissingExtensions()

hasMissingExtensions() : boolean

Returns

boolean

manifestLoaded()

manifestLoaded() : boolean

Returns

boolean

getId()

getId() : string

Returns

string

getName()

getName() : string

Returns

string

getType()

getType() : string

Returns

string

getBaseDir()

getBaseDir() : string

Returns

string

getDependencies()

getDependencies() : array

Returns

array

logDebug()

logDebug(string  $prefix, array|string  $message = "") : void

Write a debug log with the plugin id as source

Parameters

string $prefix

A quick description or action

array|string $message

Variable number of message args (string or array)

logInfo()

logInfo(string  $prefix, array|string  $message) : void

Write an info log with the plugin id as source

Parameters

string $prefix

A quick description or action

array|string $message

Variable number of message args (string or array)

logNotice()

logNotice(string  $prefix, array|string  $message) : void

Write a notice log with the plugin id as source

Parameters

string $prefix

A quick description or action

array|string $message

Variable number of message args (string or array)

logWarning()

logWarning(string  $prefix, array|string  $message) : void

Write a warning log with the plugin id as source

Parameters

string $prefix

A quick description or action

array|string $message

Variable number of message args (string or array)

logError()

logError(string  $prefix, array|string  $message) : void

Write an error log with the plugin id as source

Parameters

string $prefix

A quick description or action

array|string $message

Variable number of message args (string or array)

detectStreamWrapper()

detectStreamWrapper(boolean  $register = false, \Pydio\Core\Model\ContextInterface  $ctx = null) : array|boolean

Detect if this plugin declares a StreamWrapper, and if yes loads it and register the stream.

Parameters

boolean $register
\Pydio\Core\Model\ContextInterface $ctx

Returns

array|boolean

getPluginInformation()

getPluginInformation() : array

Returns

array

getPluginInformationHTML()

getPluginInformationHTML(  $defaultAuthor,   $defaultUriBase) : string

Parameters

$defaultAuthor
$defaultUriBase

Returns

string

reloadXPath()

reloadXPath() : void

hasMixin()

hasMixin(  $mixinName) : boolean

Parameters

$mixinName

Returns

boolean

getServerUuid()

getServerUuid() : string

Throws

\Exception

Returns

string

printFormFromServerSettings()

printFormFromServerSettings(  $fullManifest) : string

Parameters

$fullManifest

Returns

string

loadInstallerForm()

loadInstallerForm(\Psr\Http\Message\ServerRequestInterface  $requestInterface, \Psr\Http\Message\ResponseInterface  $responseInterface) 

Transmit to the ajxp_conf load_plugin_manifest action

Parameters

\Psr\Http\Message\ServerRequestInterface $requestInterface
\Psr\Http\Message\ResponseInterface $responseInterface

applyInstallerForm()

applyInstallerForm(  $action,   $httpVars,   $fileVars, \Pydio\Core\Model\ContextInterface  $ctx) 

Transmit to the ajxp_conf load_plugin_manifest action

Parameters

$action
$httpVars
$fileVars
\Pydio\Core\Model\ContextInterface $ctx

sendInstallResult()

sendInstallResult(String  $htAccessToUpdate, String  $htContent) 

Send output to the user.

Parameters

String $htAccessToUpdate

file path

String $htContent

file content

setAdditionalData()

setAdditionalData(array  $data) 

Non-impacting operations

Parameters

array $data

Installer parsed form result

Throws

\Exception

feedPluginsOptions()

feedPluginsOptions(\Pydio\Conf\Core\AbstractConfDriver  $confDriver, array  $data, null|array  $optionsLinks = null) 

Update the plugins parameters. OptionsLinks can be an array associating keys of $data to pluginID/plugin_parameter_name

Parameters

\Pydio\Conf\Core\AbstractConfDriver $confDriver
array $data
null|array $optionsLinks

createBootstrapConf()

createBootstrapConf(array  $data) : array

Create or update the bootstrap json file.

Parameters

array $data

Parsed result of the installer form

Throws

\Exception

Returns

array —

2 entries array containing the new Conf Driver (0) and Auth Driver (1)

updateHtAccess()

updateHtAccess(  $data,   $htContent) : null|string

Tries to detect if the .htaccess file needs updating. If so, returns the path to this file and feed the $htContent with target data. That way it can be sent to the users to tell him how to update the content.

Parameters

$data
$htContent

Returns

null|string

createUsers()

createUsers(array  $data, boolean  $loginIsEmail = false) 

Create the users based on the installer form results.

Parameters

array $data

Parsed form results

boolean $loginIsEmail

Whether to use the login as primary email.

Throws

\Exception

testConnexions()

testConnexions(  $action,   $httpVars,   $fileVars, \Pydio\Core\Model\ContextInterface  $ctx) 

Helpers to test SQL connection and send a test email.

Parameters

$action
$httpVars
$fileVars
\Pydio\Core\Model\ContextInterface $ctx

Throws

\Exception

parseSpecificContributions()

parseSpecificContributions(\Pydio\Core\Model\ContextInterface  $ctx, \DOMNode  $contribNode) : void

Dynamically modify some registry contributions nodes. Can be easily derivated to enable/disable some features dynamically during plugin initialization.

Parameters

\Pydio\Core\Model\ContextInterface $ctx
\DOMNode $contribNode

pluginUsesBootConf()

pluginUsesBootConf(String  $pluginId) : boolean

Parameters

String $pluginId

Returns

boolean

getPluginWorkDir()

getPluginWorkDir(boolean  $check = false) : string

Parameters

boolean $check

Throws

\Exception

Returns

string

getPluginCacheDir()

getPluginCacheDir(boolean  $shared = false, boolean  $check = false) : string

Parameters

boolean $shared
boolean $check

Throws

\Exception

Returns

string

getXPath()

getXPath() : \DOMXPath

Returns

\DOMXPath

getContextualOption()

getContextualOption(\Pydio\Core\Model\ContextInterface  $ctx,   $optionName) : mixed|null

Parameters

\Pydio\Core\Model\ContextInterface $ctx
$optionName

Returns

mixed|null

loadRegistryContributions()

loadRegistryContributions(\Pydio\Core\Model\ContextInterface  $ctx, boolean  $dry = false) 

Main function for loading all the nodes under registry_contributions.

Parameters

\Pydio\Core\Model\ContextInterface $ctx
boolean $dry

initXmlContributionFile()

initXmlContributionFile(\Pydio\Core\Model\ContextInterface  $ctx, string  $xmlFile, array  $include = array("*"), array  $exclude = array(), boolean  $dry = false) 

Load an external XML file and include/exclude its nodes as contributions.

Parameters

\Pydio\Core\Model\ContextInterface $ctx
string $xmlFile

Path to the file from the base install path

array $include

XPath query for XML Nodes to include

array $exclude

XPath query for XML Nodes to exclude from the included ones.

boolean $dry

Dry-run of the inclusion

unserializeManifest()

unserializeManifest() 

Load DOMDocument from serialized value. Must be called after checking that property $this->manifestXML is not null.

loadDependencies()

loadDependencies() : void

Load the declared dependant plugins

cachedNodesFromManifest()

cachedNodesFromManifest(  $query) : array|mixed

Parameters

$query

Returns

array|mixed

loadConfigsDefinitions()

loadConfigsDefinitions() : void

Load the global parameters for this plugin

loadOptionsDefaults()

loadOptionsDefaults() : array

Load the default values for this plugin options

Returns

array

exposeConfigInManifest()

exposeConfigInManifest(  $configName,   $configValue) : void

Add a name/value pair in the manifest to be published to the world.

Parameters

$configName
$configValue

loadMixins()

loadMixins() : void

Check if the plugin declares mixins, and load them using PluginsService::patchPluginWithMixin method

nodeAttrToHash()

nodeAttrToHash(\DOMNode  $node) : array

Transform a simple node and its attributes to a HashTable

Parameters

\DOMNode $node

Returns

array

nodesEqual()

nodesEqual(\DOMNode  $node1, \DOMNode  $node2) : boolean

Compare two nodes at first level (nodename and attributes)

Parameters

\DOMNode $node1
\DOMNode $node2

Returns

boolean

authLegacyToBootConf()

authLegacyToBootConf(  $legacy) : array

Parameters

$legacy

Returns

array

getInternalConf()

getInternalConf() : mixed

Returns

mixed