PHPackages                             almostusable/psr4-autoloader - 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. almostusable/psr4-autoloader

ActiveLibrary

almostusable/psr4-autoloader
============================

A minimalistic PSR-4 autoloader implementation for PHP projects

v1.0.5(9mo ago)019MITPHPPHP &gt;=8.1

Since Jul 17Pushed 9mo agoCompare

[ Source](https://github.com/almostusable/psr4-autoloader)[ Packagist](https://packagist.org/packages/almostusable/psr4-autoloader)[ RSS](/packages/almostusable-psr4-autoloader/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (0)

PSR-4 Autoloader
================

[](#psr-4-autoloader)

A minimalistic PSR-4 autoloader implementation for PHP projects.

⚠️ Warning
----------

[](#️-warning)

**This autoloader is intended for internal usage only.** It is a simple implementation and not recommended for production environments. For production, consider using Composer's built-in autoloader.

**This autoloader only concerns itself with *your* project’s classes.
It deliberately ignores everything living inside `vendor/` because teaching it to navigate the endless maze of third-party packages would be a *ton* of work—and, well, I have a life.**

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require almostusable/psr4-autoloader
```

Usage
-----

[](#usage)

1. Configure your namespace mappings in `composer.json`:

```
{
  "autoload": {
    "psr-4": {
      "App\\": "src/"
    }
  }
}
```

2. Include the autoloader in your PHP script:

```
require 'vendor/almostusable/psr4-autoloader/autoloader.php';

// Now you can use classes from your namespaces
use App\Factory\RandomFactory;

$randomFactory = new RandomFactory();
```

Known Issues and Limitations
----------------------------

[](#known-issues-and-limitations)

1. **Basic Namespace Handling**: The current implementation only checks the first segment of the namespace. This can cause issues with nested namespaces or similar prefixes.
2. **Limited Error Handling**: The composer.json parsing has minimal error handling.
3. **Single Autoloading Standard**: Only supports PSR-4, not other standards like PSR-0 or classmap.

Potential Improvements
----------------------

[](#potential-improvements)

- Implement longest prefix matching for better namespace handling
- Improve error handling for composer.json loading
- Add support for multiple autoloading standards

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance58

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~7 days

Total

5

Last Release

276d ago

### Community

Maintainers

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

---

Top Contributors

[![ZlLTOID](https://avatars.githubusercontent.com/u/58257780?v=4)](https://github.com/ZlLTOID "ZlLTOID (6 commits)")

### Embed Badge

![Health badge](/badges/almostusable-psr4-autoloader/health.svg)

```
[![Health](https://phpackages.com/badges/almostusable-psr4-autoloader/health.svg)](https://phpackages.com/packages/almostusable-psr4-autoloader)
```

PHPackages © 2026

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