Common user base directory specification (home, data, cache directories) for desktop / CLI applications, compatible with the XDG Base Directory Specification.
Once installed, let's initialize some directory paths:
$basedir = new Clue\Basedir\Basedir();
$myapp->setCacheDirectory($basedir->getCacheHome());
$myapp->loadConfig($basedir->getConfigHome() . 'my/app/config.json');
The recommended way to install this library is through composer. New to composer?
{
"require": {
"clue/basedir": "dev-master"
}
}