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/yandex.market/lib/template/functions/ |
Upload File : |
<?php namespace Yandex\Market\Template\Functions; use Bitrix\Main; use Bitrix\Iblock; use Yandex\Market; class Fabric { protected static $internalCache = []; public static function createInstance($functionName) { if (static::isInternal($functionName)) { $result = static::getInternal($functionName); } else { $iblockFunction = Iblock\Template\Functions\Fabric::createInstance($functionName); if (static::isDummy($iblockFunction) && Registry::isExists($functionName)) { $result = static::getInternal($functionName); } else { $result = $iblockFunction; } } return $result; } protected static function isInternal($functionName) { return isset(static::$internalCache[$functionName]); } protected static function getInternal($functionName) { if (!isset(static::$internalCache[$functionName])) { static::$internalCache[$functionName] = Registry::createInstance($functionName); } return static::$internalCache[$functionName]; } protected static function isDummy($function) { return !is_subclass_of($function, Iblock\Template\Functions\FunctionBase::class); } }