1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Класс Loader

Открытые статические члены

static includeModule ($moduleName)
static requireModule ($moduleName)
static includeSharewareModule ($moduleName)
static clearModuleCache ($moduleName)
static getDocumentRoot ()
static registerAutoLoadClasses ($moduleName, array $classes)
static registerClassAliases (array $aliases)
static registerNamespace ($namespace, $path)
static unregisterNamespace ($namespace)
static registerHandler (callable $handler)
static autoLoad ($className)
static requireClass ($className)
static getLocal ($path, $root=null)
static getPersonal ($path)
static setRequireThrowException ($requireThrowException)
static includeComposerAutoload ()
static getNamespaces ()

Поля данных

const SAFE_MODE = false
const BITRIX_HOLDER = "bitrix"
const LOCAL_HOLDER = "local"
const MODULE_NOT_FOUND = 0
const MODULE_INSTALLED = 1
const MODULE_DEMO = 2
const MODULE_DEMO_EXPIRED = 3
const ALPHA_LOWER = "qwertyuioplkjhgfdsazxcvbnm"
const ALPHA_UPPER = "QWERTYUIOPLKJHGFDSAZXCVBNM"

Статические защищенные данные

static $safeModeModules = ["main" => true, "fileman" => true]
static $loadedModules = ["main" => true]
static $semiloadedModules = []
static $modulesHolders = ["main" => self::BITRIX_HOLDER]
static $sharewareModules = []
static $namespaces = []
static $autoLoadClasses = []
static $aliases = []
static $classAliases = []
static $requireThrowException = true

Подробное описание

См. определение в файле loader.php строка 12

Методы

◆ autoLoad()

autoLoad ( $className)
static

PSR-4 compatible autoloader. https://www.php-fig.org/psr/psr-4/

Аргументы
string$className

См. определение в файле loader.php строка 364

◆ clearModuleCache()

clearModuleCache ( $moduleName)
static

См. определение в файле loader.php строка 233

◆ getDocumentRoot()

getDocumentRoot ( )
static

Returns document root

Возвращает
string Document root

См. определение в файле loader.php строка 254

◆ getLocal()

getLocal ( $path,
$root = null )
static

Checks if file exists in /local or /bitrix directories

Аргументы
string$pathFile path relative to /local/ or /bitrix/
string | null$rootServer document root, default self::getDocumentRoot()
Возвращает
string|bool Returns combined path or false if the file does not exist in both dirs

См. определение в файле loader.php строка 572

◆ getNamespaces()

getNamespaces ( )
static

См. определение в файле loader.php строка 652

◆ getPersonal()

getPersonal ( $path)
static

Checks if file exists in personal directory. If $_SERVER["BX_PERSONAL_ROOT"] is not set than personal directory is equal to /bitrix/

Аргументы
string$pathFile path relative to personal directory
Возвращает
string|bool Returns combined path or false if the file does not exist

См. определение в файле loader.php строка 600

◆ includeComposerAutoload()

includeComposerAutoload ( )
static

Include autoload.php files from composer folder.

Возвращает
void

См. определение в файле loader.php строка 628

◆ includeModule()

includeModule ( $moduleName)
static

Includes a module by its name.

Аргументы
string$moduleNameName of the included module
Возвращает
bool Returns true if module was included successfully, otherwise returns false
Исключения
LoaderException

См. определение в файле loader.php строка 67

◆ includeSharewareModule()

includeSharewareModule ( $moduleName)
static

Includes shareware module by its name. Module must initialize constant <module name>_DEMO = Y in include.php to define demo mode. include.php must return false to define trial period expiration. Constants are used because it is easy to obfuscate them.

Аргументы
string$moduleNameName of the included module
Возвращает
int One of the following constant: Loader::MODULE_NOT_FOUND, Loader::MODULE_INSTALLED, Loader::MODULE_DEMO, Loader::MODULE_DEMO_EXPIRED

См. определение в файле loader.php строка 202

◆ registerAutoLoadClasses()

registerAutoLoadClasses ( $moduleName,
array $classes )
static

Registers classes for autoloading. All the frequently used classes should be registered for autoloading (performance). It is not necessary to register rarely used classes. They can be found and loaded dynamically.

