Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
convert spaces to tabs
  • Loading branch information
Cristi Cotet committed Dec 22, 2017
commit c4878fbca57156abfea503f9bceb48429e6630b2
70 changes: 35 additions & 35 deletions src/PhpImap/Mailbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -793,41 +793,41 @@ public function getMailboxes($search = "*") {
}
return $arr;
}
/**
* Get folders list
* @param string $search
* @return array
*/
public function getSubscribedMailboxes($search = "*") {
$arr = [];
if($t = imap_getsubscribed($this->getImapStream(), $this->imapPath, $search)) {
foreach($t as $item) {
$arr[] = [
"fullpath" => $item->name,
"attributes" => $item->attributes,
"delimiter" => $item->delimiter,
"shortpath" => substr($item->name, strpos($item->name, '}') + 1),
];
}
}
return $arr;
}

/**
* @param $mailbox
* @throws Exception
*/
public function subscribeMailbox($mailbox) {
$this->imap('subscribe', $this->imapPath . '.' . $mailbox);
}

/**
* @param $mailbox
* @throws Exception
*/
public function unsubscribeMailbox($mailbox) {
$this->imap('unsubscribe', $this->imapPath . '.' . $mailbox);
}
/**
* Get folders list
* @param string $search
* @return array
*/
public function getSubscribedMailboxes($search = "*") {
$arr = [];
if($t = imap_getsubscribed($this->getImapStream(), $this->imapPath, $search)) {
foreach($t as $item) {
$arr[] = [
"fullpath" => $item->name,
"attributes" => $item->attributes,
"delimiter" => $item->delimiter,
"shortpath" => substr($item->name, strpos($item->name, '}') + 1),
];
}
}
return $arr;
}

/**
* @param $mailbox
* @throws Exception
*/
public function subscribeMailbox($mailbox) {
$this->imap('subscribe', $this->imapPath . '.' . $mailbox);
}

/**
* @param $mailbox
* @throws Exception
*/
public function unsubscribeMailbox($mailbox) {
$this->imap('unsubscribe', $this->imapPath . '.' . $mailbox);
}
/**
* Call IMAP extension function call wrapped with utf7 args conversion & errors handling
*
Expand Down