Skip to content
Snippets Groups Projects
Select Git revision
  • 7b8fa0eb01167bf02d625361c680732d9a8dd042
  • master default protected
  • Legacy_Php7
3 results

vcs.git.class.php

Blame
  • vcs.git.class.php 25.09 KiB
    <?php
    
    require_once("vcs.interface.php");
    require_once __DIR__ . '/../../vendor/axelhahn/ahcache/cache.class.php';
    
    /**
     * version control system :: GIT
     * implements vcs interface
     * 
     *
     * @author hahn
     * 
     * Axel: <axel.hahn@unibe.ch>
     * (...)
     * 2024-08-28  Axel   php8 only; added variable types; short array syntax
    
     */
    class vcs implements iVcs
    {
        // class vcs {
    
        /**
         * configuration
         * @var array 
         */
        private array $_aCfg = [];
    
        /**
         * temp dir to fetch repo version and ommit message; its value will be
         * generated in set_config()
         * @var string
         */
        private string $_sTempDir = '';  // 
    
        /**
         * filename of ssh key file with complete path
         * @var string
         */
        private string $_sKeyfile = '';
    
        /**
         * filename of ssh wrapper script with complete path
         * @var string
         */
        private string $_sWrapper = '';
    
        /**
         * flat array with remote branch names
         * @var array
         */
        private array $_aRemoteBranches = [];
    
        /**
         * name of the default remote branch to access
         * @var string
         */
        private string $_sCurrentBranch = '';
    
        /**
         * Constructor
         * @param array $aRepoConfig
         */
        public function __construct(array $aRepoConfig = [])
        {
            $this->setConfig($aRepoConfig);
            $this->getRemoteBranches(); // to fill the cache
        }
    
        /**
         * Add a log messsage