PHPackages                             dnoegel/php-xdg-base-dir - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dnoegel/php-xdg-base-dir

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dnoegel/php-xdg-base-dir
========================

implementation of xdg base directory specification for php

v0.1.1(6y ago)6.3k239.4M—3.7%11[3 issues](https://github.com/dnoegel/php-xdg-base-dir/issues)[2 PRs](https://github.com/dnoegel/php-xdg-base-dir/pulls)14MITPHPPHP &gt;=5.3.2CI failing

Since Oct 24Pushed 5y ago4 watchersCompare

[ Source](https://github.com/dnoegel/php-xdg-base-dir)[ Packagist](https://packagist.org/packages/dnoegel/php-xdg-base-dir)[ RSS](/packages/dnoegel-php-xdg-base-dir/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (14)

XDG Base Directory
==================

[](#xdg-base-directory)

[![Latest Stable Version](https://camo.githubusercontent.com/df6a8e8d5f1bf826847841d4b3c931e5f614f2c47b183389909407b190592f88/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646e6f6567656c2f7068702d7864672d626173652d6469722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dnoegel/php-xdg-base-dir)[![Total Downloads](https://camo.githubusercontent.com/640416147cf22f681b1d0e88b16e268b2ac448023e0f8a83cc70ec88128b9f52/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646e6f6567656c2f7068702d7864672d626173652d6469722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dnoegel/php-xdg-base-dir)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/af0b58bb0485efc8c47cd8a3fc54ca09203920900cdb682469567b7d21b523b2/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f646e6f6567656c2f7068702d7864672d626173652d6469722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/dnoegel/php-xdg-base-dir)

Implementation of XDG Base Directory specification for php

Install
-------

[](#install)

Via Composer

```
$ composer require dnoegel/php-xdg-base-dir
```

Usage
-----

[](#usage)

```
$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
```

Testing
-------

[](#testing)

```
$ phpunit
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/dnoegel/php-xdg-base-dir/blob/master/LICENSE) for more information.

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity79

Solid adoption and visibility

Community32

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1867 days

Total

2

Last Release

2357d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c38e57a7804048586f181f2cbc8f0b3d7ebe71056c98ff571020a76b159afd55?d=identicon)[bobthecow](/maintainers/bobthecow)

![](https://www.gravatar.com/avatar/3e33c241de9be12145b80356591da2a7b875f1111d77a8f0a5474f55f02c91c1?d=identicon)[dnoegel](/maintainers/dnoegel)

---

Top Contributors

[![dnoegel](https://avatars.githubusercontent.com/u/1114384?v=4)](https://github.com/dnoegel "dnoegel (19 commits)")[![bobthecow](https://avatars.githubusercontent.com/u/53660?v=4)](https://github.com/bobthecow "bobthecow (10 commits)")[![bcremer](https://avatars.githubusercontent.com/u/55820?v=4)](https://github.com/bcremer "bcremer (5 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (4 commits)")[![krageon](https://avatars.githubusercontent.com/u/2675595?v=4)](https://github.com/krageon "krageon (3 commits)")[![reedy](https://avatars.githubusercontent.com/u/67615?v=4)](https://github.com/reedy "reedy (1 commits)")[![theofidry](https://avatars.githubusercontent.com/u/5175937?v=4)](https://github.com/theofidry "theofidry (1 commits)")[![Haehnchen](https://avatars.githubusercontent.com/u/1011712?v=4)](https://github.com/Haehnchen "Haehnchen (1 commits)")[![KasperFranz](https://avatars.githubusercontent.com/u/191405?v=4)](https://github.com/KasperFranz "KasperFranz (1 commits)")[![luukverhoeven](https://avatars.githubusercontent.com/u/995760?v=4)](https://github.com/luukverhoeven "luukverhoeven (1 commits)")[![ntoniazzi](https://avatars.githubusercontent.com/u/849271?v=4)](https://github.com/ntoniazzi "ntoniazzi (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dnoegel-php-xdg-base-dir/health.svg)

```
[![Health](https://phpackages.com/badges/dnoegel-php-xdg-base-dir/health.svg)](https://phpackages.com/packages/dnoegel-php-xdg-base-dir)
```

###  Alternatives

[haruncpi/laravel-id-generator

Easy way to generate custom ID in laravel framework

280436.1k2](/packages/haruncpi-laravel-id-generator)[rambler-digital-solutions/php-json-rpc

Simple Json-RPC client/server library that just works

1028.3k1](/packages/rambler-digital-solutions-php-json-rpc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
