stats class added
This commit is contained in:
parent
12c9b73147
commit
13b462e079
|
@ -90,6 +90,16 @@ class Connection
|
|||
return $this->stream;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Server
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getServer()
|
||||
{
|
||||
return $this->server;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Connection
|
||||
*
|
||||
|
|
33
src/Core/Stats.php
Normal file
33
src/Core/Stats.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
/**
|
||||
* @author clivern <hello@clivern.com>
|
||||
*/
|
||||
|
||||
namespace Clivern\Imap\Core;
|
||||
use Clivern\Imap\Core\Connection;
|
||||
|
||||
/**
|
||||
* Stats Class
|
||||
*
|
||||
* @package Clivern\Imap\Core
|
||||
*/
|
||||
class Stats
|
||||
{
|
||||
protected $connection;
|
||||
|
||||
public function __construct(Connection $connection)
|
||||
{
|
||||
$this->connection = $connection;
|
||||
}
|
||||
|
||||
public function getQuota($folder = 'INBOX')
|
||||
{
|
||||
return imap_get_quotaroot($this->connection->getStream(), $folder);
|
||||
}
|
||||
|
||||
|
||||
public function getStatus($folder = 'INBOX', $flag = SA_ALL)
|
||||
{
|
||||
return imap_status($this->connection->getStream(), "{" . $this->connection->getServer() . "}" . $folder, $flag);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue