コード例 #1
0
ファイル: test_exceptions.php プロジェクト: pigult/php-ipp
// 0 to 4 (less verbose)
$host = "localhost";
$printer = "/printers/Parallel_Port_1";
$port = 631;
$logfile = "/tmp/phpprintipp";
$username = "******";
$password = false;
// set it if you need authentication to print
$handle_http_exceptions = false;
$handle_ipp_exceptions = false;
$mediatype = "text/plain";
/*
END OF SETTINGS
*/
//
$ipp = new BasicIPP();
$ipp->with_exceptions = $handle_ipp_exceptions;
$ipp->handle_http_exceptions = $handle_http_exceptions;
$ipp->setHost($host);
// various tests for ipv6 and SSL you can enable instead
//$ipp->setHost("ip6-localhost");
//$ipp->setHost("127.0.0.1");
//$ipp->setHost("::1");
//$ipp->ssl = 1;
$ipp->setPort($port);
//$ipp->setPort("65537"); // uncomment to generate http error
// set the value to your printer
$ipp->setPrinterURI($printer);
//$ipp->setPrinterURI("/printers/this_one_not_exists"); // uncomment to generate error
$ipp->debug_level = $debug;
// Debugging
コード例 #2
0
ファイル: test_server.php プロジェクト: pigult/php-ipp
$mediatype = "text/plain";
/*
END OF SETTINGS
*/
if ($get_attributes) {
    require_once 'printipp/PrintIPP.php';
} else {
    require_once 'printipp/BasicIPP.php';
}
echo memory_get_usage(false), "\n";
echo memory_get_usage(true), "\n";
//
if ($get_attributes) {
    $ipp = new PrintIPP();
} else {
    $ipp = new BasicIPP();
}
$ipp->with_exceptions = $handle_ipp_exceptions;
$ipp->handle_http_exceptions = $handle_http_exceptions;
$ipp->setHost($host);
if ($paths) {
    $ipp->paths = $paths;
}
$ipp->setLanguage("en-us");
// various tests for ipv6 and SSL you can enable instead
//$ipp->setHost("ip6-localhost");
//$ipp->setHost("127.0.0.1");
//$ipp->setHost("::1");
//$ipp->ssl = 1;
$ipp->setPort($port);
//$ipp->setPort("65537"); // uncomment to generate http error
コード例 #3
0
 public function __construct()
 {
     parent::__construct();
 }