Example #1
0
 public final function getCache()
 {
     return PsDbCahce::getCache(get_called_class());
 }
 /**
  * Метод перенаправляет ConnectionPool на другой коннект
  */
 protected final function configureImpl(PsConnectionParams $params = null)
 {
     if ($this->CONNECTION_PARAMS == null) {
         if ($params == null) {
             return;
             //---
         }
         $this->LOGGER->info();
         $this->LOGGER->info('>  Setting connection params: [{}]', $params);
         $this->CONNECTION_PARAMS = $params;
     } else {
         if ($this->CONNECTION_PARAMS->equals($params)) {
             return;
             //Сейчас работаем с теми-же настройками ---
         } else {
             $this->LOGGER->info();
             $this->LOGGER->info('<> Switching connection params from [{}] to [{}]', $this->CONNECTION_PARAMS, $params == null ? 'disconnected' : $params);
             $this->CONNECTION_PARAMS = $params;
         }
     }
     //Очистим кеши
     PsDbCahce::clearAll();
     //Сбросим текущий коннект
     $this->CONNECTION = null;
 }