The Puli service locator.
Use this class to access the managers provided by this package:
$puli = new Puli(getcwd()); $puli->start(); $packageManager = $puli->getPackageManager();
Puli class either operates in the global or a project context:
* The "global context" is not tied to a specific root package. 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
Puli\Manager\Api\Puli::setRootDirectory(). The configuration of the "puli.json" file in the root directory is used to configure the managers.
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 "package file manager" manages modifications to the "puli.json" file of a Puli project. * The "package manager" manages the package 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.
Author: Bernhard Schussek firstname.lastname@example.org
Located at Api/Puli.php