visualappeal/php-gitolite

1.0.8 2017-03-29 12:01 UTC

This package is auto-updated.

Last update: 2024-11-06 09:43:52 UTC


README

Build Status

Read config

Parse simple gitolite configs.

What can be parsed

  • Users
  • Groups
  • Repositories and permissions

What cannot be parsed

  • @all
  • Including another config file
  • Rule accumulation

Usage

Group[s] consist of of other Group[s] and User[s].

$config = new VisualAppeal\Gitolite\Config($pathToConfig);

var_dump($config->getGroups());
var_dump($config->getRepositories());

Write config

Save config after a change was made

$config = new VisualAppeal\Gitolite\Config($pathToConfig);

// Make changes
// ...

$config->saveAs($pathToNewOrOldConfig);
$config->commitAndPush();

Add user

$config->getGroups()['admins']->addUser('tom', [
	'keys' => [
		'/absolute/path/to/public/key.pub' => 'relative/path/in/keydir.pub'
	],
]);