Аргументы
string$moduleNameName of the module. Can be null if classes are not part of any module
array$classesArray of classes with class names as keys and paths as values.
Исключения
LoaderException

См. определение в файле loader.php строка 273

◆ registerClassAliases()

registerClassAliases ( array $aliases)
static

Registers class aliases for autoloading.

Аргументы
array$aliasesArray with aliases as keys and classes as values.

См. определение в файле loader.php строка 301

◆ registerHandler()

registerHandler ( callable $handler)
static

Registers an additional autoload handler.

Аргументы
callable$handler

См. определение в файле loader.php строка 353

◆ registerNamespace()

registerNamespace ( $namespace,
$path )
static

Registers namespaces with custom paths. e.g. ('Bitrix\Main\Dev', '/home/bitrix/web/site/bitrix/modules/main/dev/lib')

Аргументы
string$namespaceA namespace prefix.
string$pathAn absolute path.

См. определение в файле loader.php строка 323

◆ requireClass()

requireClass ( $className)
static
Аргументы
string$className
Исключения
LoaderException

См. определение в файле loader.php строка 503

◆ requireModule()

requireModule ( $moduleName)
static

Includes module by its name, throws an exception in case of failure

Аргументы
string$moduleName
Возвращает
bool
Исключения
LoaderException

См. определение в файле loader.php строка 174

◆ setRequireThrowException()

setRequireThrowException ( $requireThrowException)
static

Changes requireModule behavior

Аргументы
bool$requireThrowException

См. определение в файле loader.php строка 618

◆ unregisterNamespace()

unregisterNamespace ( $namespace)
static

Unregisters a namespace.

Аргументы
string$namespace

См. определение в файле loader.php строка 341

Поля

◆ $aliases

$aliases = []
staticprotected

См. определение в файле loader.php строка 53

◆ $autoLoadClasses

$autoLoadClasses = []
staticprotected

См. определение в файле loader.php строка 52

◆ $classAliases

$classAliases = []
staticprotected

См. определение в файле loader.php строка 54

◆ $loadedModules

$loadedModules = ["main" => true]
staticprotected

См. определение в файле loader.php строка 43

◆ $modulesHolders

$modulesHolders = ["main" => self::BITRIX_HOLDER]
staticprotected

См. определение в файле loader.php строка 45

◆ $namespaces

$namespaces = []
staticprotected

См. определение в файле loader.php строка 51

◆ $requireThrowException

$requireThrowException = true
staticprotected

См. определение в файле loader.php строка 58

◆ $safeModeModules

$safeModeModules = ["main" => true, "fileman" => true]
staticprotected

См. определение в файле loader.php строка 42

◆ $semiloadedModules

$semiloadedModules = []
staticprotected

См. определение в файле loader.php строка 44

◆ $sharewareModules

$sharewareModules = []
staticprotected

См. определение в файле loader.php строка 46

◆ ALPHA_LOWER

const ALPHA_LOWER = "qwertyuioplkjhgfdsazxcvbnm"

См. определение в файле loader.php строка 38

◆ ALPHA_UPPER

const ALPHA_UPPER = "QWERTYUIOPLKJHGFDSAZXCVBNM"

См. определение в файле loader.php строка 40

◆ BITRIX_HOLDER

const BITRIX_HOLDER = "bitrix"

См. определение в файле loader.php строка 19

◆ LOCAL_HOLDER

const LOCAL_HOLDER = "local"

См. определение в файле loader.php строка 20

◆ MODULE_DEMO

const MODULE_DEMO = 2

Returned by includeSharewareModule() if module works in demo mode

См. определение в файле loader.php строка 32

◆ MODULE_DEMO_EXPIRED

const MODULE_DEMO_EXPIRED = 3

Returned by includeSharewareModule() if the trial period is expired

См. определение в файле loader.php строка 36

◆ MODULE_INSTALLED

const MODULE_INSTALLED = 1

Returned by includeSharewareModule() if module is installed

См. определение в файле loader.php строка 28

◆ MODULE_NOT_FOUND

const MODULE_NOT_FOUND = 0

Returned by includeSharewareModule() if module is not found

См. определение в файле loader.php строка 24

◆ SAFE_MODE

const SAFE_MODE = false

Can be used to prevent loading all modules except main and fileman

См. определение в файле loader.php строка 17


Объявления и описания членов класса находятся в файле: