Exemplo n.º 1
0
Arquivo: Cache.php Projeto: jymsy/sky2
 public function init()
 {
     parent::init();
     if ($this->keyPrefix === null) {
         $this->keyPrefix = \Sky\Sky::$app->getId();
     }
 }
Exemplo n.º 2
0
 /**
  * 检测一个属性值是否是null
  * 该方法重写了父类的方法为了检测该组件是否被加载
  * @param string $name 组件名或属性名
  * @return boolean
  */
 public function __isset($name)
 {
     if ($this->hasComponent($name)) {
         return $this->getComponent($name) !== null;
     } else {
         return parent::__isset($name);
     }
 }
Exemplo n.º 3
0
Arquivo: Ftp.php Projeto: jymsy/sky2
 /**
  * Initializes the component.
  * This method is required by {@link IApplicationComponent} and is invoked by application
  * when the EFtpComponent is used as an application component.
  * If you override this method, make sure to call the parent implementation
  * so that the component can be marked as initialized.
  */
 public function init()
 {
     parent::init();
     if ($this->autoConnect) {
         $this->setActive(true);
     }
 }