Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class CacheInitiator
- {
- static function run()
- {
- $initializer = "init".ucfirst(strtolower(Cache::getDefaultDriver()));
- $self = new CacheInitiator();
- if ( method_exists($self, $initializer) ) {
- $self->{$initializer}();
- }
- }
- function initMemcached()
- {
- $memcached = Cache::getStore()->getMemcached();
- $memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, true);
- $username = Config::get('cache.memcached')[0]['username'];
- $password = Config::get('cache.memcached')[0]['password'];
- if ( $username && $password ) {
- $memcached->setSaslAuthData($username, $password);
- }
- }
- }
- CacheInitiator::run();
Add Comment
Please, Sign In to add comment