Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Protected Member Functions | Private Attributes | List of all members
eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster Class Reference

Manages IO metadata in a mysql table, ezdfsfile. More...

Inheritance diagram for eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster:

## Public Member Functions
| __construct (Connection $connection, UrlDecorator $urlDecorator=null)
| create (SPIBinaryFileCreateStruct $binaryFileCreateStruct)
| Inserts a new reference to file $spiBinaryFileId. More...
| delete ($spiBinaryFileId)
| Deletes file $spiBinaryFileId. More...
| load ($spiBinaryFileId)
| Loads and returns metadata for $spiBinaryFileId. More...
| exists ($spiBinaryFileId)
| Checks if a file $spiBinaryFileId exists. More...
| getMimeType ($spiBinaryFileId)
| Returns the file's mimetype. More...
| deleteDirectory ($spiPath)
| Delete directory and all the content under specified directory. More...
Public Member Functions inherited from eZ\Publish\Core\IO\IOMetadataHandler
| create (BinaryFileCreateStruct $spiBinaryFileCreateStruct)
| Stores the file from $binaryFileCreateStruct. More...

## Protected Member Functions
| getNameTrunk (SPIBinaryFileCreateStruct $binaryFileCreateStruct)
| getScope (SPIBinaryFileCreateStruct $binaryFileCreateStruct)
| Returns the value for the scope meta field, based on the created file's path. More...
| addPrefix ($id)
| Adds the internal prefix string to $id. More...
| removePrefix ($prefixedId)
| Removes the internal prefix string from $prefixedId. More...
| mapArrayToSPIBinaryFile (array $properties)
| Maps an array of data base properties (id, size, mtime, datatype, md5_path, path...) to an SPIBinaryFile object. More...
| mapSPIBinaryFileCreateStructToSPIBinaryFile (SPIBinaryFileCreateStruct $binaryFileCreateStruct)

## Private Attributes
| $db
| $urlDecorator

## Detailed Description

Manages IO metadata in a mysql table, ezdfsfile.

It will prevent simultaneous writes to the same file.

Definition at line 27 of file Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster::__construct | ( | Connection | $connection,
|  | UrlDecorator | $urlDecorator = `null`
| ) |  |

Parameters

  Connection | $connection | Doctrine DBAL connection
  UrlDecorator | $urlDecorator | The URL decorator used to add a prefix to files path

Definition at line 39 of file Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php.

References eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\$urlDecorator.

## Member Function Documentation

## ◆ addPrefix()

eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster::addPrefix | ( |  | $id | ) |
| protected

Adds the internal prefix string to $id.

Parameters

  string | $id |

Returns
  string prefixed id

Definition at line 206 of file Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php.

Referenced by eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\create(), eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\delete(), eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\deleteDirectory(), eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\exists(), eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\getMimeType(), eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\getNameTrunk(), and eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\load().

## ◆ create()

eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster::create | ( | SPIBinaryFileCreateStruct | $binaryFileCreateStruct | ) |

Inserts a new reference to file $spiBinaryFileId.

Since
  6.10 The mtime of the $binaryFileCreateStruct must be a DateTime, as specified in the struct doc.

Parameters

  SPIBinaryFileCreateStruct | $binaryFileCreateStruct |

Exceptions

  InvalidArgumentException | if the $binaryFileCreateStruct is invalid
  RuntimeException | if a DBAL error occurs

Returns
  \eZ\Publish\SPI\IO\BinaryFile

Definition at line 57 of file Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php.

References eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\addPrefix(), eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\getNameTrunk(), eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\getScope(), and eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\mapSPIBinaryFileCreateStructToSPIBinaryFile().

## ◆ delete()

eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster::delete | ( |  | $spiBinaryFileId | ) |

Deletes file $spiBinaryFileId.

Exceptions

  BinaryFileNotFoundException | If $spiBinaryFileId is not found

Parameters

  string | $spiBinaryFileId |

Implements eZ\Publish\Core\IO\IOMetadataHandler.

Definition at line 101 of file Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php.

References eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\addPrefix().

## ◆ deleteDirectory()

eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster::deleteDirectory | ( |  | $spiPath | ) |

