[wp-hackers] WPMU VHOST constant
james at om4.com.au
Wed Aug 5 02:18:24 UTC 2009
I agree with Beau.
Your method is the correct way to do this. There's plenty of examples in
WPMU's codebase (eg
http://trac.mu.wordpress.org/browser/trunk/wpmu-settings.php#L68) where it
is done the exact same way.
I personally think there should be a simple function added to WPMU for this
(eg wpmu_is_vhost_install() which returns a boolean). It would be simpler
and cleaner than referring to the VHOST constant all over the place.
OM4 - Website Design and Development
OM4.com.au | OM4Tourism.com
2009/8/5 Brent <thenbrent at gmail.com>
> Thanks for the quick responses.
> Otto, I was a little confused about the constant function not being OK,
> especially having read the php manual entry on it, so thanks for confirming
> it's OK.
> Will, thanks for reminding me I should be checking that VHOST is defined
> before trying to get its value.
> Beau, thanks for letting me know this is the acceptable method. :)
> On Tue, Aug 4, 2009 at 10:18 PM, Otto
> <otto at ottodestruct.com> wrote:
> > On Tue, Aug 4, 2009 at 2:50 PM, Will
> > Anderson<wp-hackers at itsananderson.com> wrote:
> > > Unfortunately I'm not terribly familiar with WPMU, but I can tell you
> > from a
> > > PHP perspective that the code you posted won't work. The constant
> > > already be defined in wp-config.php (from what I understand) so you
> > > shouldn't try defining it again (which is what the "constant" function
> > > does). Instead, do something like this...
> > No, the constant function returns the value, so checking for
> > (constant("VHOST") == 'yes') is perfectly acceptable.
> > http://www.php.net/manual/en/function.constant.php
> > "constant — Returns the value of a constant"
> > -Otto
> > Sent from Memphis, TN, United States
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers