mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 07:27:04 +03:00
Code refactoring
This commit is contained in:
parent
6acba46339
commit
819ba4a2ef
6 changed files with 94 additions and 47 deletions
|
|
@ -35,8 +35,6 @@ class Service
|
|||
\ini_set('display_errors', 1);
|
||||
}
|
||||
|
||||
\RainLoop\Api::SetupDefaultMailSoConfig();
|
||||
|
||||
$sServer = \trim($this->oActions->Config()->Get('security', 'custom_server_signature', ''));
|
||||
if (0 < \strlen($sServer))
|
||||
{
|
||||
|
|
@ -54,20 +52,43 @@ class Service
|
|||
@\header('Location: https://'.$this->oHttp->GetHost(false, false).$this->oHttp->GetUrl(), true);
|
||||
exit();
|
||||
}
|
||||
|
||||
$this->localHandle();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \RainLoop\Service
|
||||
* @return bool
|
||||
*/
|
||||
public static function NewInstance()
|
||||
public function RunResult()
|
||||
{
|
||||
return new self();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @staticvar bool $bOne
|
||||
* @return bool
|
||||
*/
|
||||
public static function Handle()
|
||||
{
|
||||
static $bOne = null;
|
||||
if (null === $bOne)
|
||||
{
|
||||
$oService = null;
|
||||
if (\class_exists('MailSo\Version'))
|
||||
{
|
||||
$oService = new self();
|
||||
}
|
||||
|
||||
$bOne = $oService->RunResult();
|
||||
}
|
||||
|
||||
return $bOne;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \RainLoop\Service
|
||||
*/
|
||||
public function Handle()
|
||||
private function localHandle()
|
||||
{
|
||||
if (!\class_exists('MailSo\Version'))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue