eZPublishCommunityProject  2013.5
eZ\Publish\Core\IO\Handler\Filesystem Class Reference

Legacy Io/Storage handler, based on eZ Cluster. More...

+ Inheritance diagram for eZ\Publish\Core\IO\Handler\Filesystem:
+ Collaboration diagram for eZ\Publish\Core\IO\Handler\Filesystem:

Public Member Functions

 __construct ($storageDirectory)
 
 create (BinaryFileCreateStruct $createStruct)
 Creates and stores a new BinaryFile based on the BinaryFileCreateStruct $file. More...
 
 delete ($path)
 Deletes the existing BinaryFile with path $path. More...
 
 exists ($path)
 Checks if the BinaryFile with path $path exists. More...
 
 getExternalPath ($path)
 Removes the internal storage path from $path. More...
 
 getFileContents ($path)
 Returns the contents of the BinaryFile identified by $path. More...
 
 getFileResource ($path)
 Returns a file resource to the BinaryFile identified by $path. More...
 
 getInternalPath ($path)
 Returns the internal, handler level path to $path. More...
 
 getMetadata (MetadataHandler $metadataHandler, $path)
 Executes $metadataHandler on $path, and returns the metadata array. More...
 
 load ($path)
 Loads the BinaryFile identified by $path. More...
 
 update ($path, BinaryFileUpdateStruct $updateFileStruct)
 Updates the file identified by $path with data from $updateFile. More...
 
- Public Member Functions inherited from eZ\Publish\Core\IO\Handler
 create (BinaryFileCreateStruct $createStruct)
 Creates and stores a new BinaryFile based on the BinaryFileCreateStruct $file. More...
 

Protected Member Functions

 getStoragePath ($path)
 Transforms a path in a storage path using the $storageDirectory. More...
 
 removePrefix ($uri)
 

Private Member Functions

 createFolderStructure ($folderPath)
 Creates in the storage directory folders to the relative path $folderPath. More...
 

Private Attributes

 $prefix
 
 $storageDirectory
 

Detailed Description

Legacy Io/Storage handler, based on eZ Cluster.

Due to the legacy API, this handler has a few limitations:

  • ctime is not really supported, and will always have the same value as mtime
  • mtime can not be modified, and will always automatically be set depending on the server time upon each write operation

Constructor & Destructor Documentation

eZ\Publish\Core\IO\Handler\Filesystem::__construct (   $storageDirectory)
Parameters
string$storageDirectory

Member Function Documentation

eZ\Publish\Core\IO\Handler\Filesystem::create ( BinaryFileCreateStruct  $createStruct)

Creates and stores a new BinaryFile based on the BinaryFileCreateStruct $file.

Exceptions
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentExceptionIf the target path already exists
\RuntimeExceptionIf the directory in $createStruct->uri exists but is a file
Parameters
\eZ\Publish\SPI\IO\BinaryFileCreateStruct$createStruct
Returns
The newly created BinaryFile object
eZ\Publish\Core\IO\Handler\Filesystem::createFolderStructure (   $folderPath)
private

Creates in the storage directory folders to the relative path $folderPath.

Parameters
string$folderPath

Referenced by eZ\Publish\Core\IO\Handler\Filesystem\create(), and eZ\Publish\Core\IO\Handler\Filesystem\update().

eZ\Publish\Core\IO\Handler\Filesystem::delete (   $path)

Deletes the existing BinaryFile with path $path.

Exceptions
\eZ\Publish\Core\Base\Exceptions\NotFoundExceptionIf the file doesn't exist
Parameters
string$path

Implements eZ\Publish\Core\IO\Handler.

eZ\Publish\Core\IO\Handler\Filesystem::getExternalPath (   $path)

Removes the internal storage path from $path.

Parameters
string$path
Returns
string

Implements eZ\Publish\Core\IO\Handler.

eZ\Publish\Core\IO\Handler\Filesystem::getFileContents (   $path)

Returns the contents of the BinaryFile identified by $path.

Exceptions
\eZ\Publish\Core\Base\Exceptions\NotFoundExceptionif the file couldn't be found
Parameters
string$path
Returns
string

Implements eZ\Publish\Core\IO\Handler.

eZ\Publish\Core\IO\Handler\Filesystem::getFileResource (   $path)

Returns a file resource to the BinaryFile identified by $path.

Parameters
string$path
Returns
resource

Implements eZ\Publish\Core\IO\Handler.

eZ\Publish\Core\IO\Handler\Filesystem::getInternalPath (   $path)

Returns the internal, handler level path to $path.

Parameters
string$path
Returns
string

Implements eZ\Publish\Core\IO\Handler.

eZ\Publish\Core\IO\Handler\Filesystem::getMetadata ( MetadataHandler  $metadataHandler,
  $path 
)

Executes $metadataHandler on $path, and returns the metadata array.

Parameters
MetadataHandler$metadataHandler
string$path
Returns
array

Implements eZ\Publish\Core\IO\Handler.

eZ\Publish\Core\IO\Handler\Filesystem::load (   $path)

Loads the BinaryFile identified by $path.

Exceptions
\eZ\Publish\Core\Base\Exceptions\NotFoundExceptionIf no file identified by $path exists
Parameters
string$path
Returns

Implements eZ\Publish\Core\IO\Handler.

Referenced by eZ\Publish\Core\IO\Handler\Filesystem\create(), and eZ\Publish\Core\IO\Handler\Filesystem\update().

eZ\Publish\Core\IO\Handler\Filesystem::removePrefix (   $uri)
protected
eZ\Publish\Core\IO\Handler\Filesystem::update (   $path,
BinaryFileUpdateStruct  $updateFileStruct 
)

Updates the file identified by $path with data from $updateFile.

Exceptions
\eZ\Publish\Core\Base\Exceptions\NotFoundExceptionIf the source path doesn't exist
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentExceptionIf the target path already exists
Parameters
string$path
\eZ\Publish\SPI\IO\BinaryFileUpdateStruct$updateFileStruct
Returns
The updated BinaryFile

Implements eZ\Publish\Core\IO\Handler.

Member Data Documentation

eZ\Publish\Core\IO\Handler\Filesystem::$prefix
private
eZ\Publish\Core\IO\Handler\Filesystem::$storageDirectory
private

The documentation for this class was generated from the following file: