uawdijnntqw1x1x1
IP : 18.216.230.65
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
/
syktyvkar.axolotls.ru
/
bitrix
/
modules
/
documentgenerator
/
lib
/
registry.php
/
/
<?php namespace Bitrix\DocumentGenerator; use Bitrix\Main\IO\Directory; use Bitrix\Main\EventManager; use Bitrix\Main\IO\Path; abstract class Registry { /** * Full name of the base class to look for its descendants. * * @return string */ abstract protected function getBaseClassName(); /** * Absolute path where to look for descendants. * * @return string */ abstract protected function getPath(); /** * Name of the event that will be send to collect more descendants. * * @return mixed */ abstract protected function getEventName(); /** * @param array $params * @return array */ public static function getList(array $params = []) { $modules = []; if(isset($params['filter']['MODULE']) && is_array($params['filter']['MODULE'])) { $modules = $params['filter']['MODULE']; } $self = new static(); $result = $self->getFromPath($self->getPath()); $result += $self->getFromEvent($modules); return $result; } /** * @param string $path * @param string $subPath * @return array */ protected function getFromPath($path, $subPath = '\\') { $result = []; $fullBaseClassName = $this->getBaseClassName(); if(Directory::isDirectoryExists($path)) { $baseDirectory = scandir($path); foreach($baseDirectory as $fileName) { if($fileName == '.' || $fileName == '..') { continue; } $subdir = Path::combine($path, $fileName); if(Directory::isDirectoryExists($subdir)) { $result = array_merge($result, $this->getFromPath($subdir, $subPath.$fileName.'\\')); } elseif(GetFileExtension($fileName) == 'php') { $fullClassName = mb_strtolower($fullBaseClassName.$subPath.GetFileNameWithoutExtension($fileName)); if($this->checkClassName($fullClassName)) { $result[$fullClassName] = [ 'NAME' => $fullClassName::getLangName(), 'CLASS' => $fullClassName, 'MODULE' => Driver::MODULE_ID, ]; } } } } return $result; } /** * @param array|null $modules * @return array */ protected function getFromEvent(array $modules = null) { $result = []; foreach(EventManager::getInstance()->findEventHandlers('documentgenerator', $this->getEventName(), $modules) as $handler) { $eventResult = ExecuteModuleEventEx($handler); if(is_array($eventResult)) { foreach ($eventResult as $fullClassName => $description) { if($fullClassName && $this->checkClassName($fullClassName) && is_array($description)) { $result[mb_strtolower($fullClassName)] = $description; } } } } return $result; } /** * @param string $fullClassName * @return bool */ protected function checkClassName($fullClassName) { return ( class_exists($fullClassName) && is_a($fullClassName, $this->getBaseClassName(), true) && is_a($fullClassName, Nameable::class, true) ); } }
/var/www/axolotl/data/www/syktyvkar.axolotls.ru/bitrix/modules/documentgenerator/lib/registry.php