diff options
Diffstat (limited to 'src/phorkie/Repository.php')
| -rw-r--r-- | src/phorkie/Repository.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/phorkie/Repository.php b/src/phorkie/Repository.php index 0cc279b..ba3079a 100644 --- a/src/phorkie/Repository.php +++ b/src/phorkie/Repository.php @@ -236,6 +236,27 @@ class Repository } /** + * @return array Array with keys "email" and "name" + */ + public function getOwner() + { + try { + $name = $this->getVc()->getCommand('config') + ->addArgument('owner.name')->execute(); + } catch (\VersionControl_Git_Exception $e) { + $name = $GLOBALS['phorkie']['auth']['anonymousName']; + } + try { + $email = $this->getVc()->getCommand('config') + ->addArgument('owner.email')->execute(); + } catch (\VersionControl_Git_Exception $e) { + $email = $GLOBALS['phorkie']['auth']['anonymousEmail']; + } + + return array('name' => trim($name), 'email' => trim($email)); + } + + /** * Get a link to the repository * * @param string $type Link type. Supported are: |
