Returns the start of a message boundary.

@access protected
@return string
543502
protected function GetBoundary($boundary, $charSet, $contentType, $encoding)
    {
        $result = '';
        if ($charSet == '') {
            $charSet = $this->CharSet;
        }
        if ($contentType == '') {
            $contentType = $this->ContentType;
        }
        if ($encoding == '') {
            $encoding = $this->Encoding;
        }
        $result .= $this->TextLine('--' . $boundary);
        $result .= sprintf("Content-Type: %s; charset=\"%s\"", $contentType, $charSet);
        $result .= $this->LE;
        $result .= $this->HeaderLine('Content-Transfer-Encoding', $encoding);
        $result .= $this->LE;

        return $result;
    }
319872
public function constructMultipartMessage()
    {

        $mixed_boundary = '__mixed_1S2U3R4E5B6E7R8T9';
        $alterative_boundary = '__alter_1S2U3R4E5B6E7R8T9';

        $this->attachments_in_HTML =0;

        if(strstr($this->body_HTML, "cid:")) {

            $this->attachments_in_HTML =1;
            $related_boundary = '__relate_1S2U3R4E5B6E7R8T9';
        }

        $this->_header_text = "From: ".$this->from.PHP_EOL;
        $this->_header_text .= "Reply-To: ".$this->from.PHP_EOL;
        $this->_header_text .= "Return-Path: ".$this->from.PHP_EOL;

        foreach($this->cc as $cc) {
            $this->_header_text .="Cc:".$cc.PHP_EOL;
        }

        foreach($this->bcc as $bcc) {
            $this->_header_text .="Bcc:".$bcc.PHP_EOL;
        }

        $this->_header_text .= "MIME-Version: 1.0".PHP_EOL;

        foreach($this->headers as $key=>$val) {
            $this->_header_text .= $key.":".$val.PHP_EOL;
        }

        $this->_header_text .= "Content-Type: multipart/mixed;".PHP_EOL;
        $this->_header_text .= ' boundary="'.$mixed_boundary.'"'.PHP_EOL.PHP_EOL;

        // Add a message for peoplewithout mime
        $message = "This message has an attachment in MIME format created with surebert mail.".PHP_EOL.PHP_EOL;

        //if there is body_HTML use it otherwise use just plain text
        if(!empty($this->body_HTML)) {

            $message .= "--".$mixed_boundary.PHP_EOL;

            if($this->attachments_in_HTML == 1) {
                $message .= "Content-Type: multipart/related;".PHP_EOL;
                $message .= ' boundary="'.$related_boundary.'"'.PHP_EOL.PHP_EOL;
                $message .= "--".$related_boundary.PHP_EOL;
            }

            $message .= "Content-Type: multipart/alternative;".PHP_EOL;
            $message .= ' boundary="'.$alterative_boundary.'"'.PHP_EOL.PHP_EOL;

            $message .= "--".$alterative_boundary.PHP_EOL;
            $message .= "Content-Type: text/plain; charset=".$this->charset."; format=flowed".PHP_EOL;
            $message .= "Content-Transfer-Encoding: ".$this->transfer_encoding.PHP_EOL;
            $message .= "Content-Disposition: inline".PHP_EOL.PHP_EOL;
            $message .= $this->body . PHP_EOL;

            $message .= "--".$alterative_boundary.PHP_EOL;
            $message .= "Content-Type: text/html; charset=".$this->charset.PHP_EOL;
            $message .= "Content-Transfer-Encoding: ".$this->transfer_encoding.PHP_EOL.PHP_EOL;
            $message .= $this->body_HTML . PHP_EOL;

            $message .="--".$alterative_boundary."--".PHP_EOL;

        } else {

            $message .= "--".$mixed_boundary.PHP_EOL;
            $message .= "Content-Type: text/plain; charset=".$this->charset."; format=flowed".PHP_EOL;
            $message .= "Content-Transfer-Encoding: ".$this->transfer_encoding.PHP_EOL;
            $message .= "Content-Disposition: inline".PHP_EOL.PHP_EOL;
            $message .= $this->body . PHP_EOL;
        }

        //add all attachments for this email
        foreach($this->attachments as &$attachment) {
            
        //if only filepath is set, grab name and contents from there
            if(isset($attachment->filepath)) {
                if(empty($attachment->name)) {
                    $attachment->name = basename($attachment->filepath);
                }

                if(empty($attachment->contents)) {
                    $attachment->contents = file_get_contents($attachment->filepath);
                }

                if(empty($attachment->mime_type)) {
                    $attachment->mime_type = \sb\Files::fileToMime($attachment->filepath);
                }

            }
            $ex = explode(".", $attachment->name);
            $attachment->extension = strtolower(array_pop($ex));

            //try and guess the mime type unless it is set
            if(empty($attachment->mime_type)) {
                $attachment->mime_type = \sb\Files::extensionToMime($attachment->extension);
            }

            if($attachment->encoding == 'base64' && !isset($attachment->_base64_encoded)){
                $attachment->_base64_encoded = true;
                $attachment->contents = chunk_split(base64_encode($attachment->contents));
            }

            // Add file attachment to the message

            if($this->attachments_in_HTML == 1) {
                $message .= "--".$related_boundary.PHP_EOL;
            } else {
                $message .= "--".$mixed_boundary.PHP_EOL;
            }

            if($attachment->mime_type == 'text/calendar'){
                $message .= "Content-class: urn:content-classes:calendarmessage;".PHP_EOL;
            }

            $message .= "Content-Type: ".$attachment->mime_type.";".PHP_EOL;
            $message .= " name=".$attachment->name.PHP_EOL;

            $message .= "Content-Transfer-Encoding: ".$attachment->encoding.PHP_EOL;
            $message .= "Content-ID: <".$attachment->name.">".PHP_EOL.PHP_EOL;

            $message .=  $attachment->contents.PHP_EOL;

        }

        //end related if using body_HTML
        if($this->attachments_in_HTML == 1) {
            $message .= "--".$related_boundary."--".PHP_EOL;
        }

        //end message
        $message .="--".$mixed_boundary."--".PHP_EOL;

        $this->body = $message;
        $raw = "";
        if($this->to){
            $raw .= "To: ".$this->to.PHP_EOL;
        }
        
        $raw .= "Subject: ".$this->subject.PHP_EOL;
        $raw .= $this->_header_text .$this->body;
        return $raw;
    }
