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:

lib/private/Files/Storage/StorageFactory.php#49

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:

lib/private/Files/Storage/StorageFactory.php#70

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:

lib/private/Files/Storage/StorageFactory.php#82

Parameters:
Returns:

\OCP\Files\Storage

public OC\Files\Storage\StorageFactory::wrap($mountPoint, $storage)
Source:

lib/private/Files/Storage/StorageFactory.php#91

Parameters:
Returns:

\OCP\Files\Storage