4 class Repository_ConnectionInfo
10 public function __construct(Repository $repo)
13 $this->arConfig = parse_ini_file($this->repo->gitDir . '/config', true);
16 public function isFork()
18 return $this->getOrigin() !== null;
21 public function hasForks()
23 return count($this->getForks()) > 0;
27 public function getOrigin()
29 return $this->getRemote('origin');
33 * @return Repository_Remote|null NULL if the remote does not exist, array
34 * with repository information otherwise
36 public function getRemote($name)
38 if (!isset($this->arConfig['remote ' . $name])) {
41 return new Repository_Remote($name, $this->arConfig['remote ' . $name]);
44 public function getForks()
47 foreach ($this->arConfig as $name => $data) {
48 if (substr($name, 0, 12) != 'remote fork-') {
51 $arForks[substr($name, 7)] = new Repository_Remote(
52 substr($name, 7), $data