分析鸟云的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里面定义的方法啦
来源:CSDN
作者:timtimup_KSM
链接:https://blog.csdn.net/timtimup123321/article/details/104245344