uawdijnntqw1x1x1
IP : 18.188.103.42
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
rostov.axolotls.ru
/
bitrix
/
modules
/
landing
/
lib
/
urlrewrite.php
/
/
<?php namespace Bitrix\Landing; use Bitrix\Landing\Internals\SiteTable; use \Bitrix\Landing\Internals\UrlRewriteTable; class UrlRewrite { /** * Set rule for the site. * @param int $siteId Site id. * @param string $rule Rule. * @param int $landingId Landing id. If empty then remove. * @return void */ public static function set($siteId, $rule, $landingId = null) { $rule = trim($rule); // check for exist $check = SiteTable::getList([ 'select' => [ 'ID' ], 'filter' => [ 'ID' => $siteId, '=DELETED' => ['Y', 'N'] ] ])->fetch(); if (!$check) { return; } if ($landingId) { $check = SiteTable::getList([ 'select' => [ 'ID' ], 'filter' => [ 'ID' => $landingId, '=DELETED' => ['Y', 'N'] ] ])->fetch(); if (!$check) { return; } } // set or unset $filter = [ 'SITE_ID' => $siteId, '=RULE' => $rule ]; if ($landingId) { $filter['!LANDING_ID'] = $landingId; } $res = UrlRewriteTable::getList([ 'select' => [ 'ID' ], 'filter' => $filter ]); if ($row = $res->fetch()) { if ($landingId) { UrlRewriteTable::update($row['ID'], [ 'LANDING_ID' => $landingId ]); } else { UrlRewriteTable::delete( $row['ID'] ); } } else if ($landingId) { UrlRewriteTable::add([ 'SITE_ID' => $siteId, 'RULE' => $rule, 'LANDING_ID' => $landingId ]); } } /** * Unset rule for the site. * @param int $siteId Site id. * @param string $rule Rule. * @return void */ public static function remove($siteId, $rule) { self::set($siteId, $rule); } /** * Matching rule for url. * @param int $siteId Site id. * @param string $url Some url. * @return int Landing id. */ public static function matchUrl($siteId, $url) { // } /** * Clear rules for one site. * @param int $siteId Site id. * @return void */ public static function removeForSite($siteId) { $res = UrlRewriteTable::getList([ 'select' => [ 'ID' ], 'filter' => [ 'SITE_ID' => $siteId ] ]); while ($row = $res->fetch()) { UrlRewriteTable::delete($row['ID']); } } /** * Clear rules for one site. * @param int $landingId Landing id. * @return void */ public static function removeForLanding($landingId) { $res = UrlRewriteTable::getList([ 'select' => [ 'ID' ], 'filter' => [ 'LANDING_ID' => $landingId ] ]); while ($row = $res->fetch()) { UrlRewriteTable::delete($row['ID']); } } }
/var/www/axolotl/data/www/rostov.axolotls.ru/bitrix/modules/landing/lib/urlrewrite.php