Open XedinUnknown opened 3 years ago
The build seems to be failing due to misconfigured CI: some packages require Composer v1, while Composer v2 is used on CI.
As per https://github.com/TGMPA/TGM-Plugin-Activation/issues/804#issuecomment-827580580:
TGMPA is single instance by design. Changing that is not open for discussion.
I suggest closing this PR.
As I have explained, nothing should change for the current users with this PR. Everyone should be able to continue using the single instance. Also, a class is not single-instance by design; the single-instance-ness is incidental, in that you can force a class to only have a single instance through high coupling etc, but this has no benefits while simply limiting consumers for no apparent reason. Your component (a part of an application, like a plugin or this lib) surely can use only a single instance of something, and can provide to its consumers ways to maintain consistency through the single instance - like by initializing an object, caching it, and always retrieving from cache. In this case, the tgmpa
global is being used for that cache. So your component remains the same in the sense that it continues using only a single instance, and all of the consumers that follow your docs will thus use a single instance.
Given the above, I do not understand the relevance of your comment, sorry. Would you mind explaining exactly what the problem is, e.g. where in any code in this lib, including my PR, you see that it is no longer using a single instance?
Fixes TGMPA/TGM-Plugin-Activation#804.
In general, this change simply shifts things to where they should be in order to properly configure multiple instances of TGMPA.