Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
eZDFSFileHandlerDFSBackend Class Reference
Inheritance diagram for eZDFSFileHandlerDFSBackend:

## Public Member Functions
| __construct ()
| supports ( $path)
| copyFromDFSToDFS ( $srcFilePath, $dstFilePath)
| copyFromDFS ( $srcFilePath, $dstFilePath=false)
| copyToDFS ( $srcFilePath, $dstFilePath=false)
| delete ( $filePath)
| passthrough ( $filePath, $startOffset=0, $length=false)
| getContents ( $filePath)
| createFileOnDFS ( $filePath, $contents)
| renameOnDFS ( $oldPath, $newPath)
| existsOnDFS ( $filePath)
| getDfsFileSize ( $filePath)
| getFilesList ( $basePath)
| applyServerUri ( $filePath)

## Protected Member Functions
| getMountPoint ()
| makeDFSPath ( $filePath)
| accumulatorStart ()
| accumulatorStop ()
| fixPermissions ( $filePath)
| copyTimestamp ( $srcFilePath, $dstFilePath)
| createFile ( $filePath, $contents, $atomic=true)

## Protected Attributes
| $mountPointPath

## Private Attributes
| $filePermissionMask

## Detailed Description

Definition at line 12 of file dfs.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZDFSFileHandlerDFSBackend::__construct | ( |  | ) |

Definition at line 14 of file dfs.php.

References $mountPointPath.

## Member Function Documentation

## ◆ accumulatorStart()

eZDFSFileHandlerDFSBackend::accumulatorStart | ( |  | ) |
| protected

Definition at line 324 of file dfs.php.

References eZDebug\accumulatorStart().

Referenced by copyFromDFS(), copyFromDFSToDFS(), copyToDFS(), createFileOnDFS(), delete(), getContents(), and renameOnDFS().

## ◆ accumulatorStop()

eZDFSFileHandlerDFSBackend::accumulatorStop | ( |  | ) |
| protected

Definition at line 329 of file dfs.php.

References eZDebug\accumulatorStop().

Referenced by copyFromDFS(), copyFromDFSToDFS(), copyToDFS(), createFileOnDFS(), delete(), getContents(), and renameOnDFS().

## ◆ applyServerUri()

eZDFSFileHandlerDFSBackend::applyServerUri | ( |  | $filePath | ) |

No transformation is required since files are served from the same host

Implements eZDFSFileHandlerDFSBackendInterface.

Definition at line 406 of file dfs.php.

References $filePath.

## ◆ copyFromDFS()

eZDFSFileHandlerDFSBackend::copyFromDFS | ( |  | $srcFilePath,
|  |  | $dstFilePath = `false`
| ) |  |

Copies the DFS file $srcFilePath to FS

Parameters

  string | $srcFilePath | Source file path (on DFS)
  string | $dstFilePath | Destination file path (on FS). If not specified, $srcFilePath is used

Returns
  bool

Implements eZDFSFileHandlerDFSBackendInterface.

Definition at line 78 of file dfs.php.

References $ret, accumulatorStart(), accumulatorStop(), copyTimestamp(), createFile(), file_exists(), fixPermissions(), and makeDFSPath().

## ◆ copyFromDFSToDFS()

eZDFSFileHandlerDFSBackend::copyFromDFSToDFS | ( |  | $srcFilePath,
|  |  | $dstFilePath
| ) |  |

Creates a copy of $srcFilePath from DFS to $dstFilePath on DFS

Parameters

  string | $srcFilePath | Local source file path
  string | $dstFilePath | Local destination file path

Returns
  bool

Implements eZDFSFileHandlerDFSBackendInterface.

Definition at line 48 of file dfs.php.

References $ret, accumulatorStart(), accumulatorStop(), createFile(), file_exists(), fixPermissions(), and makeDFSPath().

## ◆ copyTimestamp()

eZDFSFileHandlerDFSBackend::copyTimestamp | ( |  | $srcFilePath,
|  |  | $dstFilePath
| ) |  |
| protected

copies the timestamp from the original file to the destination file

Parameters

  string | $srcFilePath |
  string | $dstFilePath |

Returns
  bool False if the timestamp is not set with success on target file

Definition at line 345 of file dfs.php.

Referenced by copyFromDFS().

## ◆ copyToDFS()

eZDFSFileHandlerDFSBackend::copyToDFS | ( |  | $srcFilePath,
|  |  | $dstFilePath = `false`
| ) |  |

Copies the local file $filePath to DFS under the same name, or a new name if specified

Parameters

  string | $srcFilePath | Local file path to copy from
  bool | string | $dstFilePath | Optional path to copy to. If not specified, $srcFilePath is used

Returns
  bool

Implements eZDFSFileHandlerDFSBackendInterface.

Definition at line 123 of file dfs.php.

References $ret, accumulatorStart(), accumulatorStop(), createFile(), makeDFSPath(), and eZDebug\writeError().

## ◆ createFile()

eZDFSFileHandlerDFSBackend::createFile | ( |  | $filePath,
|  |  | $contents,
|  |  | $atomic = `true`
| ) |  |
| protected

Definition at line 357 of file dfs.php.

References $contents, $filePath, eZFile\create(), and fixPermissions().

Referenced by copyFromDFS(), copyFromDFSToDFS(), copyToDFS(), and createFileOnDFS().

## ◆ createFileOnDFS()

eZDFSFileHandlerDFSBackend::createFileOnDFS | ( |  | $filePath,
|  |  | $contents
| ) |  |

