1#!/usr/bin/php -f
2<?
3//
4//   PHP test script for CUPS.
5//
6//   Copyright 2007-2011 by Apple Inc.
7//   Copyright 1997-2006 by Easy Software Products, all rights reserved.
8//
9//   These coded instructions, statements, and computer programs are the
10//   property of Apple Inc. and are protected by Federal copyright
11//   law.  Distribution and use rights are outlined in the file "COPYING"
12//   which should have been included with this file.
13//
14
15// Make sure the module is loaded...
16if(!extension_loaded("phpcups"))
17{
18  dl("phpcups.so");
19}
20
21// Get the list of functions in the module...
22$module    = "phpcups";
23$functions = get_extension_funcs($module);
24
25print("Functions available in the $module extension:\n");
26
27foreach ($functions as $func)
28{
29  print("$func\n");
30}
31
32print("\n");
33
34print("cups_get_dests:\n");
35print_r(cups_get_dests());
36
37print("cups_get_jobs(\"\", 0, -1):\n");
38print_r(cups_get_jobs("", 0, -1));
39
40print("cups_print_file(\"test\", \"../../test/testfile.jpg\", "
41     ."\"testfile.jpg\", ...):\n");
42print_r(cups_print_file("test", "../../test/testfile.jpg", "testfile.jpg",
43                        array("scaling" => "100",
44			      "page-label" => "testfile.jpg")));
45
46print("cups_print_files(\"test\", array(\"../../test/testfile.jpg\", "
47     ."\"../../test/testfile.ps\"), \"testfiles\", ...):\n");
48print_r(cups_print_files("test", array("../../test/testfile.jpg",
49                                       "../../test/testfile.ps"),
50                         "testfiles",
51                         array("scaling" => "100",
52			       "page-label" => "testfile.jpg")));
53
54?>
55