ContentProvider
service
internal
System.getContentProvider();
The central place for requesting all Services, Classes, Libraries and other content among system. Allows content registration and lazy loading files into the system. Many more features are planned for ContentProvider in future.
See more:
Returns | Method | Description |
---|---|---|
void | register(configPath, packagePath) | Manually register package at custom package path. |
void | registerRecursively(path) | Registers all found packages inside of directory recursively. |
table? | get(packagePath) | Tries to retrieve package with determined package path. |
register(configPath, packagePath)
Returns true if this map contains a mapping for the specified key.
Parameters
key: string
- path to package config file stored in.yml
formatpackagePath: path
- string that will be used to request your package in future usingget
registerRecursively(path)
Goes thru every child in the file system of defined path and registers packages found. Packages are defined by either class.yml
or service.yml
.
Parameters
path
- path whose children are to be registered.
get(packagePath)
Returns contents of package on certain path, or throws error if such package does not exist.
Parameters
packagePath
- package to be requested
Returns
table?
- contents of a package, or nil if not found