public function __construct(array $args = array()) { foreach (get_class_vars(get_class($this)) as $key => $val) { if (array_key_exists($key, $args)) { $this->{$key} = $args[$key]; } } $this->verifyKey(); if ($this->started_at === null) { $this->started_at = time(); } if ($this->max_execution_time === null) { $this->max_execution_time = ini_get('max_execution_time') ?: self::MAXEXECTIME; } return parent::__construct(); }
public function __construct(array $args = array()) { foreach (get_class_vars(get_class($this)) as $key => $val) { if (array_key_exists($key, $args)) { $this->{$key} = $args[$key]; } } $this->verifyKey(); if ($this->started_at === null) { $this->started_at = time(); } if ($this->max_execution_time === null) { $this->max_execution_time = ini_get('max_execution_time') ?: self::MAXEXECTIME; } if ($this->max_execution_margin === null) { $this->max_execution_margin = common_config('http', 'connect_timeout') + 1; // think PHP's max exec time, minus this value to have time for timeouts etc. } return parent::__construct(); }
public function __construct(array $args = array()) { foreach (get_class_vars(get_class($this)) as $key => $val) { if (array_key_exists($key, $args)) { $this->{$key} = $args[$key]; } } $this->verifyKey(); if ($this->started_at === null) { $this->started_at = time(); } if ($this->max_execution_time === null) { $this->max_execution_time = ini_get('max_execution_time') ?: self::MAXEXECTIME; } if ($this->max_execution_margin === null) { $this->max_execution_margin = 10; // should be calculated from our default timeouts for http requests etc. } return parent::__construct(); }