PHP Класс Mike42\Escpos\PrintConnectors\CupsPrintConnector

Наследование: implements Mike42\Escpos\PrintConnectors\PrintConnector
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( string $dest ) Construct new CUPS print connector.
__destruct ( ) Cause a NOTICE if deconstructed before the job was printed.
finalize ( ) Send job to printer.
read ( string $len ) : Data Read data from the printer.
write ( string $data )

Защищенные методы

Метод Описание
getCmdOutput ( string $cmd ) Run a command and throw an exception if it fails, or return the output if it works.
getLocalPrinters ( ) : array Load a list of CUPS printers.

Приватные методы

Метод Описание
chopLpstatLine ( string $line ) : string Get the item before the first space in a string

Описание методов

__construct() публичный Метод

Construct new CUPS print connector.
public __construct ( string $dest )
$dest string The CUPS printer name to print to. This must be loaded using a raw driver.

__destruct() публичный Метод

Cause a NOTICE if deconstructed before the job was printed.
public __destruct ( )

finalize() публичный Метод

Send job to printer.
public finalize ( )

getCmdOutput() защищенный Метод

(Basically exec() with good error handling)
protected getCmdOutput ( string $cmd )
$cmd string Command to run

getLocalPrinters() защищенный Метод

Load a list of CUPS printers.
protected getLocalPrinters ( ) : array
Результат array A list of printer names installed on this system. Any item on this list is valid for constructing a printer.

read() публичный Метод

Read data from the printer.
public read ( string $len ) : Data
$len string Length of data to read.
Результат Data read from the printer, or false where reading is not possible.

write() публичный Метод

public write ( string $data )
$data string