Omeka_Storage¶
- class Omeka_Storage¶
Package: Storage
Top-level helper class for handling file storage.
- property _adapter¶
- property _tempDir¶
- __construct(array $options)¶
Allows storage options to be set immediately at construction.
Parameters: - $options (array) – If set, this array will be passed to setOptions.
- __call(string $name, string $arguments)¶
Delegates calls directly to Omeka_Storage to the currently-set storage adapter.
All of the methods of the Adapter interface are accessible inthis way, as well as any other methods declared by the adapter.
Parameters: - $name (string) – Method name.
- $arguments (string) – Method arguments.
Returns: mixed
- setOptions(array $options)¶
Set global options for the storage system, as well as any adapter-specific options.
Parameters: - $options (array) – Options to set. Valid options include: * ‘adapter’: (string) Name of the storage adapter to use. * ‘adapterOptions’: (array) Array of options to pass to the adapter; see the specific adapter classes for details. * ‘temp_dir’: (string) Local temporary directory where files stored before they are handled by the adapter.
- setAdapter(Omeka_Storage_Adapter_AdapterInterface|string $adapter, array|null $options = Array)¶
Set the storage adapter to be used, as well as options for that adapter.
You can either pass an already-constructed adapter object to thismethod or use this method as a factory by passing the name of anadapter class and options to set on it.
Parameters: - $adapter (Omeka_Storage_Adapter_AdapterInterface|string) – Storage adapter to set. If an adapter object is passed, it is simply set as the current adapter. If a string is passed, an object of that class is created and set as the current adapter.
- $options (array|null) – If a string is passed to $adapter, this array of options is passed to the class’ constructor.
- getAdapter()¶
Get the current storage adapter.
You generally need to use the adapter object returned by thismethod to perform any storage actions.
Returns: Omeka_Storage_Adapter_AdapterInterface
- setTempDir(string $dir)¶
Set the temporary file storage directory path.
Parameters: - $dir (string) – Local path to directory.
- getTempDir()¶
Get the temporary file storage directory path.
If no directory has been explicitly selected, the system’s tempdirectory is set as the temp dir and returned.
Returns: string Local path to directory.
- getPathByType($filename, $type = files)¶
Parameters: - $filename (unknown) –
- $type (unknown) –