Function __global->sort_imports_by_dependencies
Definitions
sources/import.php
- Sort a list of imports according to dependencies to help ensure imports are listed in the order they should be run.Note: this is not very performant, but it is assumed the import tool will rarely ever be used by multiple people at the same time.
- Is abstract?: No
- Is static?: No
- Is final?: No
- Return: array
Parameters
Name | Type | Default | Set | Range | Description |
---|---|---|---|---|---|
$imports | array | required parameter | N/A | N/A | List of imports |
$dependencies | ?array | Null | N/A | N/A | Map of imports to their dependencies (null: no dependencies) |
$silent_fail | boolean | False | N/A | N/A | Whether to return null if an infinite loop / cyclic dependency occurred opposed to fatally exiting |
Return
- The newly-sorted imports (null: Error occurred and $silent_fail was true)
- Type: ?array
- Set: N/A
- Range: N/A