I never saw any argument justifying the removal of the dl()
feature, even if the CLI SAPI
keeps it. But I can give at least two against it :
-
If extensions cannot be loaded from the PHP code any more, it becomes impossible to autoload
them when needed. As I wrote in another message, one of the benefits a 'smart' autoload handler
could bring, would be to allow extension autoloading. And not only for CLI programs: when you
distribute a software, it would be much better to autoload extensions in a transparent manner
than require an unexperienced user to modify his php.ini file. -
Unless there's a good reason to suppress this feature, I don't see why we should introduce a
difference between the CLI SAPI and other interfaces.
IMHO, the decision to remove dl()
is wrong. Maybe it looked like a good idea at first, but
considering all its implications, it is not.
Francois
Edin Kadribasic wrote:
Michael B Allen wrote:
Our CLI module installer uses
dl()
to manually load the module and
validate some basic functionality. This is a very nice feature and I'm
disappointed to see it has been deprecated. Will there be any equivalent
functionality moving forward? The extension directive is clumsey in this
scenario because it would require running a separate script.
dl()
is scheduled to be removed from all other SAPI's. I believe that
there are no current plans to deprecate it from the CLI version of PHP.Edin
At 12:39 18/09/2006, P wrote:
I never saw any argument justifying the removal of the
dl()
feature,
even if the CLI SAPI
keeps it. But I can give at least two against it :
If extensions cannot be loaded from the PHP code any more, it
becomes impossible to autoload
them when needed. As I wrote in another message, one of the benefits
a 'smart' autoload handler
could bring, would be to allow extension autoloading. And not only
for CLI programs: when you
distribute a software, it would be much better to autoload
extensions in a transparent manner
than require an unexperienced user to modify his php.ini file.Unless there's a good reason to suppress this feature, I don't see
why we should introduce a
difference between the CLI SAPI and other interfaces.IMHO, the decision to remove
dl()
is wrong. Maybe it looked like a
good idea at first, but
considering all its implications, it is not.
Francois,
There are good reasons to remove it. It's not that we suddenly
thought PHP would be a better language without dl()
, it just doesn't
fit the Web model PHP is used with and cannot be implemented
reliably. That's why we kept it where it makes sense (CLI), and
deprecated it in the web SAPIs.
By the way, a smart autoloader in a real world PHP environment will
most certainly always be less efficient than loading the extension
at startup, because it cannot be shared between instances.
Zeev