visualappeal / php-gitolite
1.0.8
2017-03-29 12:01 UTC
Requires
- php: >=5.6
- czproject/git-php: ^3.8
- phpunit/phpunit: 5.7.*
README
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' ], ]);