\Pydio\Core\PluginFrameworkPluginsService

Core parser for loading / serving plugins

Summary

Methods
Properties
Constants
initCoreRegistry()
clearPluginsCache()
clearRegistryCaches()
confPluginSoftLoad()
cachePluginSoftLoad()
findPluginWithoutCtxt()
getInstance()
clearInstance()
searchManifestsWithCache()
searchAllManifests()
detectRepositoriesStreams()
getFilteredXMLRegistry()
getPluginByTypeName()
softLoad()
getPluginsByType()
getPluginById()
loadFromPluginQueriesCache()
storeToPluginQueriesCache()
deferBuildingRegistry()
flushDeferredRegistryBuilding()
initActivePlugins()
setPluginActive()
setPluginUniqueActiveForType()
getActivePlugins()
getActivePluginsForType()
getUniqueActivePluginForType()
getDetectedPlugins()
cloneDetectedPluginsFromCoreInstance()
getStreamWrapperPlugins()
registerWrapperClass()
getWrapperClassName()
getRegisteredWrappers()
patchPluginWithMixin()
__clone()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
initRepositoryPlugins()
copyCorePluginFromService()
loadPluginsFromCache()
loadPlugins()
savePluginsRegistryToCache()
buildXmlRegistry()
recursiveLoadPlugin()
_loadDetectedPluginsFromCache()
instanciatePluginClass()
checkDependencies()
getOrderByDependency()
filterRegistryFromRole()
getXmlRegistry()
updateXmlRegistry()
getRegistryCacheKey()
mergeNodes()
mergeChildByTagName()
hasElementChild()
__construct()
$instances
$detectedPlugins
$context
$pluginsDir
$required_files
$activePlugins
$streamWrapperPlugins
$registeredWrappers
$xmlRegistry
$registryVersion
$tmpDeferRegistryBuild
$mixinsDoc
$mixinsXPath
N/A

Properties

$detectedPlugins

$detectedPlugins : array

All detected plugins

Type

array

$pluginsDir

$pluginsDir : string

Type

string

$required_files

$required_files : 

Type

$activePlugins

$activePlugins : 

Type

$streamWrapperPlugins

$streamWrapperPlugins : 

Type

$registeredWrappers

$registeredWrappers : 

Type

$xmlRegistry

$xmlRegistry : 

Type

$registryVersion

$registryVersion : 

Type

$tmpDeferRegistryBuild

$tmpDeferRegistryBuild : 

Type

$mixinsDoc

$mixinsDoc : 

Type

$mixinsXPath

$mixinsXPath : 

Type

Methods

initCoreRegistry()

initCoreRegistry() 

Load registry either from cache or from plugins folder.

Throws

\Pydio\Core\Exception\PydioException

clearPluginsCache()

clearPluginsCache() 

Clear the cached files with the plugins

clearRegistryCaches()

clearRegistryCaches() 

Clear the cached registries

findPluginWithoutCtxt()

findPluginWithoutCtxt(string  $type, string  $name) : \Pydio\Core\PluginFramework\Plugin

Find a plugin by its type/name

Parameters

string $type
string $name

Returns

\Pydio\Core\PluginFramework\Plugin

searchManifestsWithCache()

searchManifestsWithCache(string  $query, callable  $callback, callable  $typeChecker = null) : mixed

Search in all plugins (enabled / active or not) and store result in cache

Parameters

string $query
callable $callback
callable $typeChecker

Returns

mixed

searchAllManifests()

searchAllManifests(string  $query, string  $stringOrNodeFormat = "string", boolean  $limitToActivePlugins = false, boolean  $limitToEnabledPlugins = false, boolean  $loadExternalFiles = false) : array<mixed,\DOMNode>

Search all plugins manifest with an XPath query, and return either the Nodes, or directly an XML string.

Parameters

string $query
string $stringOrNodeFormat
boolean $limitToActivePlugins

Whether to search only in active plugins or in all plugins

boolean $limitToEnabledPlugins
boolean $loadExternalFiles

Returns

array<mixed,\DOMNode>

detectRepositoriesStreams()

detectRepositoriesStreams(array<mixed,\Pydio\Core\Model\RepositoryInterface>  $repositories) : array

Gather stream data from repositories driver, without loading the whole context.

Parameters

array<mixed,\Pydio\Core\Model\RepositoryInterface> $repositories

