blob: 3afe8c5b01c510e138ca2a0309f1fede06a8a3ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
<?php
namespace Phorkie;
class Repositories
{
public function __construct()
{
$this->reposDir = $GLOBALS['phorkie']['cfg']['repos'];
}
/**
* @return Repository
*/
public function createNew()
{
chdir($this->reposDir);
$dirs = glob('*', GLOB_ONLYDIR);
sort($dirs, SORT_NUMERIC);
$n = end($dirs) + 1;
unset($dirs);
$dir = $this->reposDir . '/' . $n . '/';
mkdir($dir, 0777);//FIXME
$r = new Repository();
$r->id = $n;
$r->repoDir = $dir;
return $r;
}
}
?>
|