yii\caching\MemCache::init PHP Method

init() public method

It creates the memcache instance and adds memcache servers.
public init ( )
    public function init()
    {
        parent::init();
        $this->addServers($this->getMemcache(), $this->getServers());
    }

Usage Example

Example #1
0
 public function init()
 {
     //         if($this->useMemcached) {
     //             $this->options = [
     //                 \Memcached::OPT_RETRY_TIMEOUT => 1
     //             ];
     //         }
     parent::init();
     set_error_handler(function ($code, $message, $file, $line) {
         $msg = [$code, $message, $file, $line];
         CacheVisitLogService::put(1000 + __LINE__, 'error', $msg);
     });
 }
All Usage Examples Of yii\caching\MemCache::init