Returns

array

getFilteredXMLRegistry()

getFilteredXMLRegistry(boolean  $extendedVersion = true, boolean  $clone = false, boolean  $useCache = false) : \DOMDocument|\DOMNode

Get publicable XML Registry, filtered by roles

Parameters

boolean $extendedVersion
boolean $clone
boolean $useCache

Returns

\DOMDocument|\DOMNode

getPluginByTypeName()

getPluginByTypeName(string  $plugType, string  $plugName) : \Pydio\Core\PluginFramework\Plugin

Parameters

string $plugType
string $plugName

Returns

\Pydio\Core\PluginFramework\Plugin

getPluginsByType()

getPluginsByType(string  $type) : array<mixed,\Pydio\Core\PluginFramework\Plugin>

All the plugins of a given type

Parameters

string $type

Returns

array<mixed,\Pydio\Core\PluginFramework\Plugin>

getPluginById()

getPluginById(string  $pluginId) : \Pydio\Core\PluginFramework\Plugin

Get a plugin instance

Parameters

string $pluginId

Returns

\Pydio\Core\PluginFramework\Plugin

loadFromPluginQueriesCache()

loadFromPluginQueriesCache(  $key) : mixed|null

Load data from cache

Parameters

$key

Returns

mixed|null

storeToPluginQueriesCache()

storeToPluginQueriesCache(  $key,   $value) 

Copy data to cache

Parameters

$key
$value

Throws

\Exception

deferBuildingRegistry()

deferBuildingRegistry() 

Set the service in defer mode : do not rebuild registry on each plugin activation

flushDeferredRegistryBuilding()

flushDeferredRegistryBuilding() 

If service was in defer mode, now build the registry

initActivePlugins()

initActivePlugins() : void

Load the plugins list, and set active the plugins automatically, except for the specific types that declare a "core.*" plugin. In that case, either the core class has an AUTO_LOAD_TYPE property and all plugins are activated, or it's the task of the core class to load the necessary plugin(s) of this type.

setPluginActive()

setPluginActive(  $type,   $name, boolean  $active = true, \Pydio\Core\PluginFramework\Plugin  $updateInstance = null) : void

Add a plugin to the list of active plugins

Parameters

$type
$name
boolean $active
\Pydio\Core\PluginFramework\Plugin $updateInstance

setPluginUniqueActiveForType()

setPluginUniqueActiveForType(  $type,   $name, \Pydio\Core\PluginFramework\Plugin  $updateInstance = null) : void

Some type require only one active plugin at a time

Parameters

$type
$name
\Pydio\Core\PluginFramework\Plugin $updateInstance

getActivePlugins()

getActivePlugins() : array

Retrieve the whole active plugins list

Returns

array

getActivePluginsForType()

getActivePluginsForType(string  $type, boolean  $unique = false) : array<mixed,\Pydio\Core\PluginFramework\Plugin>

Retrieve an array of active plugins for type

Parameters

string $type
boolean $unique

Returns

array<mixed,\Pydio\Core\PluginFramework\Plugin>

getUniqueActivePluginForType()

getUniqueActivePluginForType(  $type) : \Pydio\Core\PluginFramework\Plugin

Return only one of getActivePluginsForType

Parameters

$type

Returns

\Pydio\Core\PluginFramework\Plugin

getDetectedPlugins()

getDetectedPlugins(\Pydio\Conf\Core\AbstractConfDriver  $confPlugin = null, \Pydio\Cache\Core\AbstractCacheDriver  $cachePlugin = null) : array

All the plugins registry, active or not

Parameters

\Pydio\Conf\Core\AbstractConfDriver $confPlugin
\Pydio\Cache\Core\AbstractCacheDriver $cachePlugin

Throws

\Pydio\Core\Exception\PydioException

Returns

array

cloneDetectedPluginsFromCoreInstance()

cloneDetectedPluginsFromCoreInstance(  $emptyInstance) 

Parameters

$emptyInstance

PluginsService

getStreamWrapperPlugins()

getStreamWrapperPlugins() : array

All the plugins that declare a stream wrapper

Returns

array

registerWrapperClass()

registerWrapperClass(string  $protocol, string  $wrapperClassName) : void

Add the $protocol/$wrapper to an internal cache

Parameters

string $protocol
string $wrapperClassName

getWrapperClassName()

getWrapperClassName(  $protocol,   $register = false) : string

