Use this class to access the managers provided by this module:
php
$puli = new Puli(getcwd());
$puli->start();
$moduleManager = $puli->getModuleManager();
The Puli class either operates in the global or a project context:
* The "global context" is not tied to a specific root module. A global
context only loads the settings of the "config.json" file in the home
directory. The Puli class operates in the global context if no
project root directory is passed to the constructor. In the global
context, only the global config file manager is available.
* The "project context" is tied to a specific Puli project. You need to
pass the path to the project's root directory to the constructor or to
{@link setRootDirectory()}. The configuration of the "puli.json" file in
the root directory is used to configure the managers.
The Puli class creates four kinds of managers:
* The "config file manager" allows you to modify entries of the
"config.json" file in the home directory.
* The "module file manager" manages modifications to the "puli.json" file
of a Puli project.
* The "module manager" manages the module repository of a Puli project.
* The "repository manager" manages the resource repository of a Puli
project.
* The "discovery manager" manages the resource discovery of a Puli project.
The home directory is read from the context variable "PULI_HOME".
If this variable is not set, the home directory defaults to:
* $HOME/.puli on Linux, where $HOME is the context variable
"HOME".
* $APPDATA/Puli on Windows, where $APPDATA is the context
variable "APPDATA".
If none of these variables can be found, an exception is thrown.
A .htaccess file is put into the home directory to protect it from web
access.