eZPublishCommunityProject  2012.12
eZ\Publish\Core\FieldType\FileService\LocalFileService Class Reference
+ Inheritance diagram for eZ\Publish\Core\FieldType\FileService\LocalFileService:
+ Collaboration diagram for eZ\Publish\Core\FieldType\FileService\LocalFileService:

Public Member Functions

 __construct ($installDir, $storageDir, $identifierPrefix= '')
 
 exists ($storageIdentifier)
 Returns is a file/directory with the given $storageIdentifier exists. More...
 
 getFileSize ($storageIdentifier)
 Returns the file size of the file identified by $storageIdentifier. More...
 
 getMetaData ($storageIdentifier)
 Returns a hash of meta data. More...
 
 getStorageIdentifier ($path)
 Returns a storage identifier for the given $path. More...
 
 remove ($storageIdentifier, $recursive=false)
 Removes the path identified by $storageIdentifier, potentially $recursive. More...
 
 storeFile ($sourcePath, $storageIdentifier)
 Store the local file identified by $sourcePath in a location that corresponds to $storageIdentifier. More...
 

Protected Member Functions

 createDirectoryRecursive ($directory)
 Creates the given directory recursively. More...
 
 getFullPath ($path, $allowLocal=false)
 Returns the full path for $path. More...
 
 removePathInternal ($path, $recursive)
 Deletes $path, $recursive or not. More...
 

Protected Attributes

 $identifierPrefix
 
 $installDir
 
 $storageDir
 

Constructor & Destructor Documentation

eZ\Publish\Core\FieldType\FileService\LocalFileService::__construct (   $installDir,
  $storageDir,
  $identifierPrefix = '' 
)
Parameters
string$installDir
string$siteName

Member Function Documentation

eZ\Publish\Core\FieldType\FileService\LocalFileService::createDirectoryRecursive (   $directory)
protected

Creates the given directory recursively.

Parameters
string$directory
Exceptions
RuntimeExceptionif the $directory could not be created
Returns
void

Referenced by eZ\Publish\Core\FieldType\FileService\LocalFileService\storeFile().

eZ\Publish\Core\FieldType\FileService\LocalFileService::exists (   $storageIdentifier)

Returns is a file/directory with the given $storageIdentifier exists.

Parameters
string$storageIdentifier
Returns
boolean

Implements eZ\Publish\Core\FieldType\FileService.

eZ\Publish\Core\FieldType\FileService\LocalFileService::getFileSize (   $storageIdentifier)

Returns the file size of the file identified by $storageIdentifier.

Parameters
string$storageIdentifier
Returns
int

Implements eZ\Publish\Core\FieldType\FileService.

eZ\Publish\Core\FieldType\FileService\LocalFileService::getMetaData (   $storageIdentifier)

Returns a hash of meta data.

array( 'width' => <int>, 'height' => <int>, 'mime' => <string>, );

Parameters
string$storageIdentifier
Returns
array

Implements eZ\Publish\Core\FieldType\FileService.

eZ\Publish\Core\FieldType\FileService\LocalFileService::getStorageIdentifier (   $path)

Returns a storage identifier for the given $path.

The storage identifier is used to identify $path inside the storage encapsulated by the file service.

Parameters
string$path
Returns
string

Implements eZ\Publish\Core\FieldType\FileService.

eZ\Publish\Core\FieldType\FileService\LocalFileService::remove (   $storageIdentifier,
  $recursive = false 
)

Removes the path identified by $storageIdentifier, potentially $recursive.

Attempts to removed the path identified by $storageIdentifier. If $storageIdentifier is a directory which is not empty and $recursive is set to false, an exception is thrown. Attempting to remove a non existing $storageIdentifier is silently ignored.

Parameters
string$storageIdentifier
boolean$recursive
Returns
void
Exceptions
\RuntimeExceptionif children of $storageIdentifier exist and $recursive is false
\RuntimeExceptionif $storageIdentifier could not be removed (most likely permission issues)

Implements eZ\Publish\Core\FieldType\FileService.

eZ\Publish\Core\FieldType\FileService\LocalFileService::removePathInternal (   $path,
  $recursive 
)
protected

Deletes $path, $recursive or not.

Parameters
string$path
boolean$recursive
Returns
void
Exceptions
RuntimeExceptionif $path is a non-empty directory and $recursive is false
RuntimeExceptionif error occurs during removal

Referenced by eZ\Publish\Core\FieldType\FileService\LocalFileService\remove().

eZ\Publish\Core\FieldType\FileService\LocalFileService::storeFile (   $sourcePath,
  $storageIdentifier 
)

Store the local file identified by $sourcePath in a location that corresponds to $storageIdentifier.

Returns an $storageIdentifier again.

Parameters
string$sourcePath
string$storageIdentifier
Returns
string

Implements eZ\Publish\Core\FieldType\FileService.

Member Data Documentation

eZ\Publish\Core\FieldType\FileService\LocalFileService::$identifierPrefix
protected
eZ\Publish\Core\FieldType\FileService\LocalFileService::$storageDir
protected

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