Hi,
I'm writing an extension PHP 4.06, VC++6 and doing OO syntax overloading and
ZTS
I'm using a global struct that is defined as ZTS global
typedef struct {
HashTable *array_dl_handle;
HashTable *array_compiler;
} php_delphi_globals;
I'm using a ressource. This ressource is created as :
...
typedef struct {
void * handle;
CREATEOBJECT GetObject;
GETCOMPILER GetCompiler;
DESTROYOBJECT DestroyObject;
char *module_name;
} php_delphi_user;
...
le_pdu = zend_register_list_destructors_ex(NULL, NULL, "delphi_pdu",
module_number);
...
This ressource once created is added to the global Hashtable
array_dl_handle:
pdu = emalloc(sizeof(php_delphi_user));
MAKE_STD_ZVAL(pdu_handle);
ZVAL_LONG(pdu_handle, zend_list_insert(pdu, le_pdu));
zend_hash_add(DG(array_dl_handle)
,module_name,strlen(module_name),&pdu_handle,sizeof(zval *),NULL);
On first request everything goes fine. I can access my ressource.
On second request with the same script, when I do
if (zend_hash_find(DG(array_dl_handle), module_name,strlen(module_name),
(void **)&value) == SUCCESS) {
pdu = zend_list_find((*value)->value.lval, &type) ;
}
, pdu is false.
Does ressources survive between requests ?
Is it mandatory to use the ressource feature to create structures ?
What am I doing wrong ?
Thank's
Gilles
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]