Documentation

CRM_Utils_ConsoleTee
in package

Capture the output from the console, copy it to a file, and pass it on.

$tee = CRM_Utils_ConsoleTee::create()->start();
echo "hello world";
$tee->stop();
assertEquals("hello world", file_get_contents($tee->getFileName()));

Loosely speaking, it serves a similar purpose to Unix tee.

Tags
link
https://en.wikipedia.org/wiki/Tee_(command)

Table of Contents

Properties

$fh  : resource
$fileName  : string

Methods

__construct()  : mixed
CRM_Utils_ConsoleTee constructor.
create()  : CRM_Utils_ConsoleTee
Capture console output and copy to a temp file.
getFileName()  : string
onOutput()  : bool
Process a snippet of data from the output buffer.
start()  : CRM_Utils_ConsoleTee
Start capturing console output and copying it to a file.
stop()  : CRM_Utils_ConsoleTee
Stop capturing console output.

Properties

Methods

__construct()

CRM_Utils_ConsoleTee constructor.

public __construct(string $fileName) : mixed
Parameters
$fileName : string

The full path of the file to write to.

getFileName()

public getFileName() : string
Return values
string

onOutput()

Process a snippet of data from the output buffer.

public onOutput(string $buf) : bool
Parameters
$buf : string
Tags
see
ob_start
Return values
bool

        
On this page

Search results