PHP Class Zebra\Client

Afficher le fichier Open project: robgridley/zebra

Protected Properties

Свойство Type Description
$socket resource The endpoint.

Méthodes publiques

Méthode Description
__construct ( string $host, integer $port = 9100 ) Create an instance.
__destruct ( ) Destroy an instance.
printer ( string $host, integer $port = 9100 ) : self Create an instance statically.
send ( string $zpl ) Send ZPL data to printer.

Méthodes protégées

Méthode Description
connect ( string $host, integer $port ) : boolean Connect to printer.
disconnect ( ) Close connection to printer.
getLastError ( ) : array Get the last socket error.

Method Details

__construct() public méthode

Create an instance.
public __construct ( string $host, integer $port = 9100 )
$host string
$port integer

__destruct() public méthode

Destroy an instance.
public __destruct ( )

connect() protected méthode

Connect to printer.
protected connect ( string $host, integer $port ) : boolean
$host string
$port integer
Résultat boolean

disconnect() protected méthode

Close connection to printer.
protected disconnect ( )

getLastError() protected méthode

Get the last socket error.
protected getLastError ( ) : array
Résultat array

printer() public static méthode

Create an instance statically.
public static printer ( string $host, integer $port = 9100 ) : self
$host string
$port integer
Résultat self

send() public méthode

Send ZPL data to printer.
public send ( string $zpl )
$zpl string

Property Details

$socket protected_oe property

The endpoint.
protected resource $socket
Résultat resource