uawdijnntqw1x1x1
IP : 3.145.71.192
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
/
yar.axolotls.ru
/
1c9cb
/
..
/
bitrix
/
modules
/
location
/
lib
/
common
/
pool.php
/
/
<?php namespace Bitrix\Location\Common; /** * Class CachePool * @package Bitrix\Location\Common */ class Pool { /** @var int */ protected $poolSize = 0; /** @var array */ protected $items = []; /** * CachePool constructor. * @param int $poolSize * @param array $items */ public function __construct(int $poolSize) { $this->poolSize = $poolSize; } /** * @return array */ public function getItems(): array { return $this->items; } public function cleanItems(): void { $this->items = []; } /** * @param array $items */ public function setItems(array $items): void { $this->items = $items; } /** * @param string $index * @return mixed */ public function getItem(string $index) { $result = null; if(isset($this->items[$index])) { $result = $this->items[$index]; //come up used items unset($this->items[$index]); $this->items[$index] = $result; } return $result; } /** * @param string $index * @param mixed $value */ public function addItem(string $index, $value): void { $this->items[$index] = $value; $delta = count($this->items) - $this->poolSize; if($delta > 0) { $this->items = $this->decreaseSize($delta, $this->items); } } /** * @return int */ public function getItemsCount(): int { return count($this->items); } /** * @param string $index */ public function deleteItem(string $index): void { if(isset($this->items[$index])) { unset($this->items[$index]); } } /** * @param int $delta * @param array $items * @return array */ protected function decreaseSize(int $delta, array $items): array { if($delta <= 0 || count($items) <= 0) { return $items; } do { reset($items); unset($items[key($items)]); $delta--; } while($delta > 0); return $items; } }
/var/www/axolotl/data/www/yar.axolotls.ru/1c9cb/../bitrix/modules/location/lib/common/pool.php