PHPackages                             prod3v3loper/php-auto-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. prod3v3loper/php-auto-autoloader

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

prod3v3loper/php-auto-autoloader
================================

Need any more, no matter where you have a master in your root, the autoloader will find it.

v1.2.1(1y ago)051MITPHPPHP &gt;=5.1.2

Since Mar 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/prod3v3loper/php-auto-autoloader)[ Packagist](https://packagist.org/packages/prod3v3loper/php-auto-autoloader)[ Docs](https://www.tnado.com/open-source-projects-by-prod3v3loper/)[ RSS](/packages/prod3v3loper-php-auto-autoloader/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

[![Melabuai Logo](https://raw.githubusercontent.com/prod3v3loper/php-auto-autoloader/master/img/icon-MB.png "Melabuai Brand")](https://raw.githubusercontent.com/prod3v3loper/php-auto-autoloader/master/img/icon-MB.png)

[![Language](https://camo.githubusercontent.com/cae9ec9d045f8644a980447675aaf7198c6f77044ef7527fbb7c7f662f4ecbb1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f746f702f70726f643376336c6f7065722f7068702d6175746f2d6175746f6c6f616465722e7376673f7374796c653d666c6174 "Language")](https://camo.githubusercontent.com/cae9ec9d045f8644a980447675aaf7198c6f77044ef7527fbb7c7f662f4ecbb1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f746f702f70726f643376336c6f7065722f7068702d6175746f2d6175746f6c6f616465722e7376673f7374796c653d666c6174)[![Repo Size](https://camo.githubusercontent.com/8fdba178ed47bbf5ccb02110c68a7fccac44b30a4e83a96fabb0f3308393790a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f70726f643376336c6f7065722f7068702d6175746f2d6175746f6c6f616465722e7376673f7374796c653d666c6174 "Repo size")](https://camo.githubusercontent.com/8fdba178ed47bbf5ccb02110c68a7fccac44b30a4e83a96fabb0f3308393790a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f70726f643376336c6f7065722f7068702d6175746f2d6175746f6c6f616465722e7376673f7374796c653d666c6174)[![Code SIze](https://camo.githubusercontent.com/cb50dcb672f70ae08bbf3923b27610bb010b4dcdf308dd171923c8f2d87a602a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f70726f643376336c6f7065722f7068702d6175746f2d6175746f6c6f616465722e7376673f7374796c653d666c6174 "Code size")](https://camo.githubusercontent.com/cb50dcb672f70ae08bbf3923b27610bb010b4dcdf308dd171923c8f2d87a602a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f70726f643376336c6f7065722f7068702d6175746f2d6175746f6c6f616465722e7376673f7374796c653d666c6174)[![Github Release date](https://camo.githubusercontent.com/3d01e68b5ba65148db30524d1652a1c4958f69f7530dea46636cc82fa886fcbd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f70726f643376336c6f7065722f7068702d6175746f2d6175746f6c6f616465722e7376673f7374796c653d666c6174 "Github Release date")](https://camo.githubusercontent.com/3d01e68b5ba65148db30524d1652a1c4958f69f7530dea46636cc82fa886fcbd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f70726f643376336c6f7065722f7068702d6175746f2d6175746f6c6f616465722e7376673f7374796c653d666c6174)[![Packgist PHP Version](https://camo.githubusercontent.com/ada1f68bfd7fcdb1bb5fcbd019636129ebda3f86899c5695d3e05b11e911f9d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f70726f643376336c6f7065722f7068702d6175746f2d6175746f6c6f616465722e7376673f7374796c653d666c6174 "Packgist PHP Version")](https://camo.githubusercontent.com/ada1f68bfd7fcdb1bb5fcbd019636129ebda3f86899c5695d3e05b11e911f9d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f70726f643376336c6f7065722f7068702d6175746f2d6175746f6c6f616465722e7376673f7374796c653d666c6174)[![MIT License](https://camo.githubusercontent.com/c57a3b52f7f189b509c811cd7aa6e835cc8cc746e3badd1020aefa7234a2ac25/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70726f643376336c6f7065722f7068702d6175746f2d6175746f6c6f616465722e7376673f7374796c653d666c6174 "MIT License")](https://camo.githubusercontent.com/c57a3b52f7f189b509c811cd7aa6e835cc8cc746e3badd1020aefa7234a2ac25/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70726f643376336c6f7065722f7068702d6175746f2d6175746f6c6f616465722e7376673f7374796c653d666c6174)[![Website](https://camo.githubusercontent.com/fbcf47cfbe532da7b83a1f9295035aa8f46d77b501694307b407adc33177da02/68747470733a2f2f696d672e736869656c64732e696f2f776562736974652d75702d646f776e2d677265656e2d7265642f68747470732f7777772e746e61646f2e636f6d2f6f70656e2d736f757263652d70726f6a656374732d62792d70726f643376336c6f7065722e7376673f7374796c653d666c6174 "Website")](https://www.tnado.com/open-source-projects-by-prod3v3loper/ "Website")

**melabuai**

🏗 PHP Auto Autoloader
=====================

[](#-php-auto-autoloader)

With this autoloader, you do not need any more, no matter where you have a master in your root, the autoloader of MB tnado Ai will find it. The classes found can be indexed to retry without searching.

Usage
=====

[](#usage)

Instantiate your classes, interfaces, traits or even abstract classes, no matter where. The only thing you have to do is to integrate.

Packagist with Composer
-----------------------

[](#packagist-with-composer)

This solution extends the vendor autoloader because it calls the files with certain criteria. The extension allows you to call classes wherever the Autoloader is involved.

Download [Composer](https://getcomposer.org/) local or global. Check for more [Tutorial - NetBeans with Composer and Packagist](https://www.tnado.com/blog/netbeans-with-composer-and-packagist-the-php-package-manager/) for this one.

You found the Autoloader package on [Packagist - PHP Auto Autoloader](https://packagist.org/packages/prod3v3loper/php-auto-autoloader).

Add the Autoloader dependencie to the **composer.json** and set the autoload.

```
{
    ...
    "autoload": {
        "psr-4": { "Aautoloder\\": "autoload/src" }
    },
    "require": {
        "prod3v3loper/php-auto-autoloader": ">=1.0"
    }
    ...
}
```

Now run the composer install command with php

```
php composer.phar install

```

e.g.

```
composer install

```

This is the vendor autoloader invites our autoloader and now we do not need to specify any more class and can load all our classes.

`index.php`

```

        Prod3v3loper - Autoload

```

Git clone
---------

[](#git-clone)

Get per [Git](https://git-scm.com/) or [download](https://github.com/prod3v3loper/php-auto-autoloader/archive/master.zip) and use it.

```
git clone https://github.com/prod3v3loper/php-auto-autoloader.git /projects/

```

So we use it without a vendor and can start a direct call.

`index.php`

```

        Prod3v3loper - Autoload

```

Core Settings &amp; Debug
=========================

[](#core-settings--debug)

`autoload/core.config.php`

Indexing of the found classes, default is `true`.

```
define('MBT_CORE_AUTOLOAD_INDEX', true);
```

Maximum number of lines to read in a file, default is `49`.

```
define('MBT_CORE_AUTOLOAD_READ_MAX_LINES', 49);
```

Set this to false so that you no longer see the debugging, default is `true`.

```
define('MBT_DEBUG_DISPLAY_AUTOLOAD', true);
```

Look at which classes where were found, default is `true`.

```
define('MBT_DEBUG_DISPLAY_AUTOLOAD_SEARCH', true);
```

Root
====

[](#root)

The complete path is the directory path, that the autoloader get by self.

DEFAULT: `MBT_DOCUMENT_ROOT`

The autoloader define get the web root by self after set `MBT_DOCUMENT_ROOT`

```
define('MBT_DOCUMENT_ROOT', __DIR__);

define('MBT_SERVER_ROOT', str_replace(MBT_DOCUMENT_ROOT, '', str_replace(filter_input(INPUT_SERVER, 'DOCUMENT_ROOT'), '', str_replace("\\", "/", MBT_DOCUMENT_ROOT))));
define('MBT_HTTP_ROOT', get_protocol() . get_host() . MBT_SERVER_ROOT);
```

Loader methods
==============

[](#loader-methods)

The autoloader finds everything yourself you do not have to do anything except write your class and instance and use.

Method Namespace (with class)PathLoad Time1testclasses\\first\_classphp-auto-autoloader/testclasses/first\_class.php0.0 sec.2testclasses\\classes\\second\_classphp-auto-autoloader/testclasses/classes/second.php0.002 sec.3name\_space\\namespace2\\third\_classphp-auto-autoloader/testclasses/classThree.php 0.011 sec.METHOD 1:
---------

[](#method-1)

> This is the fastest way

That means we take the website root path and namespace as a folder path and the classname we put together with these.

### Example

[](#example)

**The instance:**`new testclasses\first_class();`

TypeSampleDescriptionPATH`/project/sites/mywebsite/`MBT\_DOCUMENT\_ROOTNAMESPACE`testclasses`Like the folder nameCLASS`first_class`Like the file name without extensionThen the result example`/project/sites/mywebsite/testclasses/first_class.php`METHOD 2:
---------

[](#method-2)

> This method is slightly slower than the first, so 0.03 - 0.05 seconds

This function namespace as folder path and force only this path for class `second_class` (Example) file. However, this only occurs when the file does not match the specified class name. This means every file found in this folder is opened and searched for the classname. As soon as the used class exists in a file, this is integrated and can use it.

### Example

[](#example-1)

**The instance:**`new testclasses\classes\second_class();`

TypeSampleDescriptionPATH`/project/sites/website/`MBT\_DOCUMENT\_ROOTNAMESPACE`testclasses\classes`Like the folder nameThen the result example`/project/sites/mywebsite/testclasses/classes/second_class.php`METHOD 3:
---------

[](#method-3)

> This method is the slowest, but found class anything where

This method is the slowest, because it scans all your folders. No matter how much files you have, all are opened, read and searched for the classname. This method intervenes only when none of the other methods was successful. So if the namespace was not just a folder name and the class name was not filename.

### Example

[](#example-2)

**The instance:**`new testclasses\classes\third_class();`

TypeSampleDescriptionPATH`/project/sites/mywebsite/`MBT\_DOCUMENT\_ROOTThen the result example`/project/sites/mywebsite/testclasses/classThree.php`Information
===========

[](#information)

[tnado SEO &amp; AMP CMS](https://www.tnado.com/), this autoloader is one of parts from Framework.

ISSUE
=====

[](#issue)

Please use the issue tab to request a:

- Bug
- Feature

Choose template and report a bug or feature you want [issues](https://github.com/prod3v3loper/php-auto-autoloader/issues).

CONTRIBUTE
==========

[](#contribute)

Please read the [contributing](https://github.com/prod3v3loper/php-auto-autoloader/blob/master/.github/CONTRIBUTING.md) to contribute.

VULNERABILITY
=============

[](#vulnerability)

Please use the Security section for privately reporting a [vulnerability](https://github.com/prod3v3loper/php-auto-autoloader/security).

Authors
=======

[](#authors)

**Samet Tarim** - *All works*

License
=======

[](#license)

[MIT](https://github.com/prod3v3loper/php-auto-autoloader/blob/master/LICENSE) - [prod3v3loper](https://www.prod3v3loper.com/)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

Total

4

Last Release

725d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d0f88e369d286100ecbbd910d7c859d0c779651ee3f6082c56c764ed2fd2062?d=identicon)[prod3v3loper](/maintainers/prod3v3loper)

---

Top Contributors

[![prod3v3loper](https://avatars.githubusercontent.com/u/16712059?v=4)](https://github.com/prod3v3loper "prod3v3loper (45 commits)")

---

Tags

autoautoloadautoload-cacheautoload-classautoloaderautoloadersautoloadingautoloading-classesautoloadphpphpphp-auto-autoloaderautoloader

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/prod3v3loper-php-auto-autoloader/health.svg)

```
[![Health](https://phpackages.com/badges/prod3v3loper-php-auto-autoloader/health.svg)](https://phpackages.com/packages/prod3v3loper-php-auto-autoloader)
```

###  Alternatives

[typo3/class-alias-loader

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

4313.7M21](/packages/typo3-class-alias-loader)[automattic/jetpack-autoloader

Creates a custom autoloader for a plugin or theme.

525.5M66](/packages/automattic-jetpack-autoloader)[roots/bedrock-autoloader

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

405.6M51](/packages/roots-bedrock-autoloader)[lochmueller/autoloader

Automatic components loading of ExtBase extensions to get more time for coffee in the company ;) This ext is not a PHP SPL autoloader or class loader - it is better! Loads CommandController, Xclass, Hooks, FlexForms, Slots, TypoScript, TypeConverter, BackendLayouts and take care of createing needed templates, TCA configuration or translations at the right location.

19364.9k5](/packages/lochmueller-autoloader)[linkorb/autotune

Tune your autoloader

177.0k17](/packages/linkorb-autotune)[bnomei/autoloader-for-kirby

Helper to automatically load various Kirby extensions in a plugin

185.7k2](/packages/bnomei-autoloader-for-kirby)

PHPackages © 2026

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