forked from yamada28go/docker-exment
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathhelper.php
More file actions
46 lines (37 loc) · 714 Bytes
/
helper.php
File metadata and controls
46 lines (37 loc) · 714 Bytes
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
function exec_async($command) {
if (PHP_OS !== 'WIN32' && PHP_OS !== 'WINNT') {
exec($command . ' >/dev/null 2>&1 &');
} else {
$fp = popen('start "" ' . $command, 'r');
pclose($fp);
}
}
function rmdirAll($dir) {
$res = glob($dir.'/{*,.[!.]*,..?*}', GLOB_BRACE);
foreach ($res as $f) {
if (is_file($f)) {
unlink($f);
} else {
rmdirAll($f);
}
}
rmdir($dir);
}
/**
* Get build directories
*
* @return array
*/
function getBuildDirs() {
$currentDir = getcwd();
$dirs = scandir('build');
$result = [];
foreach($dirs as $dir){
if(in_array($dir, ['.', '..'])){
continue;
}
$result[] = $dir;
}
return $result;
}