{
chdir($this->gitDir);
$dirs = glob('*.git', GLOB_ONLYDIR);
- array_walk(
- $dirs,
- function ($dir) {
- return substr($dir, 0, -4);
- }
- );
+ foreach ($dirs as $key => $dir) {
+ $dirs[$key] = substr($dir, 0, -4);
+ }
sort($dirs, SORT_NUMERIC);
- $n = end($dirs) + 1;
+
+ if ($GLOBALS['phorkie']['cfg']['randomIds']) {
+ $n = end($dirs) + mt_rand(65536, 16777216);
+ } else {
+ $n = end($dirs) + 1;
+ }
chdir($this->workDir);
$dir = $this->workDir . '/' . $n . '/';