Class MOXMAN_Vfs_FileSystemManager

InheritanceMOXMAN_Vfs_FileSystemManager

This class is responsible for creating file system instances and getting files out of them.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Constructs a new FileSystemManager instance. MOXMAN_Vfs_FileSystemManager
addRoot() Adds a new root path for the file system manager. This will later on create FileSystem instances when you request the first file. MOXMAN_Vfs_FileSystemManager
close() Closes all file systems. MOXMAN_Vfs_FileSystemManager
getConfig() Returns the config for the FileSystemManager. MOXMAN_Vfs_FileSystemManager
getDefaultScheme() Returns the default scheme. For example local, zip or db. MOXMAN_Vfs_FileSystemManager
getFile() Returns a file instance based on the specified path. The path can be in the following formats: - Scheme path: local:/mydir/myfile - Encoded path: {0}/myfile - Default scheme path: /myfile MOXMAN_Vfs_FileSystemManager
getFileSystems() Gets the created file systems instances as an array. MOXMAN_Vfs_FileSystemManager
getLocalTempPath() Returns the local temp path for a file instance. MOXMAN_Vfs_FileSystemManager
registerFileSystem() Registers a new file system class for a specific scheme. MOXMAN_Vfs_FileSystemManager
removeAllFileSystems() Removes all filesystem instances. MOXMAN_Vfs_FileSystemManager
removeLocalTempFile() Removes the local temp file for a specific file instance. MOXMAN_Vfs_FileSystemManager
setDefaultScheme() Sets the default scheme. This will be used when a path is specified without a scheme for example "mydir". MOXMAN_Vfs_FileSystemManager

Method Details

__construct() public method

Constructs a new FileSystemManager instance.

public void __construct ( MOXMAN_Util_Config $config )
$config MOXMAN_Util_Config

Config instance to use for the file system manager.

addRoot() public method

Adds a new root path for the file system manager. This will later on create FileSystem instances when you request the first file.

Examples of root paths strings: Simple path: /root/dir Two named paths: name=/root/dir;name2=/root/otherdir Named database path: name=db://user:password@localhost/database/root Named ftp path: name=ftp://user:password@localhost/path Named flickr path: name=flickr://3dsfsd324sdfsd3/path Named picasa path: name=picasa://user@email:password/path Named webdav path: name=webdav://user@password@domain/path

public void addRoot ( $roots )
$roots string

Root paths to add.

close() public method

Closes all file systems.

public void close ( )
getConfig() public method

Returns the config for the FileSystemManager.

public MOXMAN_Util_Config getConfig ( )
return MOXMAN_Util_Config

Config instance that was passed as a constructor.

getDefaultScheme() public method

Returns the default scheme. For example local, zip or db.

public String getDefaultScheme ( )
return String

Default scheme name for example "local".

getFile() public method

Returns a file instance based on the specified path. The path can be in the following formats: - Scheme path: local:/mydir/myfile - Encoded path: {0}/myfile - Default scheme path: /myfile

public MOXMAN_Vfs_IFile getFile ( $path, $childPath "" )
$path string

Path to get the file system instance for.

$childPath string

Path to the child of specified parent path.

return MOXMAN_Vfs_IFile

File instance from the specified path.

getFileSystems() public method

Gets the created file systems instances as an array.

public Array getFileSystems ( )
return Array

Array with file system instances.

getLocalTempPath() public method

Returns the local temp path for a file instance.

public string getLocalTempPath ( MOXMAN_Vfs_IFile $file )
$file MOXMAN_Vfs_IFile

File instance to get local temp path for.

return string

Local temp path for the specified file.

registerFileSystem() public method

Registers a new file system class for a specific scheme.

public void registerFileSystem ( $scheme, $className )
$scheme string

Scheme for the file system.

$className string

Class name to create for the specificed scheme.

removeAllFileSystems() public method

Removes all filesystem instances.

public void removeAllFileSystems ( )
removeLocalTempFile() public method

Removes the local temp file for a specific file instance.

public void removeLocalTempFile ( MOXMAN_Vfs_IFile $file )
$file
setDefaultScheme() public method

Sets the default scheme. This will be used when a path is specified without a scheme for example "mydir".

public void setDefaultScheme ( $scheme )
$scheme string

Default scheme to set for example local, zip or db