Exemplo n.º 1
0
 public function __construct($value = null)
 {
     if ($value) {
         HeaderValue::assertValid($value);
         $this->value = $value;
     }
 }
Exemplo n.º 2
0
 /**
  * Add a directive
  * For directives like 'max-age=60', $value = '60'
  * For directives like 'private', use the default $value = true
  *
  * @param string $key
  * @param string|bool $value
  * @return CacheControl - provides the fluent interface
  */
 public function addDirective($key, $value = true)
 {
     HeaderValue::assertValid($key);
     if (!is_bool($value)) {
         HeaderValue::assertValid($value);
     }
     $this->directives[$key] = $value;
     return $this;
 }
Exemplo n.º 3
0
 /**
  * Set header field value
  *
  * @param  string $fieldValue
  * @return GenericHeader
  */
 public function setFieldValue($fieldValue)
 {
     $fieldValue = (string) $fieldValue;
     HeaderValue::assertValid($fieldValue);
     if (preg_match('/^\\s+$/', $fieldValue)) {
         $fieldValue = '';
     }
     $this->fieldValue = $fieldValue;
     return $this;
 }
Exemplo n.º 4
0
 /**
  * Set arbitrary header value
  * RFC allows any token as value, 'close' and 'keep-alive' are commonly used
  *
  * @param string $value
  * @return Connection
  */
 public function setValue($value)
 {
     HeaderValue::assertValid($value);
     $this->value = strtolower($value);
     return $this;
 }
Exemplo n.º 5
0
 public function setRangeUnit($rangeUnit)
 {
     HeaderValue::assertValid($rangeUnit);
     $this->rangeUnit = $rangeUnit;
     return $this;
 }