-
-
Notifications
You must be signed in to change notification settings - Fork 453
-
Hello
With the Class example: https://github.com/PHPSocialNetwork/phpfastcache/blob/master/docs/examples/extendedPhpFastCache.php i implemented my own cache class which extends PhpfastcacheAbstractProxy.
Alls fine so far, expect the all know PHP notice: Calling many times CacheManager::getInstance() for already instanced...
My own cache class and the constructor:
Selection_002
Then i have a own method to get a cached item:
Selection_003
Now in my other classes where i need to work with the cache i use the own cache class:
use app\cache;
And then i load it in the construct of that other class to use it:
$this->cache = new cache();
I know, thats exact the thing that will give above PHP notice warning.. i know...
If i read trough the extendedPhpFastCache example.. i only see the own cache class.. but how to call/load it in other files to re-use it without PHP notice warning?
Hints are very welcome ;)
Thanks a lot
thomi
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments
-
Hello,
You need to store (statically or in an other way) your cache instance along your script.
Because actually something is calling the CacheManager multiple times with the same settings.
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.