Exemple #1
0
 /**
  * 初始化docx
  */
 public function actionInit()
 {
     $git = new Command();
     $ret = $git->initGit($this->_config['git'], dirname(__FILE__), static::MARKDOWN_ROOT);
 }
Exemple #2
0
 /**
  * 初始化docx
  */
 public function actionInit()
 {
     if (empty($this->_config['git'])) {
         throw new Exception('请先在Config.php中配置文档保存到的git ssh地址:)');
     }
     $git = new Command();
     $ret = $git->initGit($this->_config['git']);
     if ($ret) {
         $this->redirect('/');
     } else {
         throw new Exception('初始化git文档目录失败:', var_export(join("<br>", $git->getExeLog()), true));
     }
 }
Exemple #3
0
 /**
  * 初始化markdown
  */
 public function actionInit()
 {
     if (empty($this->_config['git'])) {
         throw new Exception('请先在Config.php中配置文档保存到的git ssh地址:)');
     }
     if (strpos($this->_config['git'], '.git') === false) {
         throw new Exception('请确保Config.php中配置的git为ssh格式地址:)');
     }
     $git = new Command();
     $ret = $git->initGit($this->_config['git']);
     if ($ret) {
         $this->redirect('/');
     } else {
         $git->cleanInitDir();
         throw new Exception('初始化git文档目录失败,请确认php进程用户' . getenv("USER") . '的ssh-key已加入git的ssh-key列表。');
     }
 }
Exemple #4
0
 /**
  * 初始化docx
  */
 public function actionInit()
 {
     $git = new Command();
     $ret = $git->initGit($this->_config['git'], dirname(__FILE__), static::MARKDOWN_ROOT);
     if ($ret) {
         $this->redirect('/');
     } else {
         throw new Exception('初始化git文档目录失败:', var_export(join("<br>", $git->getExeLog()), true));
     }
 }