Lines Matching refs:self
15 if (($this->fp = @fsockopen(self::HOST, self::PORT)) === false) {
20 public static function getConnection(): self
23 static::$instance = new self();
59 if (time() - $start > self::TIMEOUT) {
86 if (time() - $start > self::TIMEOUT) {
119 public static function login(string $user): self
121 $self = new self();
122 $self->mailConnecter->send(self::LOGIN, 'LOGIN '.$user.' '.self::PASSWORD);
123 if (!$self->mailConnecter->isSuccess(self::LOGIN)) {
124 $self->mailConnecter->fail('login failed');
126 return $self;
131 $this->mailConnecter->send(self::LOGOUT, 'LOGOUT');
132 if (!$this->mailConnecter->isSuccess(self::LOGOUT)) {
139 $this->mailConnecter->send(self::SELECT_MAILBOX, 'SELECT "INBOX"');
140 if (!$this->mailConnecter->isSuccess(self::SELECT_MAILBOX)) {
144 $this->mailConnecter->send(self::SEARCH, "UID SEARCH SUBJECT \"{$subject}\"");
145 $res = $this->mailConnecter->getResponse(self::SEARCH);
160 $this->mailConnecter->send(self::FETCH_HEADERS, "UID FETCH {$uid} (BODY[HEADER])");
161 $res = $this->mailConnecter->getResponse(self::FETCH_HEADERS, true);
173 … if (!$key || !$val || $val === self::FETCH_HEADERS.' OK UID completed' || $val === ')') {
184 $this->mailConnecter->send(self::FETCH_BODY, "UID FETCH {$uid} (BODY[TEXT])");
185 $body = $this->mailConnecter->getResponse(self::FETCH_BODY, true);
197 … fn($uid) => $this->mailConnecter->send(self::DELETE, "UID STORE {$uid} +FLAGS (\\Deleted)"),
200 $this->mailConnecter->send(self::EXPUNGE, 'EXPUNGE');