Commit 3e69f3fcdeb7b2f2fc330f590c90d9b6fcb36ecd

Authored by Perry Werneck
1 parent 3966537f
Exists in master

Corrigindo tratamento dos métodos get & set.

src/main.cc
... ... @@ -40,11 +40,21 @@ static zend_object_handlers tn3270_object_handlers;
40 40  
41 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 52 zend_function_entry tn3270_methods[] =
44 53 {
45 54 PHP_ME( tn3270, __construct, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
46 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 59 PHP_ME( tn3270, getversion, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
50 60 PHP_ME( tn3270, getrevision, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
... ...
src/set.cc
... ... @@ -100,6 +100,10 @@ PHP_METHOD(tn3270, __set)
100 100  
101 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 107 if(!strncasecmp("timeout",text,szText)) {
104 108 obj->hSession->set_timeout(atoi(str.c_str()));
105 109 } else if(!strncasecmp("autoclose",text,szText)) {
... ...
testprograms/service.php
... ... @@ -6,6 +6,9 @@
6 6  
7 7 echo "Sessão: " . $host->name . "\n";
8 8  
  9 + $host->timeout = 60;
  10 + $host->autoclose = 30;
  11 +
9 12 $rc = $host->connect("tn3270://fandezhi.efglobe.com:23",10);
10 13 if($rc != 0) {
11 14 die("Connection failed, rc=" . $rc . "\n");
... ...