A text file generated from multiple chunks.

A chunked file is a \FeaturePhp\File\TextFile generated by a \FeaturePhp\Generator\ChunkGenerator. It contains some chunks of text in an undefined order. Optionally, a header and a footer can be provided.

package Default
inherited_from \FeaturePhp\File\TextFile

 Methods

Creates a chunked file.

__construct(string $fileTarget, string $header = "", string $footer = "", boolean $newline = true
inherited_from \FeaturePhp\File\TextFile::__construct()

Parameters

$fileTarget

string

$header

string

$footer

string

$newline

boolean

Creates a file.

__construct(string $fileTarget) 
Inherited

Parameters

$fileTarget

string

Appends text content to the file.

append(string $content) 
Inherited

Parameters

$content

string

Adds a chunk to the chunked file.

extend(\FeaturePhp\Specification\ChunkSpecification $chunkSpecification) : array<mixed,\FeaturePhp\Place\Place>

This is expected to be called only be a \FeaturePhp\Generator\ChunkGenerator. Only uses the text of the chunk specification.

inherited_from \FeaturePhp\File\ExtendFile::extend()

Parameters

$chunkSpecification

\FeaturePhp\Specification\ChunkSpecification

Returns

array<mixed,\FeaturePhp\Place\Place>

Creates a chunked file from a chunk specification.

fromSpecification(\FeaturePhp\Specification\ChunkSpecification $chunkSpecification) : \FeaturePhp\File\ChunkFile
Static

Parameters

$chunkSpecification

\FeaturePhp\Specification\ChunkSpecification

Returns

\FeaturePhp\File\ChunkFile

Returns the chunked file's content.

getContent() : \FeaturePhp\File\TextFileContent

The content consists of the header, then every chunk and then the footer.

inherited_from \FeaturePhp\File\TextFile::getContent()

Returns

\FeaturePhp\File\TextFileContent

Returns the file's content.

getContent() : \FeaturePhp\File\FileContent
Inherited

Returns

\FeaturePhp\File\FileContent

Returns the file's target.

getTarget() : string
Inherited

Returns

string

 Properties

 

the content as text (usually UTF-8)

$content : string

Default

 

the file target in the generated product

$fileTarget : string

Default

   

optional header before all chunks

$header : string

Default

 

whether to include new line characters after the header, footer and each chunk

$newline : boolean

Default