예제 #1
0
파일: Header.php 프로젝트: crysalead/net
 /**
  * The constructor
  *
  * @param string $name  The header name
  * @param array  $value The header value
  */
 public function __construct($name = '', $value = '')
 {
     if (func_num_args() === 1) {
         $value = $name;
         $name = '';
     }
     $value = is_array($value) ? join(',', $value) : $value;
     $this->_name = $name;
     $this->_plain = $value;
     if (!empty($this->_plain)) {
         $data = array_map('trim', explode(',', $this->_plain));
     } else {
         $data = [];
     }
     parent::__construct($data);
 }
예제 #2
0
파일: Env.php 프로젝트: crysalead/env
 /**
  * The Constructor.
  *
  * It normalizes a couple of well known environment variables.
  *
  * @param array   $env       An environment variables array.
  * @param boolean $normalize Whether or not the variables must be normalized.
  */
 public function __construct($env = [], $normalize = true)
 {
     parent::__construct($normalize ? $this::normalize($env) : $env);
 }