Re: Linking and autoloading of dependent extensions
| From: | Michael Wallner | Date: | Tue, 27 May 2014 13:29:22 +0000 |
| Subject: | Re: Linking and autoloading of dependent extensions | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-74520@lists.php.net to get a copy of this message | ||
On 27 05 2014, at 14:32, Johannes Schlüter <johannes@schlueters.de> wrote:
> On Tue, 2014-05-27 at 14:13 +0200, Michael Wallner wrote:
>> I've prepared a tiny POC which enables linking and autoloading of
>> dependent extensions:
>> https://github.com/m6w6/php-src/compare/module_deps
>>
>> Anybody else other than me interested in this feature?
>
> This is a problem hurting me for a while and I'm happy you're looking
> into it! I'm not sure about the solution here, though. This solution
> assumes
>
> * the extension is inside extension_dir and
> * a specific naming scheme on the extension's shared library file.
>
> Both assumptions might be wrong and might lead to loading the wrong file
> when different ones are around. This will also lead to a misleading
> error message ("PHP Warning: Module 'foo' already loaded in Unknown on
> line 0") where the users just tries to load it once in wrong order.
Thanks Johannes, as always you’ve got a bigger picture than I have!
The warning should be easy to mitigate except for multiple extension INI entries; not sure if this
is that important, though.
The second problem is a bit harder, except for source distribution installations where EXTENSION_DIR
should be fine and PECL installs where I could use INI’s extension_dir.
For relocated extension_dirs like Linux dist packages, this might indeed be a problem.
Thank you,
Mike