uawdijnntqw1x1x1
IP : 216.73.216.163
Hostname : yjpwxulqtt
Kernel : Linux yjpwxulqtt 5.15.0-126-generic #136-Ubuntu SMP Wed Nov 6 10:38:22 UTC 2024 x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,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,exec,system,passthru,shell_exec,proc_open,popen
OS : Linux
PATH:
/
home
/
user
/
web
/
pansionat-v-yaroslavle.ru
/
public_html
/
bitrix
/
modules
/
main
/
lib
/
search
/
mapbuilder.php
/
/
<?php namespace Bitrix\Main\Search; class MapBuilder { /** @var array [search_token => true] */ protected $tokens = array(); /** * StringBuilder constructor. */ public function __construct() { } /** * Creates instance of the StringBuilder * @return static */ public static function create() { return new static(); } /** * Adds arbitrary integer content to the builder. * @param string $token Arbitrary string. * @return $this. */ public function addText($token) { $token = (string)$token; if($token == '') return $this; $value = Content::prepareStringToken($token); $this->tokens[$value] = true; return $this; } /** * Adds digit content to the builder. * @param int $token . * @return $this. */ public function addInteger($token) { if (!Content::isIntegerToken($token)) return $this; $token = Content::prepareIntegerToken($token); $this->tokens[$token] = true; return $this; } /** * Adds phone number to the builder. * @param string $phone Phone number. * @return $this */ public function addPhone($phone) { $phone = (string)$phone; $value = preg_replace("/[^0-9\#\*]/i", "", $phone); if($value == '') return $this; $altPhone = str_replace(' ', '', $phone); $this->tokens[$altPhone] = true; $length = strlen($value); if($length >= 10 && substr($value, 0, 1) === '7') { $altPhone = '8'.substr($value, 1); $this->tokens[$altPhone] = true; } //Right bound. We will stop when 3 digits are left. $bound = $length - 2; if($bound > 0) { for($i = 0; $i < $bound; $i++) { $key = substr($value, $i); $this->tokens[$key] = true; } } return $this; } /** * Adds email to the builder. * @param string $email Email. * @return $this */ public function addEmail($email) { if($email === '') { return $this; } $keys = preg_split('/\W+/', $email, -1, PREG_SPLIT_NO_EMPTY); foreach($keys as $key) { $key = Content::prepareStringToken($key); if(!isset($this->tokens[$key])) { $this->tokens[$key] = true; } } $key = Content::prepareStringToken($email); $this->tokens[$key] = true; return $this; } /** * Adds full user name to the builder. * @param array|int $userId Id of the user. * @return $this */ public function addUser($userId) { if(empty($userId)) { return $this; } $orm = \Bitrix\Main\UserTable::getList(Array( 'select' => array('ID', 'LOGIN', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'TITLE', 'EMAIL', 'PERSONAL_MOBILE'), 'filter' => array('=ID' => $userId) )); while($user = $orm->fetch()) { $value = \CUser::FormatName( \CSite::GetNameFormat(), $user, true, false ); $value = Content::prepareStringToken($value); if($value != '') { $this->tokens[$value] = true; } self::addPhone($user['PERSONAL_MOBILE']); self::addEmail($user['EMAIL']); } return $this; } /** * Builds search string. * @return string */ public function build() { $tokens = Array(); foreach ($this->tokens as $token => $result) { if (strlen($token) >= \CSQLWhere::GetMinTokenSize()) { $tokens[$token] = $result; } } return implode(" ", array_keys($tokens)); } }
/home/user/web/pansionat-v-yaroslavle.ru/public_html/bitrix/modules/main/lib/search/mapbuilder.php