Privacy/GDPR friendly version (removed: Social, Gravatar, Facebook, Google, Twitter, DropBox, OwnCloud)

Also removed: POP3, OAuth2 and update feature
Added: admin password_hash/password_verify
Requires: PHP 7.3+
Replaced: CRLF with LF
Replaced: pclZip with ZipArchive
This commit is contained in:
djmaze 2020-03-09 17:04:17 +01:00
parent 15ceddc202
commit 2cada68f41
293 changed files with 23728 additions and 85420 deletions

View file

@ -36,10 +36,7 @@ class CacheClient
$this->sCacheIndex = '';
}
/**
* @return \MailSo\Cache\CacheClient
*/
public static function NewInstance()
public static function NewInstance() : self
{
return new self();
}
@ -47,50 +44,40 @@ class CacheClient
/**
* @param string $sKey
* @param string $sValue
*
* @return bool
*/
public function Set($sKey, $sValue)
public function Set($sKey, $sValue) : bool
{
return $this->oDriver ? $this->oDriver->Set($sKey.$this->sCacheIndex, $sValue) : false;
}
/**
* @param string $sKey
*
* @return bool
*/
public function SetTimer($sKey)
public function SetTimer($sKey) : bool
{
return $this->Set($sKey.'/TIMER', time());
}
/**
* @param string $sKey
*
* @return bool
*/
public function SetLock($sKey)
public function SetLock($sKey) : bool
{
return $this->Set($sKey.'/LOCK', '1');
}
/**
* @param string $sKey
*
* @return bool
*/
public function RemoveLock($sKey)
public function RemoveLock($sKey) : bool
{
return $this->Set($sKey.'/LOCK', '0');
}
/**
* @param string $sKey
*
* @return bool
*/
public function GetLock($sKey)
public function GetLock($sKey) : bool
{
return '1' === $this->Get($sKey.'/LOCK');
}
@ -137,10 +124,8 @@ class CacheClient
/**
* @param string $sKey
*
* @return \MailSo\Cache\CacheClient
*/
public function Delete($sKey)
public function Delete($sKey) : self
{
if ($this->oDriver)
{
@ -152,10 +137,8 @@ class CacheClient
/**
* @param \MailSo\Cache\DriverInterface $oDriver
*
* @return \MailSo\Cache\CacheClient
*/
public function SetDriver(\MailSo\Cache\DriverInterface $oDriver)
public function SetDriver(\MailSo\Cache\DriverInterface $oDriver) : self
{
$this->oDriver = $oDriver;
@ -164,28 +147,21 @@ class CacheClient
/**
* @param int $iTimeToClearInHours = 24
*
* @return bool
*/
public function GC($iTimeToClearInHours = 24)
public function GC($iTimeToClearInHours = 24) : bool
{
return $this->oDriver ? $this->oDriver->GC($iTimeToClearInHours) : false;
}
/**
* @return bool
*/
public function IsInited()
public function IsInited() : bool
{
return $this->oDriver instanceof \MailSo\Cache\DriverInterface;
}
/**
* @param string $sCacheIndex
*
* @return \MailSo\Cache\CacheClient
*/
public function SetCacheIndex($sCacheIndex)
public function SetCacheIndex($sCacheIndex) : self
{
$this->sCacheIndex = 0 < \strlen($sCacheIndex) ? "\x0".$sCacheIndex : '';
@ -194,10 +170,8 @@ class CacheClient
/**
* @param bool $bCache = false
*
* @return bool
*/
public function Verify($bCache = false)
public function Verify($bCache = false) : bool
{
if ($this->oDriver)
{

View file

@ -1,48 +1,46 @@
<?php
/*
* This file is part of MailSo.
*
* (c) 2014 Usenko Timur
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace MailSo\Cache;
/**
* @category MailSo
* @package Cache
*/
interface DriverInterface
{
/**
* @param string $sKey
* @param string $sValue
*
* @return bool
*/
public function Set($sKey, $sValue);
/**
* @param string $sKey
*
* @return string
*/
public function Get($sKey);
/**
* @param string $sKey
*
* @return void
*/
public function Delete($sKey);
/**
* @param int $iTimeToClearInHours = 24
*
* @return bool
*/
public function GC($iTimeToClearInHours = 24);
}
<?php
/*
* This file is part of MailSo.
*
* (c) 2014 Usenko Timur
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace MailSo\Cache;
/**
* @category MailSo
* @package Cache
*/
interface DriverInterface
{
/**
* @param string $sKey
* @param string $sValue
*/
public function Set($sKey, $sValue) : bool;
/**
* @param string $sKey
*
* @return string
*/
public function Get($sKey);
/**
* @param string $sKey
*
* @return void
*/
public function Delete($sKey);
/**
* @param int $iTimeToClearInHours = 24
*
* @return bool
*/
public function GC($iTimeToClearInHours = 24);
}

View file

@ -51,10 +51,8 @@ class APC implements \MailSo\Cache\DriverInterface
/**
* @param string $sKey
* @param string $sValue
*
* @return bool
*/
public function Set($sKey, $sValue)
public function Set($sKey, $sValue) : bool
{
return \apc_store($this->generateCachedKey($sKey), (string) $sValue);
}

View file

@ -65,10 +65,8 @@ class File implements \MailSo\Cache\DriverInterface
/**
* @param string $sKey
* @param string $sValue
*
* @return bool
*/
public function Set($sKey, $sValue)
public function Set($sKey, $sValue) : bool
{
$sPath = $this->generateCachedFileName($sKey, true);
return '' === $sPath ? false : false !== \file_put_contents($sPath, $sValue);

View file

@ -85,10 +85,8 @@ class Memcache implements \MailSo\Cache\DriverInterface
/**
* @param string $sKey
* @param string $sValue
*
* @return bool
*/
public function Set($sKey, $sValue)
public function Set($sKey, $sValue) : bool
{
return $this->oMem ? $this->oMem->set($this->generateCachedKey($sKey), $sValue, 0, $this->iExpire) : false;
}

View file

@ -101,10 +101,8 @@ class Redis implements \MailSo\Cache\DriverInterface
/**
* @param string $sKey
* @param string $sValue
*
* @return bool
*/
public function Set($sKey, $sValue)
public function Set($sKey, $sValue) : bool
{
return $this->oRedis ? $this->oRedis->setex($this->generateCachedKey($sKey), $this->iExpire, $sValue) : false;
}