Timeout optimizations

This commit is contained in:
RainLoop Team 2014-04-27 21:03:55 +04:00
parent ba645f5614
commit d476a6a3ac
3 changed files with 13 additions and 9 deletions

View file

@ -829,17 +829,19 @@ class Utils
* *
* @param int &$iTimer * @param int &$iTimer
* @param int $iTimeToReset = 15 * @param int $iTimeToReset = 15
* @param int $iTimeToAdd = 30 * @param int $iTimeToAdd = 120
* *
* @return bool * @return bool
*/ */
public static function ResetTimeLimit(&$iTimer, $iTimeToReset = 15, $iTimeToAdd = 30) public static function ResetTimeLimit(&$iTimer, $iTimeToReset = 15, $iTimeToAdd = 120)
{ {
static $bValidateAction = null; static $bValidateAction = null;
if (null === $bValidateAction) if (null === $bValidateAction)
{ {
$bValidateAction = !((bool) \ini_get('safe_mode')) && $sSafeMode = \strtolower(\trim(@\ini_get('safe_mode')));
\MailSo\Base\Utils::FunctionExistsAndEnabled('set_time_limit'); $bSafeMode = 'on' === $sSafeMode || '1' === $sSafeMode || 'true' === $sSafeMode;
$bValidateAction = !$bSafeMode && \MailSo\Base\Utils::FunctionExistsAndEnabled('set_time_limit');
} }
if ($bValidateAction) if ($bValidateAction)

View file

@ -26,7 +26,7 @@ class MailClient
$this->oLogger = null; $this->oLogger = null;
$this->oImapClient = \MailSo\Imap\ImapClient::NewInstance(); $this->oImapClient = \MailSo\Imap\ImapClient::NewInstance();
$this->oImapClient->SetTimeOuts(10, 30); // TODO $this->oImapClient->SetTimeOuts(10, 300); // TODO
} }
/** /**
@ -1927,7 +1927,7 @@ class MailClient
{ {
// TODO // TODO
throw new \MailSo\Mail\Exceptions\RuntimeException( throw new \MailSo\Mail\Exceptions\RuntimeException(
'New folder name contain delimiter'); 'New folder name contains delimiter');
} }
$sFullNameRawToCreate = $sFolderParentFullNameRaw.$sFullNameRawToCreate; $sFullNameRawToCreate = $sFolderParentFullNameRaw.$sFullNameRawToCreate;
@ -2019,8 +2019,7 @@ class MailClient
if (0 < \strlen($sDelimiter) && false !== \strpos($sNewFolderFullNameRaw, $sDelimiter)) if (0 < \strlen($sDelimiter) && false !== \strpos($sNewFolderFullNameRaw, $sDelimiter))
{ {
// TODO // TODO
throw new \MailSo\Mail\Exceptions\RuntimeException( throw new \MailSo\Mail\Exceptions\RuntimeException('New folder name contains delimiter');
'New folder name contain delimiter');
} }
$sFolderParentFullNameRaw = false === $iLast ? '' : \substr($sPrevFolderFullNameRaw, 0, $iLast + 1); $sFolderParentFullNameRaw = false === $iLast ? '' : \substr($sPrevFolderFullNameRaw, 0, $iLast + 1);

View file

@ -460,7 +460,10 @@ class Client {
protected function curlRequest($url, $settings) { protected function curlRequest($url, $settings) {
$curl = curl_init($url); $curl = curl_init($url);
if (ini_get('open_basedir') === '' && ini_get('safe_mode' === 'Off')) $sSafeMode = strtolower(trim(@ini_get('safe_mode')));
$bSafeMode = 'on' === $sSafeMode || '1' === $sSafeMode;
if (!$bSafeMode && ini_get('open_basedir') === '')
{ {
curl_setopt_array($curl, $settings); curl_setopt_array($curl, $settings);
$data = curl_exec($curl); $data = curl_exec($curl);