Server IP : 172.67.158.161 / Your IP : 3.16.48.122 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/home/giankuin/sieuthiweb.com.vn/wp-content/plugins/duplicator-pro/aws/Guzzle/Http/Message/Header/ |
Upload File : |
<?php namespace DuplicatorPro\Guzzle\Http\Message\Header; defined("ABSPATH") or die(""); use DuplicatorPro\Guzzle\Common\ToArrayInterface; /** * Provides a case-insensitive collection of headers */ class HeaderCollection implements \IteratorAggregate, \Countable, \ArrayAccess, ToArrayInterface { /** @var array */ protected $headers; public function __construct($headers = array()) { $this->headers = $headers; } public function __clone() { foreach ($this->headers as &$header) { $header = clone $header; } } /** * Clears the header collection */ public function clear() { $this->headers = array(); } /** * Set a header on the collection * * @param HeaderInterface $header Header to add * * @return self */ public function add(HeaderInterface $header) { $this->headers[strtolower($header->getName())] = $header; return $this; } /** * Get an array of header objects * * @return array */ public function getAll() { return $this->headers; } /** * Alias of offsetGet */ public function get($key) { return $this->offsetGet($key); } public function count() { return count($this->headers); } public function offsetExists($offset) { return isset($this->headers[strtolower($offset)]); } public function offsetGet($offset) { $l = strtolower($offset); return isset($this->headers[$l]) ? $this->headers[$l] : null; } public function offsetSet($offset, $value) { $this->add($value); } public function offsetUnset($offset) { unset($this->headers[strtolower($offset)]); } public function getIterator() { return new \ArrayIterator($this->headers); } public function toArray() { $result = array(); foreach ($this->headers as $header) { $result[$header->getName()] = $header->toArray(); } return $result; } }