当前位置: 首页>>代码示例>>PHP>>正文


PHP GenericHeader::splitHeaderLine方法代码示例

本文整理汇总了PHP中GenericHeader::splitHeaderLine方法的典型用法代码示例。如果您正苦于以下问题:PHP GenericHeader::splitHeaderLine方法的具体用法?PHP GenericHeader::splitHeaderLine怎么用?PHP GenericHeader::splitHeaderLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GenericHeader的用法示例。


在下文中一共展示了GenericHeader::splitHeaderLine方法的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

 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例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);
     // 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

示例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-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

示例11: 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

示例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::splitHeaderLine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。