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/trading/entity/common/ |
Upload File : |
<?php namespace Yandex\Market\Trading\Entity\Common; use Yandex\Market; use Bitrix\Main; class Route extends Market\Trading\Entity\Reference\Route { public function getScriptPath() { return $this->getPublicBasePath() . '/index.php'; } public function getPublicPath($serviceCode, $urlId) { $serviceCodeSanitized = str_replace(':', '-', $serviceCode); return $this->getPublicBasePath() . '/' . $serviceCodeSanitized . '/' . $urlId; } public function installPublic($siteId) { $rule = $this->getUrlRewriteRule(); Main\UrlRewriter::add($siteId, $rule); } public function uninstallPublic($siteId) { $rule = $this->getUrlRewriteRule(); unset($rule['RULE']); Main\UrlRewriter::delete($siteId, $rule); } protected function getUrlRewriteRule() { $path = $this->getPublicBasePath(); $scriptPath = $this->getScriptPath(); return [ 'CONDITION' => '#^' . $path . '/#', 'RULE' => '', 'ID' => '', 'PATH' => $scriptPath, ]; } protected function getPublicBasePath() { $moduleName = Market\Config::getModuleName(); return BX_ROOT . '/services/' . $moduleName . '/trading'; } }