Flow PHP

functions.php

Functions

path()

Path supports glob patterns.

path(string $path[, array<string, mixed> $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, mixed> = []
Return values
Path

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

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

path_real()

Resolve real path from given path.

path_real(string $path[, array<string, mixed> $options = [] ]) : Path
Parameters
$path : string
$options : array<string, mixed> = []
Return values
Path

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

        
On this page

Search results