<commit_before><?php
/* This class is part of the XP framework
 * 
 * $Id$
 */

  uses('peer.mail.MimePart');

  /**
   * Mail message
   *
   * @see
   * @purpose  Wrap
   */
  class MultiPart extends MimePart {
    var 
      $parts     = array(),
      $charset   = '',
      $boundary  = '';
      
    var
      $_ofs      = 0;
      
    /**
     * Constructor. Also generates a boundary of the form
     * <pre>
     * ----=_Alternative_10424693873e22d20b43b490.00112051
     * </pre>
     *
     * @param   &peer.mail.MimePart* parts
     * @access  public
     */
    function __construct() {
      parent::__construct();
      $this->charset= '';
      for ($i= 0, $s= func_num_args(); $i < $s; $i++) {
        $this->addPart(func_get_arg($i));
      }
      $this->setBoundary('----=_Alternative_'.uniqid(time(), TRUE));
    }

    /**
     * Set boundary and updates Content-Type header. Note: A boundary is generated 
     * upon instanciation, so this is usually not needed!
     *
     * Also sets the charset to an empty string.
     *
     * @access  public
     * @param   string b the new boundary
     */
    function setBoundary($b) {
      $this->boundary= $b;
      // $this->contenttype= 'multipart/alternative; boundary="'.$this->boundary.'"';
      $this->setContenttype('multipart/alternative');
      $this->charset= '';
    }
    
    /**
     * Sets content-type and updates the header. The boundary will be appended
     * to the content-type header.
     *
     * @access  public
     * @param   string content-type
     */
    function setContenttype($c) {
      $this->contenttype= $c;
    }
    
    /**
     * Add a Mime Part
     *
     * @access  public
     * @param   &peer.mail.MimePart part<commit_msg>- Add accessor getBoundary() # Fixes "Fatal error: Call to undefined function:  getboundary()"<commit_after><?php
/* This class is part of the XP framework
 * 
 * $Id$
 */

  uses('peer.mail.MimePart');

  /**
   * Mail message
   *
   * @see
   * @purpose  Wrap
   */
  class MultiPart extends MimePart {
    var 
      $parts     = array(),
      $charset   = '',
      $boundary  = '';

    var
      $_ofs      = 0;
      
    /**
     * Constructor. Also generates a boundary of the form
     * <pre>
     * ----=_Alternative_10424693873e22d20b43b490.00112051
     * </pre>
     *
     * @param   &peer.mail.MimePart* parts
     * @access  public
     */
    function __construct() {
      parent::__construct();
      $this->charset= '';
      for ($i= 0, $s= func_num_args(); $i < $s; $i++) {
        $this->addPart(func_get_arg($i));
      }
      $this->setBoundary('----=_Alternative_'.uniqid(time(), TRUE));
    }

    /**
     * Set boundary and updates Content-Type header. Note: A boundary is generated 
     * upon instanciation, so this is usually not needed!
     *
     * Also sets the charset to an empty string.
     *
     * @access  public
     * @param   string b the new boundary
     */
    function setBoundary($b) {
      $this->boundary= $b;
      // $this->contenttype= 'multipart/alternative; boundary="'.$this->boundary.'"';
      $this->setContenttype('multipart/alternative');
      $this->charset= '';
    }

    /**
     * Get Boundary
     *
     * @access  public
     * @return  string
     */
    function getBoundary() {
      return $this->boundary;
    }
    
    /**
     * Sets content-type and updates the header. The boundary will be appended
     * to the content-type header.
     *
     * @access  public
     * @param   string content-type
     */
    function setContenttype($c) {
      $this->contenttype= $c;
    }
    
    /**
     * Add a Mime Part
     *
     * @access  public
     * @param   &peer.mail.MimePart part
{'fraction_non_alphanumeric': 0.14281871974179666, 'fraction_numerical': 0.01613770844540075, 'mean_word_length': 1.9375987361769351, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '235503', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1184, 'n_words': 292}