PHPackages                             redcatphp/autoload - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. redcatphp/autoload

AbandonedArchivedLibrary[PSR &amp; Standards](/categories/psr-standards)

redcatphp/autoload
==================

Autoload - Simple and Concise PHP Autoloader - PSR-4 convention

v2.3.2(9y ago)746041LGPL-3.0+PHPPHP &gt;=5.4.0

Since Aug 20Pushed 7y ago2 watchersCompare

[ Source](https://github.com/redcatphp/autoload)[ Packagist](https://packagist.org/packages/redcatphp/autoload)[ Docs](http://redcatphp.com/autoload-psr4)[ RSS](/packages/redcatphp-autoload/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)DependenciesVersions (8)Used By (1)

**No longer actively maintained. I work now with NodeJS and I recommand you to take a look at [di-ninja](https://github.com/di-ninja/di-ninja)**

Autoload - PHP native dependency manager
========================================

[](#autoload---php-native-dependency-manager)

---

Autoload is a simple and concise PHP [Autoloader](http://php.net/autoload) based on universal conventions.
No more need of annoying "require\_once" at start of each php file. When needed by php code the class will be dynamicaly loaded and no more load of unused class, increasing performances in same time.
This component is able to autoload all modern PHP frameworks and libraries like [Zend](https://github.com/zendframework), [Symfony](https://symfony.com), [PEAR](https://pear.php.net), [Aura](http://auraphp.com) or many others.

- [PSR-4](http://www.php-fig.org/psr/psr-4/)
- [PSR-0](http://www.php-fig.org/psr/psr-0/) (retrocompat)
- classMap API
- [include\_path](http://php.net/manual/fr/ini.core.php#ini.include-path) support
- [HHVM](https://en.wikipedia.org/wiki/HipHop_Virtual_Machine) hack
- empty namespace support for root autoload path
- cache for checked class\_exists

Methods usage
-------------

[](#methods-usage)

### simple [facade](https://en.wikipedia.org/wiki/Facade_pattern) API using global instance

[](#simple-facade-api-using-global-instance)

```
use RedCat\Autoload\Autoload;
/* register "MyNamespace\SubSpace" prefix to "myDirectory/src/myNamespacePath" directory */
Autoload::register('myDirectory/src/myNamespacePath','MyNamespace\SubSpace');

/* register the containing file directory as a root directory for autoload */
Autoload::register(__DIR__);
/* equivalent */
Autoload::register(__DIR__,'');
```

### get global instance

[](#get-global-instance)

```
$autoload = Autoload::getInstance();
```

### register and unregister to [SPL](http://php.net/manual/en/book.spl.php) stack

[](#register-and-unregister-to-spl-stack)

```
$autoload->splRegister();
$autoload->splUnregister();
```

### add namespaces

[](#add-namespaces)

```
$autoload->addNamespace('Prefix\Of\My\Namespace','target/directory');
$autoload->addNamespace('Prefix\Of\My\Namespace2',[
	'target/directory1',
	'target/directory2',
]);
$autoload->addNamespaces([
	'Prefix\Of\My\Namespace'=>'target/directory/for/my/namespace',
	'Prefix\Of\My\Namespace2'=>[
		'target/directory1',
		'target/directory2',
	]
]);
```

### useIncludePath

[](#useincludepath)

```
$autoload->useIncludePath(true); //default param to true but default property to false
```

### useCache

[](#usecache)

```
$autoload->useCache(false); //default param and property to true
```

### addClass and addClassMap

[](#addclass-and-addclassmap)

```
$autoload->addClass('My\Class','path/of/myclass.php');
$autoload->addClassMap([
	'My\Class'=>'path/of/myclass.php',
	'My\Class2'=>'path/of/myclass2.php',
]);
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Recently: every ~127 days

Total

7

Last Release

3350d ago

Major Versions

v1.1 → v2.02015-08-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/085e64547ac1b32cc49f4f6ba5950c35f593f79d8523e2379869ab512eb8a725?d=identicon)[surikat](/maintainers/surikat)

---

Top Contributors

[![devthejo](https://avatars.githubusercontent.com/u/6781828?v=4)](https://github.com/devthejo "devthejo (22 commits)")

---

Tags

autoloadPSR-4

### Embed Badge

![Health badge](/badges/redcatphp-autoload/health.svg)

```
[![Health](https://phpackages.com/badges/redcatphp-autoload/health.svg)](https://phpackages.com/packages/redcatphp-autoload)
```

###  Alternatives

[aura/autoload

Provides a PSR-4 compliant autoloader implementation.

94476.8k12](/packages/aura-autoload)[evilfreelancer/routeros-api-php

Modern Mikrotik RouterOS API PHP client for your applications (with Laravel support)

491206.1k4](/packages/evilfreelancer-routeros-api-php)[icamys/php-sitemap-generator

Simple PHP sitemap generator.

175342.8k6](/packages/icamys-php-sitemap-generator)[yidas/codeigniter-psr4-autoload

CodeIgniter 3 PSR-4 Autoloader for Application

5419.5k3](/packages/yidas-codeigniter-psr4-autoload)[genert/bbcode

BBCode parser from or to HTML.

81324.0k1](/packages/genert-bbcode)[suin/phpcs-psr4-sniff

PHP\_CodeSniffer sniff that checks class name matches PSR-4 project structure.

271.7M16](/packages/suin-phpcs-psr4-sniff)

PHPackages © 2026

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