Commit 3e69f3fcdeb7b2f2fc330f590c90d9b6fcb36ecd

Authored by Perry Werneck
1 parent 3966537f
Exists in master

Corrigindo tratamento dos métodos get & set.

@@ -40,11 +40,21 @@ static zend_object_handlers tn3270_object_handlers; @@ -40,11 +40,21 @@ static zend_object_handlers tn3270_object_handlers;
40 40
41 /*--[ Implement ]--------------------------------------------------------------------------------------------------*/ 41 /*--[ Implement ]--------------------------------------------------------------------------------------------------*/
42 42
  43 +ZEND_BEGIN_ARG_INFO_EX(get_args, 0, 0, 1)
  44 + ZEND_ARG_INFO(0, value)
  45 +ZEND_END_ARG_INFO()
  46 +
  47 +ZEND_BEGIN_ARG_INFO_EX(set_args, 0, 0, 2)
  48 + ZEND_ARG_INFO(0, name)
  49 + ZEND_ARG_INFO(0, value)
  50 +ZEND_END_ARG_INFO()
  51 +
43 zend_function_entry tn3270_methods[] = 52 zend_function_entry tn3270_methods[] =
44 { 53 {
45 PHP_ME( tn3270, __construct, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) 54 PHP_ME( tn3270, __construct, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
46 PHP_ME( tn3270, __tostring, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) 55 PHP_ME( tn3270, __tostring, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
47 - PHP_ME( tn3270, __get, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) 56 + PHP_ME( tn3270, __get, get_args, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
  57 + PHP_ME( tn3270, __set, set_args, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
48 58
49 PHP_ME( tn3270, getversion, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) 59 PHP_ME( tn3270, getversion, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
50 PHP_ME( tn3270, getrevision, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) 60 PHP_ME( tn3270, getrevision, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
@@ -100,6 +100,10 @@ PHP_METHOD(tn3270, __set) @@ -100,6 +100,10 @@ PHP_METHOD(tn3270, __set)
100 100
101 str = string(text,szText); 101 str = string(text,szText);
102 102
  103 +#ifdef DEBUG
  104 + fprintf(stderr,"%s=%s\n",string(name,szName).c_str(),str.c_str());
  105 +#endif // DEBUG
  106 +
103 if(!strncasecmp("timeout",text,szText)) { 107 if(!strncasecmp("timeout",text,szText)) {
104 obj->hSession->set_timeout(atoi(str.c_str())); 108 obj->hSession->set_timeout(atoi(str.c_str()));
105 } else if(!strncasecmp("autoclose",text,szText)) { 109 } else if(!strncasecmp("autoclose",text,szText)) {
testprograms/service.php
@@ -6,6 +6,9 @@ @@ -6,6 +6,9 @@
6 6
7 echo "Sessão: " . $host->name . "\n"; 7 echo "Sessão: " . $host->name . "\n";
8 8
  9 + $host->timeout = 60;
  10 + $host->autoclose = 30;
  11 +
9 $rc = $host->connect("tn3270://fandezhi.efglobe.com:23",10); 12 $rc = $host->connect("tn3270://fandezhi.efglobe.com:23",10);
10 if($rc != 0) { 13 if($rc != 0) {
11 die("Connection failed, rc=" . $rc . "\n"); 14 die("Connection failed, rc=" . $rc . "\n");