PHPackages                             joefallon/phpautoloader - 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. joefallon/phpautoloader

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

joefallon/phpautoloader
=======================

Joe's simple to use and versatile PHP autoloader.

v2.0.5(9y ago)04011MITPHP

Since Jul 10Pushed 9y ago1 watchersCompare

[ Source](https://github.com/joefallon/phpautoloader)[ Packagist](https://packagist.org/packages/joefallon/phpautoloader)[ Docs](https://github.com/joefallon/phpautoloader)[ RSS](/packages/joefallon-phpautoloader/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (13)Used By (1)

phpautoloader
=============

[](#phpautoloader)

By [Joe Fallon](http://blog.joefallon.net)

Joe's PHP Autoloader is a versatile and easy to use autoloader for PHP 5.3 and greater. It provides the following features:

- When auto-loading a class, all of the include paths are searched automatically.
- For maximum legacy support, non-namespaced classes are allowed.
- Normal PSR-0 namespaced classes are supported.
- Underscore namespaced (e.g. like the Zend Framework 1 or PEAR) classes are supported.
- This autoloader is fast. No recursive directory searches are performed.

Requirements
------------

[](#requirements)

The only requirement is PHP &gt; 5.3.0. This is due to the use of [namespaces](http://www.php.net/manual/en/language.namespaces.rationale.php). Additionally, [Composer](https://getcomposer.org/) can be helpful.

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

[](#installation)

The easiest way to install Joe's Autoloader is with [Composer](https://getcomposer.org/). Create the following `composer.json` file and run the `php composer.phar install` command to install it.

```
{
    "require": {
        "joefallon/phpautoloader": "*"
    }
}
```

Usage
-----

[](#usage)

To use Joe's Autoloader, the following initialization steps are needed:

- Add the base directories where classes can be found to the include path.
- Call the `Autoloader::registerAutoload()` method to load the autoloader.
- Start using classes in your code.

```
use JoeFallon\AutoLoader;

// Define the include paths.
define('BASE_PATH', realpath(dirname(__FILE__) . '/../'));
define('LIB_PATH',  BASE_PATH . '/lib');
define('VEND_PATH', BASE_PATH . '/vendor');

// Set the application include paths for auto-loading.
set_include_path(get_include_path() . ':' . LIB_PATH . ':' . BASE_PATH);

// Require the Composer autoloader. Composer will handle its own class auto-loading
// using its own autoloader.
require(VEND_PATH . '/autoload.php');

// Initialize Joe's Autoloader. Joe's Autoloader will handle auto-loading any classes
// that are not auto-loaded using Composer's built-in autoloader.
Autoloader::registerAutoLoad();
```

As long as namespaces are mapped to the folder structure within the directories defined above, then autoloader will have no problems finding and loading the classes.

For example, let's assume we want to load the class `Bar` that is within the file named `Bar.php` contained within a folder `Foo`. Also, let's assume that the class `Bar` is namespaced `\Foo\Bar`. This would give a file path of `LIB_PATH/Foo/Bar.php`. When `new Bar();` is executed, the `Bar` class will be loaded (if is was not already).

Here is a visual depiction of the above example:

[![Joe's Autoloader Example](https://camo.githubusercontent.com/ca2dd689f1a7d03d4462960725b8aaa10b0bc884315586217e113ebe885729be/687474703a2f2f692e696d6775722e636f6d2f37476a694e67322e706e67)](https://camo.githubusercontent.com/ca2dd689f1a7d03d4462960725b8aaa10b0bc884315586217e113ebe885729be/687474703a2f2f692e696d6775722e636f6d2f37476a694e67322e706e67)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity70

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

Recently: every ~161 days

Total

11

Last Release

3627d ago

Major Versions

v1.0.4 → v2.0.02014-10-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/97cecfa80ffec8e9e7b5d0ff6df026b636e31a15fe0c2155baba402b5d4f0819?d=identicon)[joefallon](/maintainers/joefallon)

---

Top Contributors

[![joefallon](https://avatars.githubusercontent.com/u/4212989?v=4)](https://github.com/joefallon "joefallon (20 commits)")

---

Tags

Simpleautoloadernamespacepsr-0

### Embed Badge

![Health badge](/badges/joefallon-phpautoloader/health.svg)

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

###  Alternatives

[simplesoftwareio/simple-qrcode

Simple QrCode is a QR code generator made for Laravel.

2.9k30.5M113](/packages/simplesoftwareio-simple-qrcode)[rinvex/countries

Rinvex Countries is a simple and lightweight package for retrieving country details with flexibility. A whole bunch of data including name, demonym, capital, iso codes, dialling codes, geo data, currencies, flags, emoji, and other attributes for all 250 countries worldwide at your fingertips.

1.7k8.0M62](/packages/rinvex-countries)[typo3/class-alias-loader

Amends the composer class loader to support class aliases to provide backwards compatibility for packages

4414.6M28](/packages/typo3-class-alias-loader)[automattic/jetpack-autoloader

Creates a custom autoloader for a plugin or theme.

576.1M124](/packages/automattic-jetpack-autoloader)[roots/bedrock-autoloader

An autoloader that enables standard plugins to be required just like must-use plugins

426.1M62](/packages/roots-bedrock-autoloader)[typisttech/imposter-plugin

Composer plugin that wraps all composer vendor packages inside your own namespace. Intended for WordPress plugins.

158263.4k2](/packages/typisttech-imposter-plugin)

PHPackages © 2026

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