當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GenericHeader類代碼示例

本文整理匯總了PHP中GenericHeader的典型用法代碼示例。如果您正苦於以下問題:PHP GenericHeader類的具體用法?PHP GenericHeader怎麽用?PHP GenericHeader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了GenericHeader類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: fromString

 /**
  * Factory create UserAgentHeader from string representation.
  *
  * @param string $headerLine
  *
  * @return $this
  */
 public static function fromString($headerLine)
 {
     list($fieldName, $fieldValue) = GenericHeader::splitHeaderLine($headerLine);
     $fieldName = str_replace(array(' ', '_', '.'), '-', $fieldName);
     GenericHeader::assertHeaderFieldName('User-Agent', $fieldName);
     return new static($fieldValue);
 }
開發者ID:borobudur-php,項目名稱:borobudur-http,代碼行數:14,代碼來源:UserAgentHeader.php

示例2: fromString

 /**
  * @param string $headerLine
  * @return HeaderInterface|static
  * @throws InvalidArgumentException
  */
 public static function fromString($headerLine)
 {
     list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
     // check to ensure proper header type for this factory
     if (strtolower($name) !== 'dkimsignature') {
         throw new InvalidArgumentException('Invalid header line for DKIM-Signature string');
     }
     $header = new static($value);
     return $header;
 }
開發者ID:fastnloud,項目名稱:zf2-dkim,代碼行數:15,代碼來源:Dkim.php

示例3: fromString

 public static function fromString($headerLine)
 {
     $decodedLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8');
     list($name, $value) = GenericHeader::splitHeaderLine($decodedLine);
     $header = new static($name, $value);
     if ($decodedLine != $headerLine) {
         $header->setEncoding('UTF-8');
     }
     return $header;
 }
開發者ID:tejdeeps,項目名稱:tejcs.com,代碼行數:10,代碼來源:GenericHeader.php

示例4: fromString

 /**
  * Create Age header from string
  *
  * @param string $headerLine
  * @return Age
  * @throws Exception\InvalidArgumentException
  */
 public static function fromString($headerLine)
 {
     $header = new static();
     list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
     // check to ensure proper header type for this factory
     if (strtolower($name) !== 'age') {
         throw new Exception\InvalidArgumentException('Invalid header line for Age string: "' . $name . '"');
     }
     $header->deltaSeconds = (int) $value;
     return $header;
 }
開發者ID:eltondias,項目名稱:Relogio,代碼行數:18,代碼來源:Age.php

示例5: fromString

 public static function fromString($headerLine)
 {
     $header = new static();
     list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
     // check to ensure proper header type for this factory
     if (strtolower($name) !== 'accept-ranges') {
         throw new Exception\InvalidArgumentException('Invalid header line for Accept-Ranges string');
     }
     $header->rangeUnit = trim($value);
     return $header;
 }
開發者ID:idwsdta,項目名稱:INIT-frame,代碼行數:11,代碼來源:AcceptRanges.php

