CRM_Extension_MixinScanner
in package
The MixinScanner scans the list of actives extensions and their required mixins.
Table of Contents
Properties
- $allFuncFiles : array<string|int, mixed>
- $liveFuncFiles : array<string|int, mixed>|null
- $manager : CRM_Extension_Manager
- $mapper : CRM_Extension_Mapper
- $mixInfos : array<string|int, CRM_Extension_MixInfo>
- $relativeBases : array<string|int, string>|null
Methods
- __construct() : mixed
- CRM_Extension_ClassLoader constructor.
- addFunctionFiles() : $this
- addMixInfo() : static
- build() : mixInfos}
- compile() : mixed
- Optimize the metadata, removing information that is not needed at runtime.
- scan() : mixed
- Search through known extensions
- createMixInfo() : CRM_Extension_MixInfo
- findFunctionFiles() : array<string|int, mixed>
- getInstalledKeys() : array<string|int, mixed>
- loadFunctionFileHeader() : mixed
- relativize() : string
- Convert the absolute $file to an expression that is supported by 'include'.
- satisfies() : bool
Properties
$allFuncFiles
protected
array<string|int, mixed>
$allFuncFiles
= []
Ex: ['civix' => ['1.0.0' => 'path/to/civix@1.0.0.mixin.php']]
$liveFuncFiles
protected
array<string|int, mixed>|null
$liveFuncFiles
= \NULL
If we have not scanned for live funcs, then NULL. Otherwise, every live version-requirement is mapped to the corresponding file. Ex: ['civix@1' => 'path/to/civix@1.0.0.mixin.php']
$manager
protected
CRM_Extension_Manager
$manager
$mapper
protected
CRM_Extension_Mapper
$mapper
$mixInfos
protected
array<string|int, CRM_Extension_MixInfo>
$mixInfos
= []
$relativeBases
protected
array<string|int, string>|null
$relativeBases
A list of base-paths which are implicitly supported by 'include' directives. Sorted with the longest paths first.
Methods
__construct()
CRM_Extension_ClassLoader constructor.
public
__construct([CRM_Extension_Mapper|null $mapper = NULL ][, CRM_Extension_Manager|null $manager = NULL ][, bool $relativize = TRUE ]) : mixed
Parameters
- $mapper : CRM_Extension_Mapper|null = NULL
- $manager : CRM_Extension_Manager|null = NULL
- $relativize : bool = TRUE
-
Whether to store paths in relative form. Enabling this may slow-down scanning a bit, and it has no benefit when for on-demand loaders. However, if the loader is cached, then it may make for smaller, more portable cache-file.
addFunctionFiles()
public
addFunctionFiles(array<string|int, mixed>|string $files[, bool $deepRead = FALSE ]) : $this
Parameters
- $files : array<string|int, mixed>|string
-
Ex: 'path/to/some/file@1.0.0.mixin.php'
- $deepRead : bool = FALSE
-
If TRUE, then the file will be read to find metadata.
Return values
$thisaddMixInfo()
public
addMixInfo(CRM_Extension_MixInfo $mix) : static
Parameters
- $mix : CRM_Extension_MixInfo
Tags
Return values
staticbuild()
public
build() : mixInfos}
Return values
mixInfos}compile()
Optimize the metadata, removing information that is not needed at runtime.
protected
compile() : mixed
Steps:
- Remove any unnecessary $mixInfos (ie they have no mixins).
- Given the available versions and expectations, pick the best $liveFuncFiles.
- Drop $allFuncFiles.
scan()
Search through known extensions
protected
scan() : mixed
createMixInfo()
private
createMixInfo(string $infoFile) : CRM_Extension_MixInfo
Parameters
- $infoFile : string
-
Path to the 'info.xml' file
Tags
Return values
CRM_Extension_MixInfofindFunctionFiles()
private
findFunctionFiles(string $globPat) : array<string|int, mixed>
Parameters
- $globPat : string
Return values
array<string|int, mixed> —Ex: ['mix/xml-menu-autoload@1.0.mixin.php']
getInstalledKeys()
private
getInstalledKeys() : array<string|int, mixed>
Return values
array<string|int, mixed>loadFunctionFileHeader()
private
loadFunctionFileHeader(mixed $file) : mixed
Parameters
- $file : mixed
relativize()
Convert the absolute $file to an expression that is supported by 'include'.
private
relativize(string $file) : string
Parameters
- $file : string
Return values
stringsatisfies()
private
static satisfies(string $expectVer, string $actualVer) : bool
Parameters
- $expectVer : string
- $actualVer : string