]> git.ipfire.org Git - thirdparty/cups.git/blame - scripting/php/README
First pass at a new PHP API for CUPS with the following PHP functions:
[thirdparty/cups.git] / scripting / php / README
CommitLineData
a265ef79 1README - 02/25/2006
7b5c75dd 2-------------------
3
a265ef79 4INTRODUCTION
7b5c75dd 5
a265ef79 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.
7b5c75dd 10
7b5c75dd 11
a265ef79 12COMPILING AND INSTALLING
7b5c75dd 13
a265ef79 14 Run "make" to compile the PHP CUPS extension:
7b5c75dd 15
a265ef79 16 make
7b5c75dd 17
a265ef79 18 To install it, type:
19
20 make install
21
22
23RESOURCES AND SUPPORT
24
25 Questions should be reported to the CUPS newsgroups/mailing
26 lists at:
27
28 http://www.cups.org/newsgroups.php
29
30 Bug reports and enhancement requests can be submitted via the
31 form at:
32
33 http://www.cups.org/str.php
34
35
36QUICK REFERENCE DOCUMENTATION
37
38 In lieu of actual documentation, the following definitions
39 can be used as a quick reference to the supported functions:
40
41
42cups_cancel_job()
43
44 Cancels a job on the named destination:
45
46 $status = cups_cancel_job($dest, $id);
47
48 The return value is TRUE on success and FALSE on failure.
49
50
51cups_get_dests()
52
53 Gets a list of available destinations:
54
55 $dests = cups_get_dests();
56
57 The return value is an array of objects with the following
58 properties:
59
60 name The name of the printer or class
61 instance The instance of the printer or class
62 is_default TRUE if the printer or class is the default destination
63 options Associative array of options and their values
64
65
66cups_get_jobs()
67
68 Gets a list of jobs:
69
70 $jobs = cups_get_jobs("dest", myjobs, completed);
71
72 The "dest" string can be blank for jobs on all destinations.
73 Pass TRUE for "myjobs" to only get jobs for the current user.
74 The "completed" argument can be 0 for pending jobs, 1 for
75 completed jobs, and -1 for all jobs.
76
77 The return value is an array of objects with the following
78 properties:
79
80 id The job ID
81 dest Printer or class name
82 title Title/job name
83 user User the submitted the job
84 format Document format
85 state Job state
86 size Size in kilobytes
87 priority Priority (1-100)
88 completed_time Time the job was completed
89 creation_time Time the job was created
90 processing_time Time the job was processed
91
92
93 cups_last_error()
94
95 Returns the IPP status code for the most recent request:
96
97 $error = cups_last_error();
98
99
100 cups_last_error_string()
101
102 Returns the IPP status-message string for the most recent request:
103
104 $message = cups_last_error_string();
105
106
107 cups_print_file()
108
109 Prints a single file to a printer or class:
110
111 $options = array("name" => "value", "name2" => "value2");
112 $id = cups_print_file("dest", "filename", "title", $options);
113
114 The return value is the job ID or 0 if there was an error.
115
116
117 cups_print_files()
118
119 Prints one or more files to a printer or class:
120
121 $files = array("file1", "file2", "file3");
122 $options = array("name" => "value", "name2" => "value2");
123 $id = cups_print_file("dest", $files, "title", $options);
124
125 The return value is the job ID or 0 if there was an error.
7b5c75dd 126