functions.php
Functions
mount()
mount(string $protocol) : Mount
Parameters
- $protocol : string
Return values
Mountpartition()
partition(string $name, string $value) : Partition
Parameters
- $name : string
- $value : string
Return values
Partitionpartitions()
partitions(Partition ...$partition) : Partitions
Parameters
- $partition : Partition
Return values
Partitionspath()
Path supports glob patterns.
path(string $path[, array<string, null|bool|float|int|string|UnitEnum>|Options $options = [] ]) : Path
Examples:
- path('*.csv') - any csv file in current directory
- path('/** / *.csv') - any csv file in any subdirectory (remove empty spaces)
- path('/dir/partition=* /*.parquet') - any parquet file in given partition directory.
Glob pattern is also supported by remote filesystems like Azure
- path('azure-blob://directory/*.csv') - any csv file in given directory
Parameters
- $path : string
- $options : array<string, null|bool|float|int|string|UnitEnum>|Options = []
Return values
Pathpath_real()
Resolve real path from given path.
path_real(string $path[, array<string, null|bool|float|int|string|UnitEnum> $options = [] ]) : Path
Parameters
- $path : string
- $options : array<string, null|bool|float|int|string|UnitEnum> = []
Return values
Pathnative_local_filesystem()
native_local_filesystem([string $protocol = 'file' ]) : NativeLocalFilesystem
Parameters
- $protocol : string = 'file'
Return values
NativeLocalFilesystemstdout_filesystem()
Write-only filesystem useful when we just want to write the output to stdout.
stdout_filesystem([string $protocol = 'stdout' ]) : StdOutFilesystem
The main use case is for streaming datasets over http.
Parameters
- $protocol : string = 'stdout'
Return values
StdOutFilesystemmemory_filesystem()
Create a new memory filesystem and writes data to it in memory.
memory_filesystem([string $protocol = 'memory' ]) : MemoryFilesystem
Parameters
- $protocol : string = 'memory'
Return values
MemoryFilesystemfstab()
Create a new filesystem table with given filesystems.
fstab(Filesystem ...$filesystems) : FilesystemTable
Filesystems can be also mounted later. If no filesystems are provided, local filesystem is mounted.
Parameters
- $filesystems : Filesystem
Return values
FilesystemTabletraceable_filesystem()
Wrap a filesystem with telemetry tracing support.
traceable_filesystem(Filesystem $filesystem, FilesystemTelemetryConfig $telemetryConfig) : TraceableFilesystem
All filesystem and stream operations will be traced according to the configuration.
Parameters
- $filesystem : Filesystem
- $telemetryConfig : FilesystemTelemetryConfig
Return values
TraceableFilesystemfilesystem_telemetry_config()
Create a telemetry configuration for the filesystem.
filesystem_telemetry_config(Telemetry $telemetry, ClockInterface $clock[, FilesystemTelemetryOptions|null $options = null ]) : FilesystemTelemetryConfig
Parameters
- $telemetry : Telemetry
- $clock : ClockInterface
- $options : FilesystemTelemetryOptions|null = null
Return values
FilesystemTelemetryConfigfilesystem_telemetry_options()
Create options for filesystem telemetry.
filesystem_telemetry_options([bool $traceStreams = true ][, bool $collectMetrics = true ]) : FilesystemTelemetryOptions
Parameters
- $traceStreams : bool = true
-
Create a single span per stream lifecycle (default: ON)
- $collectMetrics : bool = true
-
Collect metrics for bytes/operation counts (default: ON)
Return values
FilesystemTelemetryOptionsfile_copy()
Copy a file from one path to another, across any filesystems mounted in the table.
file_copy(FilesystemTable $table[, OperationOptions|null $options = null ]) : Copy
Always streams bytes; same-filesystem copies do not use server-side optimizations
because Filesystem::mv is a move, not a copy.
Parameters
- $table : FilesystemTable
- $options : OperationOptions|null = null
Return values
Copyfile_move()
Move a file from one path to another, across any filesystems mounted in the table.
file_move(FilesystemTable $table[, OperationOptions|null $options = null ]) : Move
Intra-filesystem moves delegate to Filesystem::mv for server-side optimizations;
cross-filesystem moves stream-copy then remove the source (non-atomic).
Parameters
- $table : FilesystemTable
- $options : OperationOptions|null = null
Return values
Moveoperation_options()
Options shared by filesystem operations.
operation_options([int $chunkSize = 8192 ]) : OperationOptions
Parameters
- $chunkSize : int = 8192
-
Number of bytes read/written per iteration when streaming across filesystems (default: 8192)