Select Git revision
functions.js
vcs.git.class.php 17.22 KiB
<?php
require_once("vcs.interface.php");
/**
* version control system :: GIT
* implements vcs interface
*
*
* @author hahn
*/
class vcs implements iVcs {
// class vcs {
/**
* configuration
* @var array
*/
private $_aCfg = array();
/**
* temp dir to fetch repo version and ommit message; its value will be
* generated in set_config()
* @var string
*/
private $_sTempDir = false; //
/**
* filename of ssh key file with complete path
* @var string
*/
private $_sKeyfile = false;
/**
* filename of ssh wrapper script with complete path
* @var string
*/
private $_sWrapper = false;
/**
* flat array with remote branch names
* @var array
*/
private $_aRemoteBranches = array();
/**
* name of the default remote branch to access
* @var type
*/
private $_sCurrentBranch = "origin/master";
/**
* constructor
* @param array $aRepoConfig
*/
public function __construct($aRepoConfig = array()) {
$this->setConfig($aRepoConfig);
$this->getRemoteBranches(); // to fill the cache
}
/**
* add a log messsage
* @global object $oLog
* @param string $sMessage messeage text
* @param string $sLevel warnlevel of the given message
* @return bool
*/
private function log($sMessage,$sLevel="info"){
global $oCLog;
return $oCLog->add(basename(__FILE__)." class ".__CLASS__." - ".$sMessage,$sLevel);