StorageFactory¶
-
class
OC\Files\Storage\
StorageFactory
¶ Source: lib/private/Files/Storage/StorageFactory.php#31 Implements: OCP\Files\Storage\IStorageFactory
Properties¶
Methods¶
-
public
OC\Files\Storage\StorageFactory::
addStorageWrapper
($wrapperName, $callback, $priority=50, $existingMounts=[])¶ - allow modifier storage behaviour by adding wrappers around storages$callback should be a function of type (string $mountPoint, Storage $storage) => Storage
Source: Parameters: - $wrapperName (string) name of the wrapper
- $callback (callable) callback
- $priority (int) wrappers with the lower priority are applied last (meaning they get called first)
- $existingMounts (
OCP\Files\Mount\IMountPoint[]
) existing mount points to apply the wrapper to
Returns: bool true if the wrapper was added, false if there was already a wrapper with this name registered
-
public
OC\Files\Storage\StorageFactory::
removeStorageWrapper
($wrapperName)¶ - Remove a storage wrapper by name.Note: internal method only to be used for cleanup
Source: Parameters: - $wrapperName (string) name of the wrapper
-
public
OC\Files\Storage\StorageFactory::
getInstance
($mountPoint, $class, $arguments)¶ - Create an instance of a storage and apply the registered storage wrappers
Source: Parameters: - $mountPoint (
OCP\Files\Mount\IMountPoint
) - $class (string)
- $arguments (array)
Returns: - $mountPoint (
-
public
OC\Files\Storage\StorageFactory::
wrap
($mountPoint, $storage)¶ Source: Parameters: - $mountPoint (
OCP\Files\Mount\IMountPoint
) - $storage (
OCP\Files\Storage
)
Returns: - $mountPoint (