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


PHP CakeText::UUID方法代码示例

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


在下文中一共展示了CakeText::UUID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getHeaders

 /**
  * Get list of headers
  *
  * ### Includes:
  *
  * - `from`
  * - `replyTo`
  * - `readReceipt`
  * - `returnPath`
  * - `to`
  * - `cc`
  * - `bcc`
  * - `subject`
  *
  * @param array $include List of headers.
  * @return array
  */
 public function getHeaders($include = array())
 {
     if ($include == array_values($include)) {
         $include = array_fill_keys($include, true);
     }
     $defaults = array_fill_keys(array('from', 'sender', 'replyTo', 'readReceipt', 'returnPath', 'to', 'cc', 'bcc', 'subject'), false);
     $include += $defaults;
     $headers = array();
     $relation = array('from' => 'From', 'replyTo' => 'Reply-To', 'readReceipt' => 'Disposition-Notification-To', 'returnPath' => 'Return-Path');
     foreach ($relation as $var => $header) {
         if ($include[$var]) {
             $var = '_' . $var;
             $headers[$header] = current($this->_formatAddress($this->{$var}));
         }
     }
     if ($include['sender']) {
         if (key($this->_sender) === key($this->_from)) {
             $headers['Sender'] = '';
         } else {
             $headers['Sender'] = current($this->_formatAddress($this->_sender));
         }
     }
     foreach (array('to', 'cc', 'bcc') as $var) {
         if ($include[$var]) {
             $classVar = '_' . $var;
             $headers[ucfirst($var)] = implode(', ', $this->_formatAddress($this->{$classVar}));
         }
     }
     $headers += $this->_headers;
     if (!isset($headers['X-Mailer'])) {
         $headers['X-Mailer'] = static::EMAIL_CLIENT;
     }
     if (!isset($headers['Date'])) {
         $headers['Date'] = date(DATE_RFC2822);
     }
     if ($this->_messageId !== false) {
         if ($this->_messageId === true) {
             $headers['Message-ID'] = '<' . str_replace('-', '', CakeText::UUID()) . '@' . $this->_domain . '>';
         } else {
             $headers['Message-ID'] = $this->_messageId;
         }
     }
     if ($include['subject']) {
         $headers['Subject'] = $this->_subject;
     }
     $headers['MIME-Version'] = '1.0';
     if (!empty($this->_attachments)) {
         $headers['Content-Type'] = 'multipart/mixed; boundary="' . $this->_boundary . '"';
     } elseif ($this->_emailFormat === 'both') {
         $headers['Content-Type'] = 'multipart/alternative; boundary="' . $this->_boundary . '"';
     } elseif ($this->_emailFormat === 'text') {
         $headers['Content-Type'] = 'text/plain; charset=' . $this->_getContentTypeCharset();
     } elseif ($this->_emailFormat === 'html') {
         $headers['Content-Type'] = 'text/html; charset=' . $this->_getContentTypeCharset();
     }
     $headers['Content-Transfer-Encoding'] = $this->_getContentTransferEncoding();
     return $headers;
 }
开发者ID:xplico,项目名称:CapAnalysis,代码行数:75,代码来源:CakeEmail.php


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