Add CLI output option to MD_JAIL
This commit is contained in:
parent
6a6f71cf10
commit
2bfc7a0dcd
14
MD_JAIL.php
14
MD_JAIL.php
|
@ -106,6 +106,20 @@ final class MD_JAIL {
|
||||||
*/
|
*/
|
||||||
public function enforce():void {
|
public function enforce():void {
|
||||||
|
|
||||||
|
// Special instructions on CLI, so as to not disturb PHPUnit
|
||||||
|
if (PHP_SAPI === 'cli') {
|
||||||
|
|
||||||
|
if (!isset($this->memory_limit)) {
|
||||||
|
throw new MDJailSecurityOptionNotSetException("It has not been specified, which memory limit the script should hold. Set MD_JAIL->memory_limit = string.");
|
||||||
|
}
|
||||||
|
if (!isset($this->max_execution_time)) {
|
||||||
|
throw new MDJailSecurityOptionNotSetException("It has not been specified, which maximum execution time the script should hold. Set MD_JAIL->max_execution_time = integer.");
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->_status = self::STATUS_SPECIFIED;
|
||||||
|
$this->__destruct();
|
||||||
|
}
|
||||||
|
|
||||||
$this->_apply_memory_limit();
|
$this->_apply_memory_limit();
|
||||||
$this->_apply_time_limit();
|
$this->_apply_time_limit();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user