-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunScriptTask.php
More file actions
52 lines (42 loc) · 1.05 KB
/
Copy pathRunScriptTask.php
File metadata and controls
52 lines (42 loc) · 1.05 KB
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
47
48
49
50
51
52
<?php
namespace TaskChecker\Codebot;
class RunScriptTask
{
const STATUS_READY = 1;
const STATUS_EXECUTED = 2;
const STATUS_FAILED = 3;
const FAIL_TIMEOUT = 'timeout';
const FAIL_STDOUT_LIMIT = 'stdout_limit';
const FAIL_STDERR_LIMIT = 'stderr_limit';
const FAIL_MEMORY_LIMIT = 'memory_limit';
const FAIL_ERROR = 'error';
public $source;
public $stdout;
public $stderr;
public $status = self::STATUS_READY;
public $exitCode;
public $failReason;
public $timeTaken;
public $memoryTaken;
public $stdoutLimit;
public $stderrLimit;
public $timeout;
public $memoryLimit;
public function __construct($source)
{
$this->source = $source;
}
public function setFailed($reason)
{
$this->status = self::STATUS_FAILED;
$this->failReason = $reason;
}
public function isSuccess()
{
return $this->status == self::STATUS_EXECUTED;
}
public function isExecuted()
{
return $this->status != self::STATUS_READY;
}
}