Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
README | D | 12-May-2024 | 3.7 KiB | 155 | 87 | |
phpcups.c | D | 12-May-2024 | 15.2 KiB | 481 | 320 | |
phpcups.h | D | 12-May-2024 | 1.3 KiB | 61 | 31 | |
phpcups.php | D | 12-May-2024 | 1.5 KiB | 55 | 31 |
README
1README - 02/25/2006 2------------------- 3 4INTRODUCTION 5 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. 10 11 12COMPILING AND INSTALLING 13 14 Run "make" to compile the PHP CUPS extension: 15 16 make 17 18 To install it, type: 19 20 make install 21 22 23BUG REPORTS 24 25 Bug reports and enhancement requests can be submitted via the 26 form at: 27 28 https://bugs.linuxfoundation.org/ 29 30 Use "OpenPrinting" as product and "cups-filters" as component. 31 32 33QUICK REFERENCE DOCUMENTATION 34 35 In lieu of actual documentation, the following definitions 36 can be used as a quick reference to the supported functions: 37 38 39 CUPS_CANCEL_JOB 40 41 Cancels a job on the named destination: 42 43 bool cups_cancel_job(string dest, int id) 44 45 The return value is TRUE on success and FALSE on failure. 46 47 Example: 48 49 if (!cups_cancel_job("myprinter", 123)) 50 print("Unable to cancel job: " . cups_last_error_string() . "\n"); 51 52 53 CUPS_GET_DESTS 54 55 Gets a list of available destinations: 56 57 array cups_get_dests() 58 59 The return value is an array of objects with the following 60 properties: 61 62 name The name of the printer or class 63 instance The instance of the printer or class 64 is_default TRUE if the printer or class is the default destination 65 options Associative array of options and their values 66 67 Example: 68 69 $dest = cups_get_dests(); 70 71 72 CUPS_GET_JOBS 73 74 Gets a list of jobs: 75 76 array cups_get_jobs(string dest, bool myjobs, int completed) 77 78 The "dest" string can be blank for jobs on all destinations. 79 Pass TRUE for "myjobs" to only get jobs for the current user. 80 The "completed" argument can be 0 for pending jobs, 1 for 81 completed jobs, and -1 for all jobs. 82 83 The return value is an array of objects with the following 84 properties: 85 86 id The job ID 87 dest Printer or class name 88 title Title/job name 89 user User the submitted the job 90 format Document format 91 state Job state 92 size Size in kilobytes 93 priority Priority (1-100) 94 completed_time Time the job was completed 95 creation_time Time the job was created 96 processing_time Time the job was processed 97 98 Example: 99 100 $jobs = cups_get_jobs("", FALSE, -1); 101 102 103 CUPS_LAST_ERROR 104 105 Returns the IPP status code for the most recent request: 106 107 int cups_last_error() 108 109 Example: 110 111 $error = cups_last_error(); 112 113 114 CUPS_LAST_ERROR_STRING 115 116 Returns the IPP status-message string for the most recent request: 117 118 string cups_last_error_string() 119 120 Example: 121 122 $message = cups_last_error_string(); 123 124 125 CUPS_PRINT_FILE 126 127 Prints a single file to a printer or class: 128 129 int cups_print_file(string dest, string filename, string title, 130 array options) 131 132 The return value is the job ID or 0 if there was an error. 133 134 Example: 135 136 $options = array("name" => "value", "name2" => "value2"); 137 $id = cups_print_file("dest", "filename", "title", $options); 138 139 140 CUPS_PRINT_FILES 141 142 Prints one or more files to a printer or class: 143 144 int cups_print_files(string dest, array files, string title, 145 array options); 146 147 The return value is the job ID or 0 if there was an error. 148 149 Example: 150 151 $files = array("file1", "file2", "file3"); 152 $options = array("name" => "value", "name2" => "value2"); 153 $id = cups_print_file("dest", $files, "title", $options); 154 155