CsvStreamFilter extends php_user_filter
Inspired by https://csv.thephpleague.com/9.0/interoperability/enclose-field/
A unique sequence is added to relevant CSV field values in order to trigger enclosure in fputcsv. This stream filter is taking care of removing that sequence again when actually writing to stream.
Table of Contents
Constants
- NAME = 'csv.typo3'
Methods
- applyStreamFilter() : Closure
- filter() : int
- Implicitly handles stream filter when writing CSV data - example:
- buildStreamFilterModifier() : Closure
- registerStreamFilter() : mixed
- Registers stream filter
Constants
NAME
protected
mixed
NAME
= 'csv.typo3'
Methods
applyStreamFilter()
public
static applyStreamFilter(resource $stream[, bool $LF = true ]) : Closure
Parameters
- $stream : resource
- $LF : bool = true
-
whether to apply line-feed
Return values
Closurefilter()
Implicitly handles stream filter when writing CSV data - example:
public
filter(resource $in, resource $out, int &$consumed, bool $closing) : int
Parameters
- $in : resource
- $out : resource
- $consumed : int
- $closing : bool
Tags
Return values
intbuildStreamFilterModifier()
protected
static buildStreamFilterModifier(string $sequence) : Closure
Parameters
- $sequence : string
Return values
ClosureregisterStreamFilter()
Registers stream filter
protected
static registerStreamFilter() : mixed