845582
public function autoStop():string
    {
        $src = '';
        $this->status === self::STATUS_IN_CELL      && $src .= $this->endCell();
        $this->status === self::STATUS_IN_ROW       && $src .= $this->endRow();
        $this->status === self::STATUS_IN_CONTAINER && $src .= $this->endContainer($this->autoContainer);
        $this->autoCols = self::DEFAULT_COLS;
        $this->autoFluid = self::DEFAULT_FLUID;
        $this->autoCurrentCol = 0;
        $this->autoStarted = false;
        return $src;
    }
726022
public function getStartCmd(): string
    {
        $cmdFormat = 'php -S %s:%d -t %s %s >/dev/null 2>&1 & echo $!';

        return sprintf($cmdFormat, $this->host, $this->port, $this->docRoot, $this->directives, $this->iniPath);
    }
327251
public function promptToStart()
    {
        $cli = $this->climate();

        $opts = [ 'y', 'n', 'v', '?' ];
        $help = [
            '[y]es  — continue to deletion phase',
            '[n]o   — cancel deletion phase',
            '[v]iew — view unused attachments',
        ];

        $input = $cli->input($this->indent.'Continue');
        $input->accept($opts, true);

        $value = $input->prompt();
        switch ($value) {
            case '?':
                $cli->br();
                $cli->out($this->indent.implode("\n".$this->indent, $help));
                $cli->br();
                return $this->promptToStart();

            case 'v':
                return 'view';

            case 'n':
                return false;

            case 'y':
            default:
                return true;
        }
    }
