]> git.ipfire.org Git - thirdparty/cups.git/blob - scripting/php/phpcups.php
Load cups into easysw/current.
[thirdparty/cups.git] / scripting / php / phpcups.php
1 #!/usr/bin/php -f
2 <?
3 //
4 // "$Id: phpcups.php 3603 2003-04-11 18:42:52Z mike $"
5 //
6 // PHP test script for the Common UNIX Printing System (CUPS).
7 //
8 // Copyright 2007 by Apple Inc.
9 // Copyright 1997-2006 by Easy Software Products, all rights reserved.
10 //
11 // These coded instructions, statements, and computer programs are the
12 // property of Apple Inc. and are protected by Federal copyright
13 // law. Distribution and use rights are outlined in the file "LICENSE.txt"
14 // which should have been included with this file. If this file is
15 // file is missing or damaged, see the license at "http://www.cups.org/".
16 //
17
18 // Make sure the module is loaded...
19 if(!extension_loaded("phpcups"))
20 {
21 dl("phpcups.so");
22 }
23
24 // Get the list of functions in the module...
25 $module = "phpcups";
26 $functions = get_extension_funcs($module);
27
28 print("Functions available in the $module extension:\n");
29
30 foreach ($functions as $func)
31 {
32 print("$func\n");
33 }
34
35 print("\n");
36
37 print("cups_get_dests:\n");
38 print_r(cups_get_dests());
39
40 print("cups_get_jobs(\"\", 0, -1):\n");
41 print_r(cups_get_jobs("", 0, -1));
42
43 print("cups_print_file(\"test\", \"../../test/testfile.jpg\", "
44 ."\"testfile.jpg\", ...):\n");
45 print_r(cups_print_file("test", "../../test/testfile.jpg", "testfile.jpg",
46 array("scaling" => "100",
47 "page-label" => "testfile.jpg")));
48
49 print("cups_print_files(\"test\", array(\"../../test/testfile.jpg\", "
50 ."\"../../test/testfile.ps\"), \"testfiles\", ...):\n");
51 print_r(cups_print_files("test", array("../../test/testfile.jpg",
52 "../../test/testfile.ps"),
53 "testfiles",
54 array("scaling" => "100",
55 "page-label" => "testfile.jpg")));
56
57 //
58 // End of "$Id: phpcups.php 3603 2003-04-11 18:42:52Z mike $".
59 //
60 ?>