Creates the file $filePath on DFS with content $contents

Parameters

  string | $filePath |
  binary | $contents |

Returns
  bool

Implements eZDFSFileHandlerDFSBackendInterface.

Definition at line 244 of file dfs.php.

References $contents, $filePath, $ret, accumulatorStart(), accumulatorStop(), createFile(), and makeDFSPath().

## ◆ delete()

eZDFSFileHandlerDFSBackend::delete | ( |  | $filePath | ) |

Deletes one or more files from DFS

Parameters

  string | array | $filePath | Single local filename, or array of local filenames

Returns
  bool true if deletion was successful, false otherwise

Todo:
  Improve error handling using exceptions

Implements eZDFSFileHandlerDFSBackendInterface.

Definition at line 168 of file dfs.php.

References $file, $filePath, $ret, accumulatorStart(), accumulatorStop(), eZClusterFileHandler\cleanupEmptyDirectories(), and makeDFSPath().

## ◆ existsOnDFS()

eZDFSFileHandlerDFSBackend::existsOnDFS | ( |  | $filePath | ) |

Checks if a file exists on the DFS

Parameters

  string | $filePath |

Returns
  bool

Implements eZDFSFileHandlerDFSBackendInterface.

Definition at line 286 of file dfs.php.

References $filePath, file_exists(), getMountPoint(), and makeDFSPath().

## ◆ fixPermissions()

eZDFSFileHandlerDFSBackend::fixPermissions | ( |  | $filePath | ) |
| protected

Definition at line 334 of file dfs.php.

References $filePath.

Referenced by copyFromDFS(), copyFromDFSToDFS(), and createFile().

## ◆ getContents()

eZDFSFileHandlerDFSBackend::getContents | ( |  | $filePath | ) |

Returns the binary content of $filePath from DFS

Parameters

  string | $filePath | local file path

Returns
  binary|bool file's content, or false

Todo:
  Handle errors using exceptions

Implements eZDFSFileHandlerDFSBackendInterface.

Definition at line 223 of file dfs.php.

References $filePath, $ret, accumulatorStart(), accumulatorStop(), and makeDFSPath().

## ◆ getDfsFileSize()

eZDFSFileHandlerDFSBackend::getDfsFileSize | ( |  | $filePath | ) |

Returns size of a file in the DFS backend, from a relative path.

Parameters

  string | $filePath | The relative file path we want to get size of

Returns
  int

Implements eZDFSFileHandlerDFSBackendInterface.

Definition at line 377 of file dfs.php.

References $filePath, and makeDFSPath().

## ◆ getFilesList()

eZDFSFileHandlerDFSBackend::getFilesList | ( |  | $basePath | ) |

Returns an iterator over the files within $basePath on the backend

Parameters

  string | $basePath | a path relative to the mount point

Returns
  Iterator An iterator that returns a DFS File pathname as the value

Implements eZDFSFileHandlerDFSBackendInterface.

Definition at line 389 of file dfs.php.

## ◆ getMountPoint()

eZDFSFileHandlerDFSBackend::getMountPoint | ( |  | ) |
| protected

Returns the mount point

Returns
  string

Definition at line 309 of file dfs.php.

References $mountPointPath.

Referenced by existsOnDFS().

## ◆ makeDFSPath()

eZDFSFileHandlerDFSBackend::makeDFSPath | ( |  | $filePath | ) |
| protected

Computes the DFS file path based on a relative file path

Parameters

  string | $filePath |

Returns
  string the absolute DFS file path

Definition at line 319 of file dfs.php.

References $filePath.

Referenced by copyFromDFS(), copyFromDFSToDFS(), copyToDFS(), createFileOnDFS(), delete(), existsOnDFS(), getContents(), getDfsFileSize(), passthrough(), and renameOnDFS().

## ◆ passthrough()

eZDFSFileHandlerDFSBackend::passthrough | ( |  | $filePath,
|  |  | $startOffset = `0`,
|  |  | $length = `false`
| ) |  |

Sends the contents of $filePath to default output

Parameters

  string | $filePath | File path
  int | $startOffset | Starting offset
  bool | int | $length | Length to transmit, false means everything

Returns
  bool true, or false if operation failed

Implements eZDFSFileHandlerDFSBackendInterface.

Definition at line 207 of file dfs.php.

References $filePath, eZFile\downloadContent(), and makeDFSPath().

## ◆ renameOnDFS()

eZDFSFileHandlerDFSBackend::renameOnDFS | ( |  | $oldPath,
|  |  | $newPath
| ) |  |

Renamed DFS file $oldPath to DFS file $newPath

Parameters

  string | $oldPath |
  string | $newPath |

Returns
  bool

Implements eZDFSFileHandlerDFSBackendInterface.

Definition at line 263 of file dfs.php.

References $ret, accumulatorStart(), accumulatorStop(), eZClusterFileHandler\cleanupEmptyDirectories(), makeDFSPath(), and eZFile\rename().

## ◆ supports()

eZDFSFileHandlerDFSBackend::supports | ( |  | $path | ) |

The legacy handler supports any type of file

Definition at line 35 of file dfs.php.

## Member Data Documentation

## ◆ $filePermissionMask

eZDFSFileHandlerDFSBackend::$filePermissionMask
| private

Definition at line 421 of file dfs.php.

## ◆ $mountPointPath

eZDFSFileHandlerDFSBackend::$mountPointPath
| protected

Definition at line 415 of file dfs.php.

Referenced by __construct(), and getMountPoint().

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

- dfs.php

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