Skip to content

Commit 164992a

Browse files
committed
working with a resource now checks the connection on every connect
1 parent 4d2f53c commit 164992a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/IMAP/Client.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ public function openFolder(Folder $folder, $attempts = 3) {
317317
if ($this->activeFolder !== $folder) {
318318
$this->activeFolder = $folder;
319319

320-
imap_reopen($this->connection, $folder->path, $this->getOptions(), $attempts);
320+
imap_reopen($this->getConnection(), $folder->path, $this->getOptions(), $attempts);
321321
}
322322
}
323323

@@ -330,7 +330,7 @@ public function openFolder(Folder $folder, $attempts = 3) {
330330
*/
331331
public function createFolder($name) {
332332
$this->checkConnection();
333-
return imap_createmailbox($this->connection, $this->getAddress() . imap_utf7_encode($name));
333+
return imap_createmailbox($this->getConnection(), $this->getAddress() . imap_utf7_encode($name));
334334
}
335335

336336
/**
@@ -343,7 +343,7 @@ public function createFolder($name) {
343343
*/
344344
public function renameFolder($old_name, $new_name) {
345345
$this->checkConnection();
346-
return imap_renamemailbox($this->connection, $this->getAddress() . imap_utf7_encode($old_name), $this->getAddress() . imap_utf7_encode($new_name));
346+
return imap_renamemailbox($this->getConnection(), $this->getAddress() . imap_utf7_encode($old_name), $this->getAddress() . imap_utf7_encode($new_name));
347347
}
348348

349349
/**
@@ -355,7 +355,7 @@ public function renameFolder($old_name, $new_name) {
355355
*/
356356
public function deleteFolder($name) {
357357
$this->checkConnection();
358-
return imap_deletemailbox($this->connection, $this->getAddress() . imap_utf7_encode($name));
358+
return imap_deletemailbox($this->getConnection(), $this->getAddress() . imap_utf7_encode($name));
359359
}
360360

361361
/**
@@ -459,7 +459,7 @@ protected function getAddress() {
459459
*/
460460
public function getQuota() {
461461
$this->checkConnection();
462-
return imap_get_quota($this->connection, 'user.'.$this->username);
462+
return imap_get_quota($this->getConnection(), 'user.'.$this->username);
463463
}
464464

465465
/**
@@ -472,7 +472,7 @@ public function getQuota() {
472472
*/
473473
public function getQuotaRoot($quota_root = 'INBOX') {
474474
$this->checkConnection();
475-
return imap_get_quotaroot($this->connection, $quota_root);
475+
return imap_get_quotaroot($this->getConnection(), $quota_root);
476476
}
477477

478478
/**

0 commit comments

Comments
 (0)