Méthode | Description | |
---|---|---|
__construct ( array $scanDirs, string $cacheDir ) | Initialize a new instance of the {@link AddonManager} class. | |
autoload ( string $class ) | Attempt to load undefined class based on the addons that are enabled. | |
checkDependants ( |
Check the enabled dependants of an addon. | |
checkRequirements ( |
Check an addon's requirements. | |
clearCache ( ) : boolean | Remove all of the cached files. | |
getCacheDir ( ) : string | Get the cacheDir. | |
getEnabled ( ) : array[Addon] | Get the enabled addons, sorted by priority with the highest priority first. | |
getEnabledTranslationPaths ( string $locale ) : array | Get the paths to the current translation files. | |
getTheme ( ) : |
Get the theme. | |
isEnabled ( string $key, string $type ) : boolean | Check whether or not an addon is enabled. | |
lookupAddon ( string $key ) : |
Lookup the addon with a given key. | |
lookupAllByType ( string $type ) : array | Get all of the addons of a certain type. | |
lookupAsset ( string $subpath, |
Lookup the path of an asset. | |
lookupByClassname ( string $class, boolean $searchAll = false ) : |
Lookup an addon by class name. | |
lookupByType ( string $key, string $type ) : null | |
Lookup an {@link Addon} by its type. | |
lookupDependants ( |
Get all of the enabled addons that depend on a given addon. | |
lookupLocale ( string $key ) : null | |
Lookup a locale pack based on its key. | |
lookupRequirements ( |
Get all of the requirements for an addon. | |
lookupTheme ( string $key ) : null | |
Lookup a theme based on its key. | |
scan ( string $type, boolean $saveCache = false ) : array | Scan the directories of all of the addons of a given type. | |
setCacheDir ( string $cacheDir ) : |
Set the cacheDir. | |
setTheme ( |
Set the theme. | |
startAddon ( |
Start an addon and make it available. | |
startAddonsByKey ( array $keys, string $type ) : integer | Start one or more addons by specifying their keys. | |
stopAddon ( |
Stop an addon and make it unavailable. | |
stopAddonsByKey ( array $keys, string $type ) : integer | Stop one or more addons by specifying their keys. |
Méthode | Description | |
---|---|---|
deleteSingleIndexKey ( string $type, string $key ) : boolean | Delete an item from a single index and re-cache it. | |
ensureMultiCache ( ) | Ensure that the addon cache has all of the addons. | |
filePutContents ( string $filename, mixed $data, integer $mode = 420 ) : boolean | A version of file_put_contents() that is multi-thread safe. | |
getSingleIndex ( string $type ) : array | Get the index for an addon type that is cached by single addon. | |
lookupRequirementsRecursive ( |
The implementation of {@link lookupRequirements()}. | |
lookupSingleCachedAddon ( string $key, string $type ) : |
Lookup an addon that is cached on a per-addon basis. | |
saveArrayCache ( string $path, string $array ) | Cache an array. | |
scanAddonDirs ( string $type ) : array | Get a list of addon directories for a given type. | |
themeSubdirs ( ) : array | Get the current theme and themes it's based on as an array. | |
typeUsesMultiCaching ( string $type ) : boolean | Test whether an addon type uses multi-caching. |
public __construct ( array $scanDirs, string $cacheDir ) | ||
$scanDirs | array | An array of root-relative directories to scan indexed by **Addon::TYPE_*** constant. Applications and plugins are treated as the same so pass their directories as an array with the **Addon::TYPE_ADDON** key. |
$cacheDir | string | The path to the cache. |
public checkDependants ( |
||
$addon | The addon to check. | |
$throw | boolean | Whether or not to throw an exception or just return **false** if the check fails. |
Résultat | boolean | Returns **true** if the addon a |
public checkRequirements ( |
||
$addon | The addon to check. | |
$throw | boolean | Whether or not to throw an exception if the requirements are not met. |
Résultat | boolean | Returns **true** if the requirements are met or **false** otherwise. |
public clearCache ( ) : boolean | ||
Résultat | boolean | Returns **true** if the files were removed or **false** otherwise. |
public getCacheDir ( ) : string | ||
Résultat | string | Returns the cacheDir. |
public getEnabled ( ) : array[Addon] | ||
Résultat | array[Addon] |
public getEnabledTranslationPaths ( string $locale ) : array | ||
$locale | string | The locale to get the translation paths for. |
Résultat | array | Returns an array of paths. |
public lookupAddon ( string $key ) : |
||
$key | string | The key of the addon. |
Résultat |
public lookupAllByType ( string $type ) : array | ||
$type | string | One of the **Addon::TYPE_*** constants. |
Résultat | array |
public lookupAsset ( string $subpath, |
||
$subpath | string | The subpath of the asset, relative an addon root. |
$addon | The addon that should contain the asset. | |
$mustExist | boolean | Whether or not the asset must exist in the addon. |
Résultat | string |
public lookupDependants ( |
||
$addon | The addon to check the requirements. | |
Résultat | array | Returns an array of {@link Addon} objects. |
public lookupLocale ( string $key ) : null | |
||
$key | string | The key of the locale pack. |
Résultat | null | |
Returns an {@link Addon} object for the locale pack or **null** if it can't be found. |
public lookupRequirements ( |
||
$addon | The addon to check. | |
$filter | integer | One or more of the **AddonManager::REQ_*** constants concatenated by `|`. |
Résultat | Returns | the requirements array. An empty array represents an addon with no requirements. |
public lookupTheme ( string $key ) : null | |
||
$key | string | The key of the theme. |
Résultat | null | |
Returns an {@link Addon} object for the theme or **null** if it can't be found. |
public setCacheDir ( string $cacheDir ) : |
||
$cacheDir | string | The cache directory to set. If this doesn't include **PATH_ROOT** then it will be prepended. |
Résultat | Returns `$this` for fluent calls. |
public setTheme ( |
||
$theme | The new theme to set. | |
Résultat | Returns `$this` for fluent calls. |
public startAddon ( |
||
$addon | The addon to start. |
public stopAddon ( |
||
$addon | The addon to stop. |