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/rospirotorg.ru/bitrix/modules/seo/lib/businesssuite/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/seo/lib/businesssuite/service.php
<?php

namespace Bitrix\Seo\BusinessSuite;


use Bitrix\Seo\Retargeting;
use Bitrix\Seo\BusinessSuite\AuthAdapter\Facebook\BusinessAuthAdapter;

class Service implements Retargeting\IService, IInternalService
{
	public const GROUP = 'business';
	public const FACEBOOK_TYPE = "facebook";
	public const INSTAGRAM_TYPE = 'instagram';

	/** @var BusinessAuthAdapter[] $authAdapterPool*/
	private static $authAdapterPool = [];

	private function __construct()
	{}

	private function __clone()
	{}

	/**
	 * @return string
	 */
	public static function getMethodPrefix() : string
	{
		return 'business';
	}

	/**
	 * @param string $type
	 *
	 * @return Config
	 */
	public function getConfig(string $type): Config
	{
		return Config::create($type)->setService($this);
	}

	/**
	 * @param string $type
	 *
	 * @return Extension
	 */
	public function getExtension(string $type) : Extension
	{
		return Extension::create($type)->setService($this);
	}

	/**
	 * @param string $type
	 *
	 * @return Conversion
	 */
	public function getConversion(string $type) : Conversion
	{
		return Conversion::create($type)->setService($this);
	}

	/**
	 * @param string $type
	 *
	 * @return Account
	 */
	public function getAccount(string $type) : Account
	{
		return Account::create($type)->setService($this);
	}

	/**
	 * @return static
	 */
	public static function getInstance(): self
	{
		static $instance;
		if (!$instance)
		{
			$instance = new self();
		}

		return $instance;
	}

	/**
	 * @param string $type
	 *
	 * @return string
	 */
	public static function getEngineCode($type): string
	{
		return self::GROUP.'.'.$type;
	}

	/**
	 * @return array
	 */
	public static function getTypes(): array
	{
		return [self::FACEBOOK_TYPE, self::INSTAGRAM_TYPE];
	}

	/**
	 * @param string $type
	 *
	 * @return BusinessAuthAdapter
	 * @throws \Bitrix\Main\SystemException
	 */
	public static function getAuthAdapter($type) : BusinessAuthAdapter
	{
		if (!array_key_exists($type,static::$authAdapterPool))
		{
			static::$authAdapterPool[$type] = BusinessAuthAdapter::create($type)->setService(static::getInstance());
		}

		return static::$authAdapterPool[$type];
	}

	/**
	 * @inheritDoc
	 */
	public static function getTypeByEngine(string $engineCode): ?string
	{
		foreach (static::getTypes() as $type)
		{
			if($engineCode == static::getEngineCode($type))
			{

				return $type;
			}
		}

		return null;
	}

	/**
	 * @inheritDoc
	 */
	public static function canUseAsInternal(): bool
	{
		return true;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit