Skip to content

Commit 82dc77b

Browse files
committed
up
1 parent bb4f91b commit 82dc77b

File tree

2 files changed

+1
-48
lines changed

2 files changed

+1
-48
lines changed

examples/baks/color.php

-47
Original file line numberDiff line numberDiff line change
@@ -11,54 +11,7 @@
1111
fwrite(STDOUT, "\033[32;40;1;4mfoo\033[39;49;22;24m");
1212
fflush(STDOUT);
1313

14-
function execInBackground($cmd)
15-
{
16-
if (substr(php_uname(), 0, 7) == "Windows") {
17-
pclose(popen("start /B " . $cmd, "r"));
18-
} else {
19-
exec($cmd . " > /dev/null &");
20-
}
21-
}
22-
function GetProgCpuUsage($program)
23-
{
24-
if (!$program) {
25-
return -1;
26-
}
2714

28-
$c_pid = exec("ps aux | grep " . $program . " | grep -v grep | grep -v su | awk {'print $3'}");
29-
return $c_pid;
30-
}
3115

32-
function GetProgMemUsage($program)
33-
{
34-
if (!$program) {
35-
return -1;
36-
}
3716

38-
$c_pid = exec("ps aux | grep " . $program . " | grep -v grep | grep -v su | awk {'print $4'}");
39-
return $c_pid;
40-
}
4117

42-
// If you want to download files from a linux server with a filesize bigger than 2GB you can use the following
43-
function serveFile($file, $as)
44-
{
45-
header('Expires: Mon, 1 Apr 1974 05:00:00 GMT');
46-
header('Pragma: no-cache');
47-
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
48-
header('Content-Description: File Download');
49-
header('Content-Type: application/octet-stream');
50-
header('Content-Length: ' . trim(`stat -c%s "$file"`));
51-
header('Content-Disposition: attachment; filename="' . $as . '"');
52-
header('Content-Transfer-Encoding: binary');
53-
//@readfile( $file );
54-
55-
flush();
56-
$fp = popen("tail -c " . trim(`stat -c%s "$file"`) . " " . $file . ' 2>&1', "r");
57-
while (!feof($fp)) {
58-
// send the current file part to the browser
59-
print fread($fp, 1024);
60-
// flush the content to the browser
61-
flush();
62-
}
63-
fclose($fp);
64-
}

src/utils/Interact.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public static function confirm($question, $default = true): bool
9999
$question = ucfirst(trim($question, '?'));
100100
$default = (bool)$default;
101101
$defaultText = $default ? 'yes' : 'no';
102-
$message = " <comment>$question ?</comment>\n Please confirm (yes|no) [default:<info>$defaultText</info>]: ";
102+
$message = "<comment>$question ?</comment>\nPlease confirm (yes|no)[default:<info>$defaultText</info>]: ";
103103

104104
while (true) {
105105
$answer = self::read($message);

0 commit comments

Comments
 (0)