PHP code example of visualappeal / php-gitolite
1. Go to this page and download the library: Download visualappeal/php-gitolite library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
visualappeal / php-gitolite example snippets
$config = new VisualAppeal\Gitolite\Config($pathToConfig);
var_dump($config->getGroups());
var_dump($config->getRepositories());
$config = new VisualAppeal\Gitolite\Config($pathToConfig);
// Make changes
// ...
$config->saveAs($pathToNewOrOldConfig);
$config->commitAndPush();
$config->getGroups()['admins']->addUser('tom', [
'keys' => [
'/absolute/path/to/public/key.pub' => 'relative/path/in/keydir.pub'
],
]);