429263
protected function xml_start(){
		$attributes = "";
		foreach($this->attributes as $k=>$v)
			$attributes .= " ".$k."='".$v."'";

		if ($this->dload){
			if ($pos=$this->request->get_start())
				return "<rows pos='".$pos."'".$attributes.">";
			else
				return "<rows total_count='".$this->sql->get_size($this->request)."'".$attributes.">";
		}
		else
			return "<rows".$attributes.">";
	}
1043869
public function boundary()
    {
        if ($this->_boundary) {
            return $this->_boundary;
        }
        $this->_boundary = md5(uniqid(time()));

        return $this->_boundary;
    }
1223993
public function getMessage()
    {
        $result = $this->message;
        if ($result === '') {
            switch ($this->state) {
                case self::STATE_PASSED:
                case self::STATE_SKIPPED:
                    break;
                case self::STATE_WARNING:
                    $result = t('The installation precondition passed with warnings.');
                    break;
                case self::STATE_FAILED:
                default:
                    $result = t('The installation precondition failed.');
                    break;
            }
        }

        return $result;
    }
119760
public function description(): string
    {
        if (0 === $this->offset) {
            return 'limited to ' . $this->count . ' elements';
        }

        if (-1 === $this->count) {
            return 'skipped until offset ' . $this->offset;
        }

        return 'limited to ' . $this->count
         . ' elements starting from offset ' . $this->offset;
    }
611925
public function getFullText() : string {
        $start = $this->getFullStart();
        $end = $this->getEndPosition();

        $fileContents = $this->getFileContents();
        return \substr($fileContents, $start, $end - $start);

    }
889488
public function getMsgBody()
    {
        $body = null;

        if (!empty($this->_parts)) {
            if (count($this->_parts) > 1) {
                foreach ($this->_parts as $part) {
                    if ($part->contentType != Content::CT_TEXT_PLAIN && $this->getHeaders()->getMessageContentType() == Content::CT_MULTIPART_ALTERNATIVE) {
                        $body = $part->getContentDecode();
                        break;
                    }

                    $body .= PHP_EOL.$part->getContentDecode();
                }
            } else {
                $body = $this->_parts[0]->getContentDecode();
            }
        }

        return $body;
    }
435815
public function getStarted()
    {
        $rtn    = $this->data['started'];

        if (!empty($rtn)) {
            $rtn    = new \DateTime($rtn);
        }
        
        return $rtn;
    }
1361249
public function getSummaryMessage(): string {
        if ($main = $this->getMainMessage()) {
            return $main;
        } elseif ($this->isValid()) {
            return $this->translate('Validation succeeded.');
        } else {
            return $this->translate('Validation failed.');
        }
    }
1102524
public function generateBody()
    {
        $result = $this->addHeadersSection( $this->message ) . ezcMailTools::lineBreak();
        for ( $i = 0; $i < count( $this->recipients ); $i++ )
        {
            $result .= $this->addHeadersSection( $this->recipients[$i] ) . ezcMailTools::lineBreak();
        }
        return $result;
    }
1089093
public static function getStartEndMonth() : array
    {
        date_default_timezone_set('UTC');
        $begin = mktime(0, 0, 0, date('m'), 1, date("Y"));
        $end = mktime(23, 59, 59, date('m'), date("t"), date("Y"));
        return [
            'begin' => $begin,
            'end' => $end
        ];
    }
662798
public function getRangeString()
    {
        $dateStart = $this->getDateStart();
        $dateEnd   = $this->getDateEnd();

        return $dateStart->toString("Y-m-d") . "," . $dateEnd->toString("Y-m-d");
    }
433444
public function getOrigBody()
    {
        $_headers = $this->message->headers();
        $headers  = array();

        if ($_headers['Content-Transfer-Encoding']
            && stripos($_headers['Content-Type'], 'multipart') === false
        ) {
            $headers[] = 'Content-Transfer-Encoding: ' . $_headers['Content-Transfer-Encoding'];
        }
        $headers[] = 'Content-Type: ' . $_headers['Content-Type'];

        return implode("\r\n", $headers) . "\r\n\r\n" . $this->body;
    }