[wp-hackers] find wp-config from a plugin file
Omry Yadan
omry at yadan.net
Tue Jan 29 14:57:40 GMT 2008
I use this function in FireStats:
http://firestats.cc/browser/branches/firestats-1.4/firestats/firestats-wordpress.php#L1004
and it works well enough.
Pixline wrote:
> Hi all,
>
> first thing, I'd like to introduce you to the new alpha version of
> Gengo [0], ported to WordPress 2.3. Now it almost works! :-)
>
> Afther that: if the plugin file is loaded as ajax it needs to know the
> ABSPATH, and the original author did it like this:
>
> if (!defined('ABSPATH'))
> require_once(dirname(dirname(dirname(dirname(__FILE__)))) .
> '/wp-config.php');
>
> this usually works, but don't work if wordpress is installed in a
> different way, as you can see in [1]. There's a better and safer way
> to find that file? I can't find anything better...
>
> By the way, if some of you can get in touch with Jamie Talbot please
> teach me how to do it, I'm trying since october without success. While
> I'm getting embarassed by this fork-that-is-not-a-fork, I'd love to
> talk with him and maybe merge our effort with the regular codebase on
> wordpress.org. But I couldn't find a working email address.. :-|
>
> Thank you!
> Paolo
>
> [0] http://code.google.com/p/gengo-wp23/
> [1] http://code.google.com/p/gengo-wp23/issues/detail?id=34
> _______________________________________________
> 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