top example

/** * Fetch a message * * @param int $id number of message * @return Zend_Mail_Message * @throws Zend_Mail_Protocol_Exception */
    public function getMessage($id)
    {
        $bodyLines = 0;
        $message = $this->_protocol->top($id$bodyLines, true);

        return new $this->_messageClass(array('handler' => $this, 'id' => $id, 'headers' => $message,
                                              'noToplines' => $bodyLines < 1));
    }

    /* * Get raw header of message or part * * @param int $id number of message * @param null|array|string $part path to part or null for messsage header * @param int $topLines include this many lines with header (after an empty line) * @return string raw header * @throws Zend_Mail_Protocol_Exception * @throws Zend_Mail_Storage_Exception */
 else {
                $count = $this->pass($pass);
                if( (!$count) || ($count == -1) ) {
                    // Preserve the error generated by last() and pass()                     return false;
                } else
                    return $count;
            }
        }
    }

    function top ($msgNum$numLines = "0") {
        // Gets the header and first $numLines of the msg body         // returns data in an array with each returned line being         // an array element. If $numLines is empty, returns         // only the header information, and none of the body.
        if(!isset($this->FP)) {
            $this->ERROR = "POP3 top: " . _("No connection to server");
            return false;
        }
        $this->update_timer();

        
|| $this->waitUntil > ($now = $this->clock->now())
            || !$checkpoint->acquire($now)
        ) {
            return;
        }

        $startTime = $checkpoint->from();
        $lastTime = $checkpoint->time();
        $lastIndex = $checkpoint->index();
        $heap = $this->heap($lastTime$startTime);

        while (!$heap->isEmpty() && $heap->top()[0] <= $now) {
            /** @var \DateTimeImmutable $time */
            /** @var int $index */
            /** @var RecurringMessage $recurringMessage */
            [$time$index$recurringMessage] = $heap->extract();
            $id = $recurringMessage->getId();
            $trigger = $recurringMessage->getTrigger();
            $yield = true;

            if ($time < $lastTime) {
                $time = $lastTime;
                $yield = false;
            }
Home | Imprint | This part of the site doesn't use cookies.