Implementation of XDG Base Directory specification for php
Via Composer
$ composer require dnoegel/php-xdg-base-dir
$xdg = new \XdgBaseDir\Xdg();
echo $xdg->getHomeDir();
echo $xdg->getHomeConfigDir();
echo $xdg->getHomeDataDir();
echo $xdg->getHomeCacheDir();
echo $xdg->getRuntimeDir();
print_r($xdg->getDataDirs()); // returns array
print_r($xdg->getConfigDirs()); // returns array
$ phpunit
The MIT License (MIT). Please see License File for more information.