You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Xenforo does this. Everything is baked into classes, methods are broken apart, stuff modifies class properties wherever possible.
Well, that's the ideal. Xenforo fails in the last part in a lot of places. >_>
I think we can make it a bit easier to use / develop for than Xenforo though, at least for this.
The way it works is that, rather than extending the class directly, you extend a shortcut. This shortcut gets expanded by the autoloader to point to either the next modification file in the chain, or to the core unmodified file itself.
There are a few things I think we can vastly improve over Xenforo for ease of development, here. We can have people specify priority and the true overrided class in comments, for example. When a mod gets activated or deactivated, it rebuilds the site's autoloader chain cache accordingly.
The text was updated successfully, but these errors were encountered:
I'm indeed not familiar with xf way.
Is there any example around the net?
One thing I introduced some time back are "events" (well, probably not the best name but it seemed to fit), where the event can expose to the addon almost anything from the class it is called from (and on-demand) including private/protected properties, allowing extensions to act like they were directly modifying the class code.
By design I limited this interaction to controllers (but considering how controllers still do much more than they are supposed to, changing it may be feasible) and properties (i.e. it's not possible to replace methods, and I think this should be kept that way), I didn't introduce proority to avoid further complexity, but it should be easy.
For #3259
Xenforo does this. Everything is baked into classes, methods are broken apart, stuff modifies class properties wherever possible.
Well, that's the ideal. Xenforo fails in the last part in a lot of places. >_>
I think we can make it a bit easier to use / develop for than Xenforo though, at least for this.
The way it works is that, rather than extending the class directly, you extend a shortcut. This shortcut gets expanded by the autoloader to point to either the next modification file in the chain, or to the core unmodified file itself.
There are a few things I think we can vastly improve over Xenforo for ease of development, here. We can have people specify priority and the true overrided class in comments, for example. When a mod gets activated or deactivated, it rebuilds the site's autoloader chain cache accordingly.
The text was updated successfully, but these errors were encountered: