本文整理汇总了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;
}