Documentation Index
Fetch the complete documentation index at: https://docs.fiquela.io/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Namespace:FQL\Stream
Stream\Provider opens a data file or an in-memory string and returns a stream object. Each stream implements Interface\Stream and exposes a query() method that returns a Query ready to run against that stream.
You rarely need to call stream classes directly — Query\Provider::fromFile() wraps Stream\Provider automatically. Use Stream\Provider directly when you need to configure the stream (e.g. set a custom CSV delimiter) before building a query.
Stream\Provider static methods
fromFile()
Open a file and return the matching stream object. The format is detected from the file extension unless $format is provided.
Absolute or relative path to the data file.
Override the auto-detected format.
A concrete stream instance (e.g.
Json, Csv, Xml).FileNotFoundException, InvalidFormatException
fromString()
Create a stream from an in-memory string. Supported formats: JSON, YAML, NEON.
The raw string content to parse.
The format of the string content. Must be
Format::JSON, Format::YAML, or Format::NEON.A stream wrapping the parsed string.
InvalidFormatException for unsupported formats (e.g. XML, CSV).
Stream classes
Each stream class can also be instantiated directly via its staticopen() method. After obtaining a stream instance, call ->query() to get a Query.
Xml
Class: FQL\Stream\XmlFormats:
.xml
Json
Class: FQL\Stream\JsonFormats:
.json (full in-memory parse)
JsonStream for large files.
JsonStream
Class: FQL\Stream\JsonStreamFormats:
.json (streaming, lazy)
NDJson
Class: FQL\Stream\NDJsonFormats:
.ndjson (Newline Delimited JSON)
Csv
Class: FQL\Stream\CsvFormats:
.csv, .tsv
Path to the CSV file.
fgetcsv (no third-party dependency) and accepts the parameters listed below. Defaults are applied when a parameter is omitted.
| Parameter | Default | Description |
|---|---|---|
encoding | utf-8 | Source encoding. Non-UTF-8 input is transcoded via a convert.iconv.<src>/UTF-8 stream filter. |
delimiter | , | Single-character field delimiter. |
enclosure | " | Single-character field enclosure. |
useHeader | 1 | When 1, the first row is treated as field names. When 0, rows are emitted as numerically-indexed arrays. |
bom | 0 | When 1, the writer emits a UTF-8 BOM. The reader auto-detects UTF-8 / UTF-16 LE/BE / UTF-32 LE/BE BOMs regardless of this flag. |
openWithDelimiter(). For full control over encoding, enclosure, header handling, and BOM, use a FileQuery string.
Yaml
Class: FQL\Stream\YamlFormats:
.yaml, .yml
Neon
Class: FQL\Stream\NeonFormats:
.neon
Xls
Class: FQL\Stream\XlsFormats:
.xlsx
.xlsx format (Office Open XML) is supported. Legacy .xls (Excel 97–2003 binary format) is no longer supported — convert old files to .xlsx first.
Ods
Class: FQL\Stream\OdsFormats:
.ods
AccessLog
Class: FQL\Stream\AccessLogFormats:
.log
log_format pattern.
setFormat(string $format): void — Sets the active log profile. Accepts nginx_combined (default), nginx_main, apache_combined, apache_common, or custom (requires a setPattern() call).
setPattern(string $pattern): void — Sets a custom Apache log_format pattern. Only effective when the format is custom.
Predefined profiles:
| Profile | Pattern |
|---|---|
nginx_combined | %h - %u [%t] "%r" %>s %b "%{Referer}i" "%{User-Agent}i" (default) |
nginx_main | %h - %u [%t] "%r" %>s %b |
apache_combined | %h %l %u [%t] "%r" %>s %b "%{Referer}i" "%{User-Agent}i" |
apache_common | %h %l %u [%t] "%r" %>s %b |
| Field | Type | Description |
|---|---|---|
_raw | string | Original unparsed log line |
_error | string | null | null on success, error message on parse failure |
AccessLog does not support string() — only file-based input via open(). Malformed log lines produce a row with the _error field set instead of throwing an exception.Dir
Class: FQL\Stream\DirFormats:
dir
query() method
All stream classes inherit query() from AbstractStream.
Query bound to this stream. See the Query\Provider reference for the full fluent API.