kduma / lpd
LPD Client for PHP
Installs: 1 082
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 8
pkg:composer/kduma/lpd
Requires
- ext-mbstring: *
- ext-sockets: *
This package is auto-updated.
Last update: 2025-10-04 22:01:23 UTC
README
LPD Server and Client for PHP language.
Check full documentation here: opensource.duma.sh/libraries/php/lpd
Install
Via Composer
$ composer require kduma/lpd
Usage
Server
(new KDuma\LPD\Server\Server()) ->setAddress($address) ->setPort($port) ->setMaxConnections($max_connections) ->setHandler(function ($incoming_data, $ctrl) { echo $incoming_data; // Do something with it! }) ->run();
Client
Text print job
For printing clear text use TextJob
class:
$job = new KDuma\LPD\Client\Jobs\TextJob("This is content!"); $job->appdendContent("\n"); $job->appdendContent("And this is second line.");
File print job
For printing files, text or binary, use FileJob
class:
$job = new KDuma\LPD\Client\Jobs\FileJob("my_raw_file.txt");
Print Service
$configuration = new KDuma\LPD\Client\Configuration($address, $queue_name, $port, $timeout); $print_service = new KDuma\LPD\Client\PrintService($configuration); $print_service->sendJob($job);
Original Attribution
This package is based on classes created by Ivan Bozhanov (server, 2013) and Mick Sear (client, 2005).