public function init() { parent::init(); if ($this->keyPrefix === null) { $this->keyPrefix = \Sky\Sky::$app->getId(); } }
/** * 检测一个属性值是否是null * 该方法重写了父类的方法为了检测该组件是否被加载 * @param string $name 组件名或属性名 * @return boolean */ public function __isset($name) { if ($this->hasComponent($name)) { return $this->getComponent($name) !== null; } else { return parent::__isset($name); } }
/** * 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); } }