分析鳥雲的UpgradeService代碼,升級的所有參數和方法都在裏面
第一步:在其他文件實例化UpgradeService:
$this->upgradeService = new UpgradeService(
REAL_PATH,
"update.niaoyun.com",
$this->dataDir,
$dbconfig,
$agentDomain,
$agentid,
$agentPass,
$templates
);
UpgradeService實例化後,參數已經賦值:
下面是UpgradeService..php
public function __construct($appRootDir, $masterHost, $tempDir, $dbConfig, $agentDomain, $agentid, $agentPassword, $templates)
{
$this->masterHost = $masterHost;
$this->agengid = $agentid;
$this->agentDomain = $agentDomain;
$this->agentPassword = $agentPassword;
............
}
第二步:通過$this->upgradeService便可調用UpgradeService..php裏面定義的方法啦