LocalPhpArrayToJsonFilePreparer

Extends \PhpDruidIngest\Preparer\LocalFilePreparer

Class LocalFilePreparer prepares files locally on the file system.

package

Default

Methods

Clean up a prepared ingestion file.

cleanup() : mixed
inherited

Response

mixed

Convert an array's items to JSON, without affecting the array itself.

convertPhpArrayToJson( $zeArray) : array

Arguments

$zeArray

Array of items to convert

Response

array

Array of JSON strings

Remove a previously written file.

deleteFile(string $filePath) : boolean
inherited
throws

Arguments

$filePath

string

Response

boolean

Combine an array of strings into one string with a delimiter.

delimit(array $data, string $delimiter = "\n") : string
inherited
throws

If $data is not recognized as an array of strings

Arguments

$data

array

$delimiter

string

Response

string

Encode an individual fact.

encodeFactToJson( $fact) : string

(Also a protected function for testability)

Arguments

$fact

Response

string

Get the full path to the locally prepared file.

getPreparedPath() : string
inherited

Response

string

prepare

prepare( $data) 
inherited

Arguments

$data

setFilePath

setFilePath( $path) 
inherited

Arguments

$path

Write the string data out to a file.

writeFile(string $filePath, string $contents) : integer
inherited
throws

$contents

Arguments

$filePath

string

$contents

string

Response

integer

Properties

outputFilename

outputFilename : 
inherited

Type(s)

outputBaseDir

outputBaseDir : 
inherited

Type(s)