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

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

a7/autoload
===========

Automatically and recursively require\_once all php files in a given directory.

2.1(7y ago)820.4k↓50%23UnlicensePHPPHP &gt;=7.0

Since Mar 21Pushed 4y agoCompare

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

READMEChangelog (10)DependenciesVersions (11)Used By (3)

Autoload
========

[](#autoload)

Purpose
-------

[](#purpose)

Automatically load PHP files in the specified directory. Recursively.

### Benefits

[](#benefits)

- Rename files with no fear of breaking `includes` or `require` calls
- Encourages using more files to more cleanly organize code into smaller logical chunks
- Reduce git merge conflicts with other developers

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

[](#installation)

```
composer require a7/autoload

```

Usage
-----

[](#usage)

Be sure to include the regular composer load file via `require( __DIR__ . '/vendor/autoload.php' );`.

Please note that although similarly named, this Autoload library is meant for loading all PHP files in a given directory. This does **NOT** function in the manner of the built-in PSR-4 PHP Autoloader. This is meant for PHP files which are just simple functions (i.e. not class based files)

Simply load your desired `src` or whatever directory by calling:

```
\A7\autoload( __DIR__ . '\src' );

```

### Inclusion Notes

[](#inclusion-notes)

Will throw exceptions if:

- there are more than 250 files in a directory
- any of the php files are larger than 300kb
- any of the php files are negative filesize (indicates something really funky going on)

Caveats
-------

[](#caveats)

Since this is a recursive loader, you should be conscious of what you're placing in your autoloaded directory.

### Not recommended:

[](#not-recommended)

- Placing a big (or any) PHP library in the autoloaded directory (this should/could be handled better with [composer](https://getcomposer.org/) anyways!)
- Being lax with permissions on a server. Obviously this is never a good idea, but I would be sure that your folder / file permissions are up to snuff (or strange files may be loaded)
- Trying to autoload `node_modules` or any other large volume of folders and files

Disclaimer
----------

[](#disclaimer)

Be aware that this may not be the right choice for your project. Please be fully aware of what this plugin does and how it works.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 87.5% 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 ~82 days

Recently: every ~184 days

Total

10

Last Release

2608d ago

### Community

Maintainers

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

---

Top Contributors

[![AaronHolbrook](https://avatars.githubusercontent.com/u/953022?v=4)](https://github.com/AaronHolbrook "AaronHolbrook (7 commits)")[![Stevemoretz](https://avatars.githubusercontent.com/u/27680142?v=4)](https://github.com/Stevemoretz "Stevemoretz (1 commits)")

### Embed Badge

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

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

###  Alternatives

[mcaskill/composer-exclude-files

Exclude files from autoload\_files.php

40929.6k13](/packages/mcaskill-composer-exclude-files)[tutida/pack

CakePHP4 variables in JS

1084.3k](/packages/tutida-pack)[yazvonov/laravel-tojs

Transform PHP Vars to JavaScript for Laravel

102.2k](/packages/yazvonov-laravel-tojs)

PHPackages © 2026

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