functions.php
Functions
protocol()
protocol(string $protocol) : Protocol
Parameters
- $protocol : string
Return values
Protocolpartition()
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_stdout()
Create a path to php stdout stream.
path_stdout([null|array{'stream': "output"|"stderr"|"stdout"} $options = null ]) : Path
Parameters
- $options : null|array{'stream': "output"|"stderr"|"stdout"} = null
Return values
Pathpath_memory()
Create a path to php memory stream.
path_memory([string $path = '' ][, null|array{'stream': "memory"|"temp"} $options = null ]) : Path
Parameters
- $path : string = ''
-
- default = '' - path is used as an identifier in memory filesystem, so we can write multiple files to memory at once, each path is a new handle
- $options : null|array{'stream': "memory"|"temp"} = null
-
- when nothing is provided, 'temp' stream is used by default
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() : NativeLocalFilesystem
Return values
NativeLocalFilesystemstdout_filesystem()
Write-only filesystem useful when we just want to write the output to stdout.
stdout_filesystem() : StdOutFilesystem
The main use case is for streaming datasets over http.
Return values
StdOutFilesystemmemory_filesystem()
Create a new memory filesystem and writes data to it in memory.
memory_filesystem() : MemoryFilesystem
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)