Find a classname for a given protocol

Parameters

$protocol
$register

Returns

string

getRegisteredWrappers()

getRegisteredWrappers() : array

The protocol/classnames table

Returns

array

patchPluginWithMixin()

patchPluginWithMixin(\Pydio\Core\PluginFramework\Plugin  $plugin, \DOMDocument  $manifestDoc, String  $mixinName) 

Append some predefined XML to a plugin instance

Parameters

\Pydio\Core\PluginFramework\Plugin $plugin
\DOMDocument $manifestDoc
String $mixinName

__clone()

__clone() 

initRepositoryPlugins()

initRepositoryPlugins(\Pydio\Core\Model\ContextInterface  $ctx) 

Parameters

\Pydio\Core\Model\ContextInterface $ctx

Throws

\Pydio\Core\Exception\RepositoryLoadException
\Pydio\Core\Exception\PydioUserAlertException

loadPluginsFromCache()

loadPluginsFromCache(  $cacheStorage) : boolean

Loads the full registry, from the cache only

Parameters

$cacheStorage

Returns

boolean

savePluginsRegistryToCache()

savePluginsRegistryToCache(\Pydio\Cache\Core\AbstractCacheDriver|null  $cacheStorage) 

Save plugin registry to cache

Parameters

\Pydio\Cache\Core\AbstractCacheDriver|null $cacheStorage

buildXmlRegistry()

buildXmlRegistry(boolean  $extendedVersion = true) : void

Go through all plugins and call their getRegistryContributions() method.

Add all these contributions to the main XML ajxp_registry document.

Parameters

boolean $extendedVersion

Will be passed to the plugin, for optimization purpose.

_loadDetectedPluginsFromCache()

_loadDetectedPluginsFromCache(\Pydio\Cache\Core\AbstractCacheDriver  $cacheStorage) : boolean

Parameters

\Pydio\Cache\Core\AbstractCacheDriver $cacheStorage

Returns

boolean

checkDependencies()

checkDependencies(array<mixed,\Pydio\Core\PluginFramework\Plugin>  $arrayToSort) 

Check that a plugin dependencies are loaded, disable it otherwise.

Parameters

array<mixed,\Pydio\Core\PluginFramework\Plugin> $arrayToSort

getOrderByDependency()

getOrderByDependency(  $plugins, boolean  $withStatus = true) : array

Parameters

$plugins
boolean $withStatus

Returns

array

filterRegistryFromRole()

filterRegistryFromRole(\DOMDocument  $registry, \Pydio\Core\Model\ContextInterface  $ctx) : boolean

Check the current user "specificActionsRights" and filter the full registry actions with these.

Parameters

\DOMDocument $registry
\Pydio\Core\Model\ContextInterface $ctx

Returns

boolean

getXmlRegistry()

getXmlRegistry(boolean  $extendedVersion = true) : \DOMDocument

Build the XML Registry if not already built, and return it.

Parameters

boolean $extendedVersion

Returns

\DOMDocument —

The registry

updateXmlRegistry()

updateXmlRegistry(  $registry, boolean  $extendedVersion = true) 

Replace the current xml registry

Parameters

$registry
boolean $extendedVersion

getRegistryCacheKey()

getRegistryCacheKey(boolean  $extendedVersion = true) : string

Get a unique string identifier for caching purpose

Parameters

boolean $extendedVersion

Returns

string

mergeNodes()

mergeNodes(\DOMDocument  $original,   $parentName,   $uuidAttr,   $childrenNodes, boolean  $doNotOverrideChildren = false) : void

Central function of the registry construction, merges some nodes into the existing registry.

Parameters

\DOMDocument $original
$parentName
$uuidAttr
$childrenNodes
boolean $doNotOverrideChildren

mergeChildByTagName()

mergeChildByTagName(\DOMNode  $new, \DOMNode  $old) 

Utilitary function

Parameters

\DOMNode $new
\DOMNode $old

hasElementChild()

hasElementChild(\DOMNode  $node) : boolean

Utilitary

Parameters

\DOMNode $node

Returns

boolean

__construct()

__construct(\Pydio\Core\Model\ContextInterface|null  $ctx = null, string|null  $pluginsDir = null) 

PluginsService constructor.

Parameters

\Pydio\Core\Model\ContextInterface|null $ctx
string|null $pluginsDir