I want to reopen this issue again.

I think dl is an extremely important feature, and issues surrounding it
should be fixed.  I've looked at the code, gone over email list
archives, cvs commits and comments, and even actually thought a little
about it. :)  So here is a quick outline of needs and issues.  Most
reasons are from a single thread on the issue last fall.  I've thrown a
few of my own items in also.  Archive of the most pertinent thread on
the issue is at
http://aspn.activestate.com/ASPN/Mail/Message/php-Dev/715567

My personal main reason for wanting to address this issue is that I
think script/c extension combo's are going to become increasingly
important in the near future.  That in combination with a larger number
of extensions, and the desire to have a nice automated extension
repository (PEAR), I think dl is an important piece of those features.  

To me, it mostly comes down to the 'technical issues' I list in one
section below.  Are there more technical issues?  Are they issues we
simply cannot overcome?

There also seems to be a pertinent change in how dl works that is
different from the last time I closely worked on that code (a couple
years back).  It seems we now unload extensions loaded by dl() after the
request is done.  I don't really understand why.  Seems logical to me
that the extension should remain loaded from there on until that process
is ended (I believe that is what php3 does).  This would do away with
performance issues for the most part, and likely would fix or simplify
other things.

Reasons for it:

* As the number of extensions grow, and php becomes more accepted
outside the web server, dynamic loading via script will become more
important.
* It is unreasonable to expect large systems to include all dll's that
anyone might need in php.ini, or to have someone load different ini
files for different scripts.  We already have too much reliance on
php.ini as it is.
* Placing the entire ability to load dynamic modules into php.ini will
be a larger performance hit for smaller scripts.
* Every major language I can think of has some method of dynamically
loading code, there must be some good reason for that ;).  But really,
it just seems silly to take it out rather than fix something that every
other language does.

Reasons against it:

* Performance and memory usage
        - if someone is loading an extension known to take large amounts of
memory, long startup, etc., they SHOULD load it in ini to allow apache
forking to preserve some of that across processes.
* script optimization
        - one good reason, but not enough to me.
* design issues that make it a pain in the ass to fix
* having the time to actually fix it
* it's just not a sexy enough feature that anyone has a strong desire to
deal with

Technical Issues:

* modules not tested for dynamic loading, so can be buggy when dynamicly
loaded/unloaded
* multithreaded issues, which I can find no details of except Zeev's cvs
comment that  it is buggy.  An explanation of these issues would be
helpful.

Other reasons against it that I'm tossing out:

* not supported in thread safe mode (why? should be fixable)
* it's buggy and insecure (vague, should be fixable)
* complicates development of extensions and engine (vague, design issue,
and most extensions are already designed -to one extent or another- for
use with dl)
* module_init is done multiple times (design issue, fixable, even if not
fixed, it should only happen once in the lifetime of an executable)
* COM extension can be extremely slow if loading type libraries (some
extensions SHOULD be loaded from php.ini, but lets not use the exception
as an excuse to deprecate dl)
* tons of people having to figure out how to get things to load at all
under windows (documentation, and perhaps adding extension_dir to the
path on load so ISAPI,etc. modules don't have a problem with it.)


Shane

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to