Remove useless NewInstance

Bugfix: BodyStructure->SearchCharset return value
This commit is contained in:
djmaze 2020-05-08 11:49:18 +02:00
parent 82e560bc53
commit 693e0f4c10
61 changed files with 802 additions and 1345 deletions

View file

@ -43,13 +43,13 @@ class Memcache implements \MailSo\Cache\DriverInterface
*/
private $sKeyPrefix;
private function __construct(string $sHost = '127.0.0.1', int $iPost = 11211, int $iExpire = 43200, string $sKeyPrefix = '')
function __construct(string $sHost = '127.0.0.1', int $iPost = 11211, int $iExpire = 43200, string $sKeyPrefix = '')
{
$this->sHost = $sHost;
$this->iPost = $iPost;
$this->iExpire = 0 < $iExpire ? $iExpire : 43200;
$this->oMem = new \Memcache();
$this->oMem = new \Memcache;
if (!$this->oMem->connect($this->sHost, $this->iPost))
{
$this->oMem = null;
@ -63,11 +63,6 @@ class Memcache implements \MailSo\Cache\DriverInterface
}
}
public static function NewInstance(string $sHost = '127.0.0.1', int $iPost = 11211, int $iExpire = 43200, string $sKeyPrefix = '') : self
{
return new self($sHost, $iPost, $iExpire, $sKeyPrefix);
}
public function Set(string $sKey, string $sValue) : bool
{
return $this->oMem ? $this->oMem->set($this->generateCachedKey($sKey), $sValue, 0, $this->iExpire) : false;