eZPublishCommunityProject  2012.12
eZ\Publish\Core\IO\LegacyHandler Class Reference

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

+ Inheritance diagram for eZ\Publish\Core\IO\LegacyHandler:
+ Collaboration diagram for eZ\Publish\Core\IO\LegacyHandler:

Public Member Functions

 __construct (LegacyKernel $legacyKernel)
 Created Legacy handler instance. More...
 
 create (BinaryFileCreateStruct $createFilestruct)
 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...
 
 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...
 
 load ($path)
 Loads the BinaryFile identified by $path. More...
 
 update ($path, BinaryFileUpdateStruct $updateFileStruct)
 Updates the file identified by $path with data from $updateFile. More...
 

Protected Member Functions

 getMimeTypeFromLocalFile ($path)
 Returns a mimeType from a local file, using fileinfo. More...
 

Private Member Functions

 getClusterHandler ()
 Lazy loads eZClusterFileHandler. More...
 
 getFileResourceProvider ()
 Returns the appropriate FileResourceProvider depending on the cluster handler in use. More...
 

Private Attributes

 $clusterHandler = null
 
 $fileResourceProvider = null
 File resource provider. More...
 
 $legacyKernel
 

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\LegacyHandler::__construct ( LegacyKernel  $legacyKernel)

Created Legacy handler instance.

Parameters
\eZ\Publish\Core\MVC\Legacy\Kernel$legacyKernel

Member Function Documentation

eZ\Publish\Core\IO\LegacyHandler::create ( BinaryFileCreateStruct  $createFilestruct)

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

Exceptions
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentExceptionIf the target path already exists
Parameters
\eZ\Publish\SPI\IO\BinaryFileCreateStruct$createFilestruct
Returns
The newly created BinaryFile object

Implements eZ\Publish\SPI\IO\Handler.

eZ\Publish\Core\IO\LegacyHandler::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\SPI\IO\Handler.

eZ\Publish\Core\IO\LegacyHandler::exists (   $path)

Checks if the BinaryFile with path $path exists.

Parameters
string$path
Returns
boolean

Implements eZ\Publish\SPI\IO\Handler.

Referenced by eZ\Publish\Core\IO\LegacyHandler\create(), eZ\Publish\Core\IO\LegacyHandler\delete(), and eZ\Publish\Core\IO\LegacyHandler\update().

eZ\Publish\Core\IO\LegacyHandler::getClusterHandler ( )
private
eZ\Publish\Core\IO\LegacyHandler::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\SPI\IO\Handler.

eZ\Publish\Core\IO\LegacyHandler::getFileResource (   $path)

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

Parameters
string$path
Returns
resource

Implements eZ\Publish\SPI\IO\Handler.

eZ\Publish\Core\IO\LegacyHandler::getFileResourceProvider ( )
private

Returns the appropriate FileResourceProvider depending on the cluster handler in use.

Exceptions
\Exception
Returns
eZ\Publish\Core\IO\LegacyHandler::getMimeTypeFromLocalFile (   $path)
protected

Returns a mimeType from a local file, using fileinfo.

Exceptions
\eZ\Publish\Core\Base\Exceptions\NotFoundExceptionIf file does not exist
Todo:
If legacy path is made available then this function can use that to skip executing legacy kernel
Parameters
string$path
Returns
string
eZ\Publish\Core\IO\LegacyHandler::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\SPI\IO\Handler.

Referenced by eZ\Publish\Core\IO\LegacyHandler\create().

eZ\Publish\Core\IO\LegacyHandler::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\SPI\IO\Handler.

Member Data Documentation

eZ\Publish\Core\IO\LegacyHandler::$clusterHandler = null
private
eZ\Publish\Core\IO\LegacyHandler::$fileResourceProvider = null
private

File resource provider.

See Also
getFileResourceProvider
eZ\Publish\Core\IO\LegacyHandler::$legacyKernel
private

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