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

  1. key: string - path to package config file stored in .yml format
  2. packagePath: path - string that will be used to request your package in future using get

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

  1. 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

  1. packagePath - package to be requested

Returns

  1. table? - contents of a package, or nil if not found