uawdijnntqw1x1x1
IP : 3.145.52.101
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
/
perm.axolotls.ru
/
bitrix
/
modules
/
timeman
/
lib
/
timemanurlmanager.php
/
/
<?php namespace Bitrix\Timeman; class TimemanUrlManager { const URI_SHIFT_CREATE = 'shiftCreate'; const URI_SCHEDULE_CREATE = 'scheduleCreate'; const URI_RECORD_REPORT = 'recordReport'; const URI_SCHEDULE_UPDATE = 'scheduleUpdate'; const URI_WORKTIME_STATS = 'worktimeStats'; const URI_SCHEDULE_SHIFTPLAN = 'scheduleShiftplan'; const URI_SETTINGS_PERMISSIONS = 'settingsPermissions'; private function getRoutes() { return [ static::URI_SCHEDULE_CREATE => [ 'name' => static::URI_SCHEDULE_CREATE, 'uri' => '/timeman/schedules/add/', ], static::URI_SETTINGS_PERMISSIONS => [ 'name' => static::URI_SETTINGS_PERMISSIONS, 'uri' => '/timeman/settings/permissions/', ], static::URI_SHIFT_CREATE => [ 'name' => static::URI_SHIFT_CREATE, 'uri' => '/timeman/schedules/#SCHEDULE_ID#/shifts/add/', 'requiredParams' => ['SCHEDULE_ID',], ], static::URI_RECORD_REPORT => [ 'name' => static::URI_RECORD_REPORT, 'uri' => '/timeman/worktime/records/#RECORD_ID#/report/', 'requiredParams' => ['RECORD_ID',], ], static::URI_SCHEDULE_UPDATE => [ 'name' => static::URI_SCHEDULE_UPDATE, 'uri' => '/timeman/schedules/#SCHEDULE_ID#/update/', 'requiredParams' => ['SCHEDULE_ID',], ], static::URI_WORKTIME_STATS => [ 'name' => static::URI_WORKTIME_STATS, 'uri' => '/timeman/timeman.php', ], static::URI_SCHEDULE_SHIFTPLAN => [ 'name' => static::URI_SCHEDULE_SHIFTPLAN, 'uri' => '/timeman/schedules/#SCHEDULE_ID#/shiftplan/', 'requiredParams' => ['SCHEDULE_ID',], ], ]; } /** * @return TimemanUrlManager */ public static function getInstance() { return new static(); } public function getUriTo($routeName, $params = []) { if (!$this->isRouteExists($routeName)) { return ''; // throw exception? } if (!$this->hasAllRequiredParams($routeName, $params)) { return ''; // throw exception? } return $this->replaceUriParams($routeName, $params); } private function getUriByName($routeName) { return !empty($this->getRouteByName($routeName)) ? $this->getRouteByName($routeName)['uri'] : ''; } private function getRouteByName($routeName) { return !empty($this->getRoutes()[$routeName]) ? $this->getRoutes()[$routeName] : ''; } private function isRouteExists($routeName) { return $this->getRouteByName($routeName) !== ''; } private function hasAllRequiredParams($routeName, array $params) { if (empty($this->getRouteByName($routeName)['requiredParams'])) { return true; } foreach ($this->getRouteByName($routeName)['requiredParams'] as $paramName) { if (!array_key_exists($paramName, $params)) { return false; } } return true; } private function replaceUriParams($routeName, $params) { $resultUri = $this->getUriByName($routeName); $paramsReplaced = []; switch ($routeName) { default: foreach ($params as $index => $param) { $paramsReplaced['#' . $index . '#'] = $param; } break; } return strtr($resultUri, $paramsReplaced); } }
/var/www/axolotl/data/www/perm.axolotls.ru/bitrix/modules/timeman/lib/timemanurlmanager.php