Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.
   1  <?php
   2  /**
   3   * Copyright 2014-2017 Horde LLC (http://www.horde.org/)
   4   *
   5   * See the enclosed file LICENSE for license information (LGPL). If you
   6   * did not receive this file, see http://www.horde.org/licenses/lgpl21.
   7   *
   8   * @category  Horde
   9   * @copyright 2014-2017 Horde LLC
  10   * @license   http://www.horde.org/licenses/lgpl21 LGPL 2.1
  11   * @package   Mime
  12   */
  13  
  14  /**
  15   * This class represents the Message-ID header value (RFC 2822 [3.6.4]).
  16   *
  17   * @author    Michael Slusarz <slusarz@horde.org>
  18   * @category  Horde
  19   * @copyright 2014-2017 Horde LLC
  20   * @license   http://www.horde.org/licenses/lgpl21 LGPL 2.1
  21   * @package   Mime
  22   * @since     2.5.0
  23   */
  24  class Horde_Mime_Headers_MessageId
  25  extends Horde_Mime_Headers_Identification
  26  {
  27      /**
  28       * Creates a Message-ID header conforming to RFC 2822 [3.6.4] and the
  29       * standards outlined in 'draft-ietf-usefor-message-id-01.txt'.
  30       *
  31       * @param string $prefix  A unique prefix to use.
  32       *
  33       * @return Horde_Mime_Headers_MessageId  Message-ID header object.
  34       */
  35      public static function create($prefix = 'Horde')
  36      {
  37          return new self(
  38              null,
  39              '<' . strval(new Horde_Support_Guid(array('prefix' => $prefix))) . '>'
  40          );
  41      }
  42  
  43      /**
  44       */
  45      public function __construct($name, $value)
  46      {
  47          parent::__construct('Message-ID', $value);
  48      }
  49  
  50      /**
  51       */
  52      public static function getHandles()
  53      {
  54          return array(
  55              // Mail: RFC 5322
  56              'message-id'
  57          );
  58      }
  59  
  60  }