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

Jeremy Visser jeremy.visser at gmail.com
Mon Feb 4 09:23:06 GMT 2008


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.



More information about the wp-hackers mailing list