Inheritance: extends Command
Ejemplo n.º 1
0
 /**
  * 添加数据保存事件afterSave
  *
  * @author wushuiyong
  * @param bool $insert
  * @param array $changedAttributes
  */
 public function afterSave($insert, $changedAttributes)
 {
     parent::afterSave($insert, $changedAttributes);
     // 修改了项目repo_url,本地检出代码将被清空
     if (isset($changedAttributes['repo_url'])) {
         $projectDir = static::getDeployFromDir();
         if (file_exists($projectDir)) {
             $folder = new Folder($this);
             $folder->removeLocalProjectWorkspace($projectDir);
         }
     }
     // 插入一条管理员关系
     if ($insert) {
         Group::addGroupUser($this->attributes['id'], [$this->attributes['user_id']], Group::TYPE_ADMIN);
     }
 }
Ejemplo n.º 2
0
 /**
  * 收尾工作
  */
 private function _cleanUp($version = null)
 {
     // 创建链接指向
     $folder = new Folder();
     $folder->setConfig($this->conf)->cleanUp($version);
     return true;
 }