コード例 #1
0
 /**
  * 软链接
  */
 private function _link($version = null)
 {
     // 创建链接指向
     $remote = new RemoteCmd();
     $sTime = Command::getMs();
     $ret = $remote->setConfig($this->_config)->link($version);
     // 记录执行日志
     $duration = Command::getMs() - $sTime;
     $ret = Record::saveRecord($remote, $this->_task->id, Record::ACTION_LINK, $duration);
     if (!$ret) {
         throw new \Exception($version ? '回滚失败' : '创建链接指向出错');
     }
     return true;
 }
コード例 #2
0
 /**
  * 软链接
  */
 private function _link($version = null)
 {
     // 创建链接指向
     $folder = new Folder();
     $sTime = Command::getMs();
     $ret = $folder->setConfig($this->_config)->link($version);
     // 记录执行时间
     $duration = Command::getMs() - $sTime;
     Record::saveRecord($folder, $this->_task->id, Record::ACTION_LINK, $duration);
     if (!$ret) {
         throw new \Exception($version ? '回滚失败' : '创建链接指向出错');
     }
     return true;
 }