Пример #1
0
 /**
  * Initializes this component by ensuring the existence of the cache path.
  */
 public function init()
 {
     parent::init();
     $this->cachePath = Leaps::getAlias($this->cachePath);
     if (!is_dir($this->cachePath)) {
         FileHelper::createDirectory($this->cachePath, $this->dirMode, true);
     }
 }
Пример #2
0
 /**
  * Initializes the DbCache component.
  * This method will initialize the [[db]] property to make sure it refers to a valid DB connection.
  * @throws InvalidConfigException if [[db]] is invalid.
  */
 public function init()
 {
     parent::init();
     $this->db = Instance::ensure($this->db, Connection::className());
 }
Пример #3
0
 /**
  * Initializes this application component.
  * It creates the memcache instance and adds memcache servers.
  */
 public function init()
 {
     parent::init();
     $this->addServers($this->getMemcache(), $this->getServers());
 }