Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:974 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32788 invoked from network); 19 Apr 2003 10:51:36 -0000 Received: from unknown (HELO secure.thebrainroom.com) (213.239.42.171) by pb1.pair.com with SMTP; 19 Apr 2003 10:51:36 -0000 Received: from zaneeb.brainnet.i (brain.dial.nildram.co.uk [195.149.29.154]) by secure.thebrainroom.com (8.9.3/8.9.3) with ESMTP id LAA22062; Sat, 19 Apr 2003 11:51:33 +0100 Received: from zaneeb.brainnet.i (IDENT:9ZkWaZLT04KRgEH4hR+0jqCIcBzLhHFD@zaneeb.brainnet.i [127.0.0.1]) by zaneeb.brainnet.i (8.11.6/8.11.6) with ESMTP id h3JApa817657; Sat, 19 Apr 2003 11:51:36 +0100 Date: Sat, 19 Apr 2003 11:51:36 +0100 (BST) X-X-Sender: wez@zaneeb.brainnet.i To: "Marshall A. Greenblatt" cc: internals@lists.php.net In-Reply-To: <001a01c30644$2c0f5150$6501a8c0@Marshall> Message-ID: References: <001a01c30644$2c0f5150$6501a8c0@Marshall> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] Sharing resources between modules From: wez@thebrainroom.com (Wez Furlong) Yes, it is possible; you will need to know the list entry id in advance, so it needs to be exported from one module either as a global variable or as the return value from a function. TSRMLS stuff is used in thread-safe builds as a means to reduce TLS overhead; it will not affect you intended usage. BTW: ZEND_REGISTER_RESOURCE and ZEND_FETCH_RESOURCE macros might make your code slightly easier to write. --Wez. On Sat, 19 Apr 2003, Marshall A. Greenblatt wrote: > Hi guys, a quick question: > > Is it possible for one module to retrieve the resource structure registered > by another module? > > For instance, assume that we have two loaded PHP modules, `php_a.so' and > `php_b.so'. A script calls a PHP function defined in `php_a.so'. That > function creates a structure, calls zend_register_resource(), and returns > the resource ID. That same script then calls a PHP function defined in > `php_b.so' that accepts the resource ID as a parameter. Would it be > possible for the function in `php_b.so' to retrieve the structure associated > with the resource ID registered in `php_a.so'?