示例6: fromString

 public static function fromString($headerLine)
 {
     list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
     // check to ensure proper header type for this factory
     if (str_replace(array('_', ' ', '.'), '-', strtolower($name)) !== 'user-agent') {
         throw new Exception\InvalidArgumentException('Invalid header line for User-Agent string: "' . $name . '"');
     }
     // @todo implementation details
     $header = new static($value);
     return $header;
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:11,代碼來源:UserAgent.php

示例7: fromString

 public static function fromString($headerLine)
 {
     list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
     // check to ensure proper header type for this factory
     if (strtolower($name) !== 'message-id') {
         throw new Exception\InvalidArgumentException('Invalid header line for Message-ID string');
     }
     $header = new static();
     $header->setId($value);
     return $header;
 }
開發者ID:mindfeederllc,項目名稱:openemr,代碼行數:11,代碼來源:MessageId.php

示例8: fromString

 /**
  * @param $headerLine
  * @return Connection
  * @throws Exception\InvalidArgumentException
  */
 public static function fromString($headerLine)
 {
     $header = new static();
     list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
     // check to ensure proper header type for this factory
     if (strtolower($name) !== 'connection') {
         throw new Exception\InvalidArgumentException('Invalid header line for Connection string: "' . $name . '"');
     }
     $header->setValue(trim($value));
     return $header;
 }
開發者ID:eltondias,項目名稱:Relogio,代碼行數:16,代碼來源:Connection.php

示例9: fromString

 public static function fromString($headerLine)
 {
     list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
     $value = HeaderWrap::mimeDecodeValue($value);
     // check to ensure proper header type for this factory
     if (strtolower($name) !== 'date') {
         throw new Exception\InvalidArgumentException('Invalid header line for Date string');
     }
     $header = new static($value);
     return $header;
 }
開發者ID:KBO-Techo-Dev,項目名稱:MagazinePro-zf25,代碼行數:11,代碼來源:Date.php

示例10: fromString

 public static function fromString($headerLine)
 {
     list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
     // check to ensure proper header type for this factory
     if (strtolower($name) !== 'content-language') {
         throw new Exception\InvalidArgumentException('Invalid header line for Content-Language string: "' . $name . '"');
     }
     // @todo implementation details
     $header = new static($value);
     return $header;
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:11,代碼來源:ContentLanguage.php

示例11: fromString

 public static function fromString($headerLine)
 {
     list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
     // check to ensure proper header type for this factory
     if (strtolower($name) !== 'content-transfer-encoding') {
         throw new Exception\InvalidArgumentException(sprintf('Invalid header line for Content-Transfer-Encoding string: "%s"', $name));
     }
     // @todo implementation details
     $header = new static(strtolower($value));
     return $header;
 }
開發者ID:Flesh192,項目名稱:magento,代碼行數:11,代碼來源:ContentTransferEncoding.php

示例12: fromString

 public static function fromString($headerLine)
 {
     list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
     // check to ensure proper header type for this factory
     if (strtolower($name) !== 'proxy-authenticate') {
         throw new Exception\InvalidArgumentException(sprintf('Invalid header line for Proxy-Authenticate string: "%s"', $name));
     }
     // @todo implementation details
     $header = new static($value);
     return $header;
 }
開發者ID:Flesh192,項目名稱:magento,代碼行數:11,代碼來源:ProxyAuthenticate.php

示例13: fromString

 /**
  * Creates a CacheControl object from a headerLine
  *
  * @param string $headerLine
  * @throws Exception\InvalidArgumentException
  * @return CacheControl
  */
 public static function fromString($headerLine)
 {
     $header = new static();
     list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
     // check to ensure proper header type for this factory
     if (strtolower($name) !== 'cache-control') {
         throw new Exception\InvalidArgumentException('Invalid header line for Cache-Control string: "' . $name . '"');
     }
     // @todo implementation details
     $header->directives = static::parseValue($value);
     return $header;
 }
開發者ID:eltondias,項目名稱:Relogio,代碼行數:19,代碼來源:CacheControl.php

示例14: fromString

 public static function fromString($headerLine)
 {
     $header = new static();
     list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
     // check to ensure proper header type for this factory
     if (strtolower($name) !== 'transfer-encoding') {
         throw new Exception\InvalidArgumentException('Invalid header line for Transfer-Encoding string: "' . $name . '"');
     }
     // @todo implementation details
     $header->value = $value;
     return $header;
 }
開發者ID:idwsdta,項目名稱:INIT-frame,代碼行數:12,代碼來源:TransferEncoding.php

示例15: fromString

 public static function fromString($headerLine)
 {
     $headerLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8');
     list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
     // check to ensure proper header type for this factory
     if (strtolower($name) !== 'content-transfer-encoding') {
         throw new Exception\InvalidArgumentException('Invalid header line for Content-Transfer-Encoding string');
     }
     $header = new static();
     $header->setTransferEncoding($value);
     return $header;
 }
開發者ID:tillk,項目名稱:vufind,代碼行數:12,代碼來源:ContentTransferEncoding.php


注:本文中的GenericHeader類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。