Welcome Guest, Not a member yet? Register   Sign In
Is it possible to override a "services" function from module code?
#4

(04-01-2020, 11:12 AM)kilishan Wrote: I don't believe a module can override an app-level service. Technically, they could use the injectMock method that is intended for testing (and might need some better restrictions put on it, come to think of it). In general, though, I don't think that should be allowed as the app itself should have final say on what Service is being used. It should not be possible for third-party modules to override an app-level setting. That's just bad form and asking for trouble. Smile

So using a modular approach to extend a "core" class (e.g. \CodeIgniter\Log\Logger) is not appropriate?
I don't see how that is any different from extending a "core" class by writing code in the App namespace.

What am I failing to see?
Reply


Messages In This Thread
RE: Is it possible to override a "services" function from module code? - by dave friend - 04-01-2020, 01:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB