6 This directory contains a dynamically loadable CUPS extension
7 module for PHP 4 and 5. The CUPS 1.2 module has been
8 substantially updated to provide an API more consistent with
9 the C API and is NOT compatible with the CUPS 1.1 module.
12 COMPILING AND INSTALLING
14 Run "make" to compile the PHP CUPS extension:
25 Questions should be reported to the CUPS newsgroups/mailing
28 http://www.cups.org/newsgroups.php
30 Bug reports and enhancement requests can be submitted via the
33 http://www.cups.org/str.php
36 QUICK REFERENCE DOCUMENTATION
38 In lieu of actual documentation, the following definitions
39 can be used as a quick reference to the supported functions:
44 Cancels a job on the named destination:
46 bool cups_cancel_job(string dest, int id)
48 The return value is TRUE on success and FALSE on failure.
52 if (!cups_cancel_job("myprinter", 123))
53 print("Unable to cancel job: " . cups_last_error_string() . "\n");
58 Gets a list of available destinations:
60 array cups_get_dests()
62 The return value is an array of objects with the following
65 name The name of the printer or class
66 instance The instance of the printer or class
67 is_default TRUE if the printer or class is the default destination
68 options Associative array of options and their values
72 $dest = cups_get_dests();
79 array cups_get_jobs(string dest, bool myjobs, int completed)
81 The "dest" string can be blank for jobs on all destinations.
82 Pass TRUE for "myjobs" to only get jobs for the current user.
83 The "completed" argument can be 0 for pending jobs, 1 for
84 completed jobs, and -1 for all jobs.
86 The return value is an array of objects with the following
90 dest Printer or class name
92 user User the submitted the job
93 format Document format
95 size Size in kilobytes
96 priority Priority (1-100)
97 completed_time Time the job was completed
98 creation_time Time the job was created
99 processing_time Time the job was processed
103 $jobs = cups_get_jobs("", FALSE, -1);
108 Returns the IPP status code for the most recent request:
110 int cups_last_error()
114 $error = cups_last_error();
117 CUPS_LAST_ERROR_STRING
119 Returns the IPP status-message string for the most recent request:
121 string cups_last_error_string()
125 $message = cups_last_error_string();
130 Prints a single file to a printer or class:
132 int cups_print_file(string dest, string filename, string title,
135 The return value is the job ID or 0 if there was an error.
139 $options = array("name" => "value", "name2" => "value2");
140 $id = cups_print_file("dest", "filename", "title", $options);
145 Prints one or more files to a printer or class:
147 int cups_print_files(string dest, array files, string title,
150 The return value is the job ID or 0 if there was an error.
154 $files = array("file1", "file2", "file3");
155 $options = array("name" => "value", "name2" => "value2");
156 $id = cups_print_file("dest", $files, "title", $options);