aboutsummaryrefslogtreecommitdiff
path: root/src/Phorkie/Repositories.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Phorkie/Repositories.php')
-rw-r--r--src/Phorkie/Repositories.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Phorkie/Repositories.php b/src/Phorkie/Repositories.php
new file mode 100644
index 0000000..6582ae8
--- /dev/null
+++ b/src/Phorkie/Repositories.php
@@ -0,0 +1,27 @@
+<?php
+namespace Phorkie;
+
+class Repositories
+{
+ public function __construct()
+ {
+ $this->reposDir = $GLOBALS['phorkie']['cfg']['repos'];
+ }
+
+ /**
+ * @return Repository
+ */
+ public function createNew()
+ {
+ $n = basename(end(glob($this->reposDir . '/*', GLOB_ONLYDIR))) + 1;
+ $dir = $this->reposDir . '/' . $n . '/';
+ mkdir($dir, 0777);//FIXME
+ $r = new Repository();
+ $r->id = $n;
+ $r->repoDir = $dir;
+ return $r;
+ }
+
+}
+
+?>