• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Hi how can I extend the XenForo_Visitor?

Uniphix

Active member
#1
Is there a best way to extend the XenForo_Visitor??? The reason is I need to add more things to the XenForo_Visitor and I would hate to have to modify and merge it it on each XenForo Update... Basically I need to add permissions that I can use for caching...
 

digitalpoint

Well-known member
#3
You can't because XenForo_Visitor is mostly a group of static methods that are called directly (not through a loader). The only way to extend it/change existing methods would be if it was loaded through a class loader. If your permissions stuff is just something you need for own stuff, you could make your own class that just extends XenForo_Vistor, and call that class when you need the extra stuff.
 

digitalpoint

Well-known member
#5
Oh yeah... if you want to do something with the visitor OBJECT, you can do it that way... I thought you wanted to extend the visitor class/methods though.
 

Uniphix

Active member
#6
I did, I just created my own Visitor class without having to extend it, Then whenever I need to access that class I can, I make it static like the visitor class itself and then cache etc. anything that I need. It ended up working the best way. Thanks everyone who tried to help =).

Ben