Make random IDs configurable
[phorkie.git] / src / phorkie / Repositories.php
index 7ed3188e383ec61f5bb11f2cf05496d6bc12abc4..9021a2e1a549cfe2e5dd4bc754c104982c5c27f2 100644 (file)
@@ -23,7 +23,11 @@ class Repositories
             }
         );
         sort($dirs, SORT_NUMERIC);
-        $n = end($dirs) + mt_rand(65536, 16777216);
+        if ($GLOBALS['phorkie']['cfg']['randomIds']) {
+            $n = end($dirs) + mt_rand(65536, 16777216);
+        } else {
+            $n = end($dirs) + 1;
+        }
 
         chdir($this->workDir);
         $dir = $this->workDir . '/' . $n . '/';