示例#1
0
文件: git.php 项目: Galvanio/Kinspir
 /**
  * undocumented function
  *
  * @param string $options
  * @return void
  */
 function create($options = array())
 {
     parent::_create();
     extract($this->config);
     if (!is_dir($path)) {
         $Project = new Folder($path, true, 0775);
     }
     if (is_dir($path) && !file_exists($path . DS . 'config')) {
         $this->cd($path);
         $this->run("--bare init");
     }
     $this->branch('master', true);
     if (!empty($options['remote'])) {
         $remote = $options['remote'];
         unset($options['remote']);
     } else {
         $remote = "*****@*****.**";
     }
     $project = basename($path);
     if (is_dir($this->working) && !file_exists($this->working . DS . '.gitignore')) {
         $this->cd();
         $this->before(array("touch .gitignore"));
         $this->commit("Initial Project Commit");
         $this->push();
     }
     //CakeLog::write(LOG_DEBUG, $this->debug);
     if (is_dir($path) && is_dir($this->working)) {
         return true;
     }
     return true;
 }
示例#2
0
文件: svn.php 项目: Galvanio/Kinspir
 /**
  * Create a new repo; initialize the branches, tags, trunk; checkout a working copy to TMP
  *
  * @param string $project name of the project
  * @param array $options repo, working
  * @example $this->Svn->create(array('repo' => TMP . 'svn/repo', 'working' => APP . 'working'));
  * @return void
  *
  */
 function create($options = array())
 {
     parent::_create();
     extract($this->config);
     $file = 'file://' . $path;
     if (!is_dir($path)) {
         $this->admin('create', $path);
         $this->import(array(CONFIGS . 'templates' . DS . 'svn' . DS . 'project', $file, '--message "Initial Project Import"'));
     }
     if (!is_dir($working . DS . 'branches')) {
         $this->checkout(array($file, $working));
     }
     $File = new File($path . DS . 'conf' . DS . 'svnserve.conf');
     $File->write("[general]\nauthz-db = ../permissions.ini\n");
     if (is_dir($path) && is_dir($working . DS . 'branches')) {
         return true;
     }
     return false;
 }