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


PHP Horde_Mime_Headers::listHeaders方法代码示例

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


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

示例1: _addVacationBlocks

 /**
  * Adds all blocks necessary for the vacation rule.
  */
 protected function _addVacationBlocks()
 {
     if (!$this->_validRule(Ingo_Storage::ACTION_VACATION)) {
         return;
     }
     $vacation = $this->_params['storage']->retrieve(Ingo_Storage::ACTION_VACATION);
     $vacation_addr = $vacation->getVacationAddresses();
     if (!count($vacation_addr)) {
         return;
     }
     $vals = array('subject' => $vacation->getVacationSubject(), 'days' => $vacation->getVacationDays(), 'addresses' => $vacation_addr, 'start' => $vacation->getVacationStart(), 'start_year' => $vacation->getVacationStartYear(), 'start_month' => $vacation->getVacationStartMonth(), 'start_day' => $vacation->getVacationStartDay(), 'end' => $vacation->getVacationEnd(), 'end_year' => $vacation->getVacationEndYear(), 'end_month' => $vacation->getVacationEndMonth(), 'end_day' => $vacation->getVacationEndDay(), 'reason' => $vacation->getVacationReason());
     $action = $tests = array();
     $action[] = new Ingo_Script_Sieve_Action_Vacation($vals);
     if ($vacation->getVacationIgnorelist()) {
         $mime_headers = new Horde_Mime_Headers();
         $headers = $mime_headers->listHeaders();
         $headers['Mailing-List'] = null;
         foreach (array_keys($headers) as $h) {
             $tests[] = new Ingo_Script_Sieve_Test_Not(new Ingo_Script_Sieve_Test_Exists(array('headers' => $h)));
         }
         $vals = array('headers' => 'Precedence', 'match-type' => ':is', 'strings' => "list\nbulk\njunk", 'comparator' => 'i;ascii-casemap');
         $tmp = new Ingo_Script_Sieve_Test_Header($vals);
         $tests[] = new Ingo_Script_Sieve_Test_Not($tmp);
         $vals = array('headers' => 'To', 'match-type' => ':matches', 'strings' => 'Multiple recipients of*', 'comparator' => 'i;ascii-casemap');
         $tmp = new Ingo_Script_Sieve_Test_Header($vals);
         $tests[] = new Ingo_Script_Sieve_Test_Not($tmp);
     }
     $addrs = array();
     foreach ($vacation->getVacationExcludes() as $addr) {
         $addr = trim($addr);
         if (!empty($addr)) {
             $addrs[] = $addr;
         }
     }
     if ($addrs) {
         $tmp = new Ingo_Script_Sieve_Test_Address(array('headers' => "From\nSender\nResent-From", 'addresses' => implode("\n", $addrs)));
         $tests[] = new Ingo_Script_Sieve_Test_Not($tmp);
     }
     $this->_addItem(Ingo::RULE_VACATION, new Ingo_Script_Sieve_Comment(_("Vacation")));
     if ($tests) {
         $test = new Ingo_Script_Sieve_Test_Allof($tests);
         $if = new Ingo_Script_Sieve_If($test);
         $if->setActions($action);
         $this->_addItem(Ingo::RULE_VACATION, $if);
     } else {
         $this->_addItem(Ingo::RULE_VACATION, $action[0]);
     }
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:51,代码来源:Sieve.php


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