[wp-hackers] find wp-config from a plugin file

Omry Yadan omry at yadan.net
Mon Feb 4 13:51:55 GMT 2008


In many cases it's the only way to go.

for my plugin to work for 99.99% of the users that does not use symlink, 
I am willing to make the life of those who does harder.


Jeremy Visser wrote:

> On Mon, 2008-02-04 at 02:51 +0800, Abel Cheung wrote:
>   
>> On Jan 29, 2008 9:12 PM, Jacob Santos <wordpress at santosj.name> wrote:
>>     
>>> I finally understood what purpose having more than one dirname() has and
>>> well you don't need it. The same can be solved doing this: <?php
>>> require_once( realpath( dirname(__FILE__) .'/../../wp_config.php'); ?>.
>>>       
>> Completely unusable if the plugin directory is symlinked to another location.
>>     
>
> Yes, please avoid this. I created a forehead-shaped crater in my desk
> from when I was trying to share a single K2 installation between two
> WordPress installations by using symlinks, and it was realpath()'s
> fault.
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>   



More information about the wp-hackers mailing list