• R/O
  • SSH
  • HTTPS

copper: Commit


Commit MetaInfo

Revision1607 (tree)
Time2021-01-31 10:04:15
Authormiyabe

Log Message

(empty log message)

Change Summary

Incremental Difference

--- drivers/php/trunk/README.txt (revision 1606)
+++ drivers/php/trunk/README.txt (revision 1607)
@@ -47,7 +47,7 @@
4747 -- v2.1.3
4848 2014/08/11
4949 Session->start_main関数のデフォルトの引数を'.'にしました。
50-画像を標準出力に出力時すると、Cannot modify header information警告が出る問題に対応。
50+画像を標準出力に出力すると、Cannot modify header information警告が出る問題に対応しました。
5151
5252 -- v2.1.2
5353 2013/04/24
--- drivers/php/trunk/build.xml (revision 1606)
+++ drivers/php/trunk/build.xml (revision 1607)
@@ -1,8 +1,8 @@
11 <?xml version="1.0" encoding="UTF-8"?>
22
33 <project default="make">
4- <property name="version" value="2.1.3" />
5- <property name="aversion" value="2_1_3" />
4+ <property name="version" value="2.1.4" />
5+ <property name="aversion" value="2_1_4" />
66 <property name="archive" value="build/cti-php-${aversion}" />
77 <property name="dirname" value="cti-php-${version}" />
88 <property name="encoding" value="UTF-8" />
--- drivers/php/trunk/src/code/CTI/Session.class.php (revision 1606)
+++ drivers/php/trunk/src/code/CTI/Session.class.php (revision 1607)
@@ -33,20 +33,31 @@
3333 * @param $options 接続オプション
3434 */
3535 public function __construct(&$fp, $options = null) {
36- $this->results = new SingleResult(new StreamBuilder());
36+ $this->results = new SingleResult(new StreamBuilder());
3737 $this->fp = &$fp;
38- if (isset($options['encoding'])) {
39- $this->encoding = $options['encoding'];
38+ if (isset($options['encoding'])) {
39+ $this->encoding = $options['encoding'];
40+ }
41+ $user = $password = '';
42+ if (isset($options['user'])) {
43+ $user = $options['user'];
44+ unset($options['user']);
45+ }
46+ if (isset($options['password'])) {
47+ $password = $options['password'];
48+ unset($options['password']);
4049 }
41- $user = $password = '';
42- if (isset($options['user'])) {
43- $user = $options['user'];
44- }
45- if (isset($options['password'])) {
46- $password = $options['password'];
47- }
48- cti_ctip_connect($this->fp, $this->encoding);
49- $data = "PLAIN: $user $password\n";
50+ cti_ctip_connect($this->fp, $this->encoding);
51+ if (empty($options)) {
52+ $data = "PLAIN: $user $password\n";
53+ }
54+ else {
55+ $data = "OPTIONS: user=$user&password=$password";
56+ foreach($options as $k => $v) {
57+ $data .= "&$k=$v";
58+ }
59+ $data .= "\n";
60+ }
5061 _cti_write($this->fp, $data);
5162 $res = _cti_read($this->fp, 4);
5263 if ($res !== "OK \n") {
--- drivers/php/trunk/src/test/cti.li.php (nonexistent)
+++ drivers/php/trunk/src/test/cti.li.php (revision 1607)
@@ -0,0 +1,28 @@
1+<?php
2+require_once ('../code/CTI/DriverManager.php');
3+
4+//セッションの開始
5+$session = cti_get_session('ctip://free.cssj.jp:8499/',
6+ array('user' => 'user',
7+ 'password' => 'kappa',
8+ 'transcoder' => 'li.cti.pdftools.PDFTools'));
9+
10+//ファイル出力
11+$dir = 'out';
12+@mkdir($dir, 0777, true);
13+$session->set_output_as_file('out/cti.li.pdf');
14+
15+$session->property('output.impose', '4up');
16+$session->property('output.paper-width', '297mm');
17+$session->property('output.paper-height', '420mm');
18+$session->property('output.cutting-margin', '3mm');
19+$session->property('output.title', 'test');
20+
21+//文書の送信
22+$session->start_main();
23+readfile('data/test.pdf');
24+$session->end_main();
25+
26+//セッションの終了
27+$session->close();
28+?>
\ No newline at end of file
--- drivers/php/trunk/src/test/server-resource.php (revision 1606)
+++ drivers/php/trunk/src/test/server-resource.php (revision 1607)
@@ -7,7 +7,8 @@
77 'password' => 'kappa'));
88
99 //ファイル出力
10-@mkdir($dir, 0777, 'out');
10+$dir = 'out';
11+@mkdir($dir, 0777, true);
1112 $session->set_output_as_file('out/server-resource.pdf');
1213
1314 //リソースのアクセス許可
Show on old repository browser