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

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

static includeModule ($moduleName)
 
static requireModule ($moduleName)
 
static includeSharewareModule ($moduleName)
 
static clearModuleCache ($moduleName)
 
static getDocumentRoot ()
 
static registerAutoLoadClasses ($moduleName, array $classes)
 
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)
 

Открытые атрибуты

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 $requireThrowException = true
 

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

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

Методы

◆ autoLoad()

static autoLoad (   $className)
static

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

Аргументы
$className

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

◆ clearModuleCache()

static clearModuleCache (   $moduleName)
static

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

◆ getDocumentRoot()

static getDocumentRoot ( )
static

Returns document root

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

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

◆ getLocal()

static 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 строка 523

◆ getPersonal()

static 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 строка 551

◆ includeModule()

static 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 строка 68

◆ includeSharewareModule()

static 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 is 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 строка 196

◆ registerAutoLoadClasses()

static registerAutoLoadClasses (   $moduleName,
array  $classes 
)
static

Registers classes for auto loading. All the frequently used classes should be registered for auto loading (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 строка 267

◆ registerHandler()

static registerHandler ( callable  $handler)
static

Registers an additional autoload handler.

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

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

◆ registerNamespace()

static 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 строка 297

◆ requireClass()

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

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

◆ requireModule()

static requireModule (   $moduleName)
static

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

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

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

◆ setRequireThrowException()

static setRequireThrowException (   $requireThrowException)
static

Changes requireModule behavior

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

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

◆ unregisterNamespace()

static unregisterNamespace (   $namespace)
static

Unregisters a namespace.

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

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

Данные класса

◆ $autoLoadClasses

$autoLoadClasses = []
staticprotected

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

◆ $loadedModules

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

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

◆ $modulesHolders

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

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

◆ $namespaces

$namespaces = []
staticprotected

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

◆ $requireThrowException

$requireThrowException = true
staticprotected

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

◆ $safeModeModules

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

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

◆ $semiloadedModules

$semiloadedModules = []
staticprotected

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

◆ $sharewareModules

$sharewareModules = []
staticprotected

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

◆ ALPHA_LOWER

const ALPHA_LOWER = "qwertyuioplkjhgfdsazxcvbnm"

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

◆ ALPHA_UPPER

const ALPHA_UPPER = "QWERTYUIOPLKJHGFDSAZXCVBNM"

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

◆ BITRIX_HOLDER

const BITRIX_HOLDER = "bitrix"

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

◆ LOCAL_HOLDER

const LOCAL_HOLDER = "local"

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

◆ MODULE_DEMO

const MODULE_DEMO = 2

Returned by includeSharewareModule() if module works in demo mode

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

◆ MODULE_DEMO_EXPIRED

const MODULE_DEMO_EXPIRED = 3

Returned by includeSharewareModule() if the trial period is expired

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

◆ MODULE_INSTALLED

const MODULE_INSTALLED = 1

Returned by includeSharewareModule() if module is installed

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

◆ MODULE_NOT_FOUND

const MODULE_NOT_FOUND = 0

Returned by includeSharewareModule() if module is not found

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

◆ SAFE_MODE

const SAFE_MODE = false

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

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