6 public function __construct()
8 $this->workDir = $GLOBALS['phorkie']['cfg']['workdir'];
9 $this->gitDir = $GLOBALS['phorkie']['cfg']['gitdir'];
15 public function createNew()
18 $dirs = glob('*.git', GLOB_ONLYDIR);
22 return substr($dir, 0, -4);
25 sort($dirs, SORT_NUMERIC);
28 chdir($this->workDir);
29 $dir = $this->workDir . '/' . $n . '/';
30 mkdir($dir, 0777);//FIXME
31 $r = new Repository();
34 $r->gitDir = $this->gitDir . '/' . $n . '.git/';
35 mkdir($r->gitDir, 0777);//FIXME
41 * Get a list of repository objects
43 * @param integer $page Page number, beginning with 0
44 * @param integer $perPage Number of repositories per page
46 * @return array Array of Repositories first, number of repositories second
48 public function getList($page = 0, $perPage = 10)
51 $dirs = glob('*.git', GLOB_ONLYDIR);
52 sort($dirs, SORT_NUMERIC);
54 $some = array_slice($dirs, $page * $perPage, $perPage);
56 foreach ($some as $oneDir) {
57 $r = new Repository();
58 $r->loadById(substr($oneDir, 0, -4));
61 return array($repos, count($dirs));