File code/class/Package.php
class Lia\Package
See source code at /code/class/Package.php
Constants
Properties
-
public string $name;
example: package -
public string $fqn;
example: vendor:package -
public string $dir = null;
The root dir for the package -
public \Lia $lia;
Liaison object -
public array $addons = [];
array of addons -
public $config = [];
This really should be a dynamic property, but php 8.2 deprecates dynamic props. This is only used by Lia\Simple currently (Dec 8, 2022).
It really does make sense to have package-level configs though ... so that's another reason to leave this prop.
Methods
-
public function __construct(\Lia $liaison, string $fqn, string $dir=null)
-
protected function bootstrap()
require()
the bootstrap.php file in the package's root dir, if it exists.
It's called after the Package class has been initialized, with name, dir, lia, and fqn set. Addons are not yet loaded.
If you use addons, call '$this->load_addons()' in your bootstrap.php file
-
public function init_lia()
foreach $addon, $addon->init_lia -
public function load_addons($sub_dir = 'addon')
-
public function ready()
-
public function dir($sub_dir)