Delete directory and all the content under specified directory.

Parameters

  string | $spiPath | SPI Path, not prefixed by URL decoration

Implements eZ\Publish\Core\IO\IOMetadataHandler.

Definition at line 245 of file Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php.

References eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\addPrefix().

## ◆ exists()

eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster::exists | ( |  | $spiBinaryFileId | ) |

Checks if a file $spiBinaryFileId exists.

Parameters

  string | $spiBinaryFileId |

Exceptions

  NotFoundException |
  DBALException | Any unhandled DBAL exception

Returns
  bool

Implements eZ\Publish\Core\IO\IOMetadataHandler.

Definition at line 153 of file Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php.

References eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\addPrefix().

## ◆ getMimeType()

eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster::getMimeType | ( |  | $spiBinaryFileId | ) |

Returns the file's mimetype.

Example: text/plain.

Parameters

  $spiBinaryFileId |

Returns
  string

Implements eZ\Publish\Core\IO\IOMetadataHandler.

Definition at line 225 of file Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php.

References eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\addPrefix().

## ◆ getNameTrunk()

eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster::getNameTrunk | ( | SPIBinaryFileCreateStruct | $binaryFileCreateStruct | ) |
| protected

Parameters

  SPIBinaryFileCreateStruct | $binaryFileCreateStruct |

Returns
  mixed

Definition at line 169 of file Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php.

References eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\addPrefix().

Referenced by eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\create().

## ◆ getScope()

eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster::getScope | ( | SPIBinaryFileCreateStruct | $binaryFileCreateStruct | ) |
| protected

Returns the value for the scope meta field, based on the created file's path.

Note that this is slightly incorrect, as it will return binaryfile for media files as well. It is a bit of an issue, but shouldn't be a blocker given that this meta field isn't used that much.

Parameters

  SPIBinaryFileCreateStruct | $binaryFileCreateStruct |

Returns
  string

Definition at line 184 of file Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php.

Referenced by eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\create().

## ◆ load()

eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster::load | ( |  | $spiBinaryFileId | ) |

Loads and returns metadata for $spiBinaryFileId.

Parameters

  string | $spiBinaryFileId |

Returns
  SPIBinaryFile

Exceptions

  BinaryFileNotFoundException | if no row is found for $spiBinaryFileId
  DBALException | Any unhandled DBAL exception

Implements eZ\Publish\Core\IO\IOMetadataHandler.

Definition at line 126 of file Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php.

References eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\addPrefix(), and eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\mapArrayToSPIBinaryFile().

## ◆ mapArrayToSPIBinaryFile()

eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster::mapArrayToSPIBinaryFile | ( | array | $properties | ) |
| protected

Maps an array of data base properties (id, size, mtime, datatype, md5_path, path...) to an SPIBinaryFile object.

Parameters

  array | $properties | database properties array

Returns
  SPIBinaryFile

Definition at line 266 of file Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php.

Referenced by eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\load().

## ◆ mapSPIBinaryFileCreateStructToSPIBinaryFile()

eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster::mapSPIBinaryFileCreateStructToSPIBinaryFile | ( | SPIBinaryFileCreateStruct | $binaryFileCreateStruct | ) |
| protected

Parameters

  SPIBinaryFileCreateStruct | $binaryFileCreateStruct |

Returns
  SPIBinaryFile

Definition at line 282 of file Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php.

Referenced by eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\create().

## ◆ removePrefix()

eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster::removePrefix | ( |  | $prefixedId | ) |
| protected

Removes the internal prefix string from $prefixedId.

Parameters

  string | $prefixedId |

Returns
  string the id without the prefix

Exceptions

  InvalidBinaryFileIdException | if the prefix isn't found in $prefixedId

Definition at line 220 of file Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php.

## Member Data Documentation

## ◆ $db

eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster::$db
| private

Definition at line 30 of file Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php.

## ◆ $urlDecorator

eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster::$urlDecorator
| private

Definition at line 33 of file Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php.

Referenced by eZ\Publish\Core\IO\IOMetadataHandler\LegacyDFSCluster\__construct().

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

- Publish/Core/IO/IOMetadataHandler/LegacyDFSCluster.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.