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


PHP Horde_Mime_Part::buildMimeIds方法代码示例

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


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

示例1: trim

$command = trim($vars->php);
$title = _("PHP Shell");
$view = new Horde_View(array('templatePath' => HORDE_TEMPLATES . '/admin'));
$view->addHelper('Horde_Core_View_Helper_Help');
$view->addHelper('Text');
$view->action = Horde::url('admin/phpshell.php');
$view->application = $application;
$view->apps = $apps;
$view->command = $command;
$view->title = $title;
if ($command) {
    $pushed = $registry->pushApp($application);
    $part = new Horde_Mime_Part();
    $part->setContents($command);
    $part->setType('application/x-httpd-phps');
    $part->buildMimeIds();
    $pretty = $injector->getInstance('Horde_Core_Factory_MimeViewer')->create($part)->render('inline');
    $view->pretty = $pretty[1]['data'];
    Horde::startBuffer();
    try {
        eval($command);
    } catch (Exception $e) {
        echo $e;
    }
    $view->command_exec = Horde::endBuffer();
    if ($pushed) {
        $registry->popApp();
    }
}
$page_output->addScriptFile('stripe.js', 'horde');
$page_output->header(array('title' => $title));
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:31,代码来源:phpshell.php

示例2: getMultipartMimeMessage

 private function getMultipartMimeMessage($mime_type)
 {
     $envelope = new Horde_Mime_Part();
     $envelope->setType('multipart/mixed');
     $foo = new Horde_Mime_Part();
     $foo->setType('foo/bar');
     $envelope->addPart($foo);
     $kolab = new Horde_Mime_Part();
     $kolab->setType($mime_type);
     $envelope->addPart($kolab);
     $envelope->buildMimeIds();
     return $envelope;
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:13,代码来源:ObjectTest.php

示例3: _getTestPart

 protected function _getTestPart()
 {
     $part = new Horde_Mime_Part();
     $part->setType('multipart/mixed');
     $part1 = new Horde_Mime_Part();
     $part1->setType('text/plain');
     $part1->setContents('Test');
     $part[] = $part1;
     $part2 = new Horde_Mime_Part();
     $part2->setType('application/octet-stream');
     $part[] = $part2;
     $part3 = new Horde_Mime_Part();
     $part3->setType('multipart/mixed');
     $part[] = $part3;
     $part3_1 = new Horde_Mime_Part();
     $part3_1->setType('text/plain');
     $part3_1->setContents('Test 2');
     $part3[] = $part3_1;
     $part3_2 = new Horde_Mime_Part();
     $part3_2->setType('multipart/mixed');
     $part3[] = $part3_2;
     $part3_2_1 = new Horde_Mime_Part();
     $part3_2_1->setType('text/plain');
     $part3_2_1->setContents('Test 3.2.1');
     $part3_2[] = $part3_2_1;
     $part3_2_2 = new Horde_Mime_Part();
     $part3_2_2->setType('application/octet-stream');
     $part3_2_2->setContents('Test 3.2.2');
     $part3_2[] = $part3_2_2;
     $part->buildMimeIds();
     return $part;
 }
开发者ID:x59,项目名称:horde-mime,代码行数:32,代码来源:PartTest.php

示例4:

<?php

$part1 = new Horde_Mime_Part();
$part1->setType('text/plain');
$part1->setTransferEncoding('quoted-printable');
$part1->setCharset('UTF-8');
$part1->setDisposition('inline');
$part1->setBytes(249);
$part2 = new Horde_Mime_Part();
$part2->setType('application/x-vnd.kolab.note');
$part2->setTransferEncoding('quoted-printable');
$part2->setName('kolab.xml');
$part2->setDisposition('attachment');
$part2->setBytes(704);
$message = new Horde_Mime_Part();
$message->setType('multipart/mixed');
$message->addPart($part1);
$message->addPart($part2);
$message->buildMimeIds(0);
return $message;
开发者ID:jubinpatel,项目名称:horde,代码行数:20,代码来源:note.php

示例5: _saveToSentMail

 /**
  * Save message to sent-mail mailbox, if configured to do so.
  *
  * @param Horde_Mime_Headers $headers     Headers object.
  * @param Horde_Mime_Part $save_msg       Message data to save.
  * @param Horde_Mail_Rfc822_List $recips  Recipient list.
  * @param array $opts                     See buildAndSendMessage()
  */
 protected function _saveToSentMail(Horde_Mime_Headers $headers, Horde_Mime_Part $save_msg, Horde_Mail_Rfc822_List $recips, $opts)
 {
     global $injector, $language, $notification, $prefs;
     if (empty($opts['sent_mail']) || $prefs->isLocked('save_sent_mail') && !$prefs->getValue('save_sent_mail') || !$prefs->isLocked('save_sent_mail') && empty($opts['save_sent'])) {
         return;
     }
     $imp_imap = $injector->getInstance('IMP_Factory_Imap')->create();
     /* If message contains EAI addresses, we need to verify that the IMAP
      * server can handle this data in order to save. */
     foreach ($recips as $val) {
         if ($val->eai) {
             if ($imp_imap->client_ob->capability->query('UTF8', 'ACCEPT')) {
                 break;
             }
             $notification->push(sprintf(_("Message sent successfully, but not saved to %s."), $sent_mail->display));
             return;
         }
     }
     /* Strip attachments if requested. */
     if (!empty($opts['strip_attachments'])) {
         $save_msg->buildMimeIds();
         /* Don't strip any part if this is a text message with both
          * plaintext and HTML representation. */
         if ($save_msg->getType() != 'multipart/alternative') {
             for ($i = 2;; ++$i) {
                 if (!($oldPart = $save_msg[$i])) {
                     break;
                 }
                 $replace_part = new Horde_Mime_Part();
                 $replace_part->setType('text/plain');
                 $replace_part->setCharset($this->charset);
                 $replace_part->setLanguage($language);
                 $replace_part->setContents('[' . _("Attachment stripped: Original attachment type") . ': "' . $oldPart->getType() . '", ' . _("name") . ': "' . $oldPart->getName(true) . '"]');
                 $save_msg[$i] = $replace_part;
             }
         }
     }
     /* Generate the message string. */
     $fcc = $save_msg->toString(array('defserver' => $imp_imap->config->maildomain, 'headers' => $headers, 'stream' => true));
     /* Make sure sent mailbox is created. */
     $sent_mail = IMP_Mailbox::get($opts['sent_mail']);
     $sent_mail->create();
     $flags = array(Horde_Imap_Client::FLAG_SEEN, Horde_Imap_Client::FLAG_MDNSENT);
     try {
         $imp_imap->append($sent_mail, array(array('data' => $fcc, 'flags' => $flags)));
     } catch (IMP_Imap_Exception $e) {
         $notification->push(sprintf(_("Message sent successfully, but not saved to %s."), $sent_mail->display));
     }
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:57,代码来源:Compose.php

示例6: _getTestPart

 protected function _getTestPart()
 {
     $part = new Horde_Mime_Part();
     $part->setType('multipart/mixed');
     $part1 = new Horde_Mime_Part();
     $part1->setType('text/plain');
     $part1->setContents('Test');
     $part->addPart($part1);
     $part2 = new Horde_Mime_Part();
     $part2->setType('application/octet-stream');
     $part->addPart($part2);
     $part3 = new Horde_Mime_Part();
     $part3->setType('multipart/mixed');
     $part->addPart($part3);
     $part3_1 = new Horde_Mime_Part();
     $part3_1->setType('text/plain');
     $part3_1->setContents('Test 2');
     $part3->addPart($part3_1);
     $part->buildMimeIds();
     return $part;
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:21,代码来源:PartTest.php

示例7: catch

require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('turba');
$source = Horde_Util::getFormData('source');
$key = Horde_Util::getFormData('key');
$filename = Horde_Util::getFormData('file');
$type = Horde_Util::getFormData('type');
/* Get the object. */
if (!isset($cfgSources[$source])) {
    throw new Turba_Exception(_("The contact you requested does not exist."));
}
$driver = $injector->getInstance('Turba_Factory_Driver')->create($source);
$object = $driver->getObject($key);
/* Check permissions. */
if (!$object->hasPermission(Horde_Perms::READ)) {
    throw new Turba_Exception(_("You do not have permission to view this contact."));
}
try {
    $data = $object->vfsInit()->read(Turba::VFS_PATH . '/' . $object->getValue('__uid'), $filename);
} catch (Horde_Vfs_Exception $e) {
    Horde::log($e, 'ERR');
    throw new Turba_Exception(sprintf(_("Access denied to %s"), $filename));
}
$mime_part = new Horde_Mime_Part();
$mime_part->setType(Horde_Mime_Magic::extToMime($type));
$mime_part->setContents($data);
$mime_part->setName($filename);
$mime_part->buildMimeIds();
$content = $injector->getInstance('Horde_Core_Factory_MimeViewer')->create($mime_part)->render('full');
$body = $content[1]['data'];
$browser->downloadHeaders($filename, $content[1]['type'], true, strlen($body));
echo $body;
开发者ID:jubinpatel,项目名称:horde,代码行数:31,代码来源:view.php


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