Flow PHP

functions.php

Functions

path()

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
Path

path_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
Path

stdout_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
StdOutFilesystem

memory_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
MemoryFilesystem

filesystem_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
FilesystemTelemetryOptions

file_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
Copy

file_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
Move

operation_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)

Return values
OperationOptions

        
On this page

Search results