note 40911 added to function.dl
| From: | nutbar at innocent dot com | Date: | Thu, 18 Mar 2004 18:22:41 +0000 |
| Subject: | note 40911 added to function.dl | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67035@lists.php.net to get a copy of this message | ||
For those who are tearing their hair out due to the extension_dir being set to "./",
here's a somewhat graceful fix that will be portable:
dl(preg_replace('/\/([^\/]+)/', '../', dirname(__FILE__)) . __FILE__ .
'/../some/path/dll.so');
You could alternatively make that preg_replace part into a separate function and call it something
like dirname_rel() or whatever. It basically replaces all the path components with ".."
and spits out a relative path, so that when mixed with the "./" part of the extension_dir
setting, it puts you at the root folder "/" so that you know where you are :)
----
Manual Page -- http://www.php.net/manual/en/function.dl.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40911
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40911&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40911&report=yes
Search -- http://master.php.net/manage/user-notes.php