PHPackages                             smuuf/koloader - 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. smuuf/koloader

ActiveLibrary

smuuf/koloader
==============

A lightweight directory-sniffing autoloader with caching.

0.5(5y ago)295511MITPHPPHP &gt;=5.5.0

Since Jan 28Pushed 5y ago1 watchersCompare

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

READMEChangelog (2)DependenciesVersions (3)Used By (1)

Koloader
========

[](#koloader)

*Koloader* is a super-lightweight directory-sniffing autoloader with caching.

### Installation

[](#installation)

You probably want to do either of these:

1. [Direct download](https://github.com/smuuf/koloader/archive/master.zip) **or**
2. With *Composer*: `composer require smuuf/koloader`

### Usage

[](#usage)

Koloader is created with ease-of-use in mind. Really, you will need only four lines of code in your new project. The rest will be handled for you.

##### First, include the Koloader in your project

[](#first-include-the-koloader-in-your-project)

*Koloader* needs to be included first. If you're not using *Composer*, this can be done directly by including the Koloader's *loader* script, which will load everything else that is needed:

```
require __DIR__ . "/path/to/Koloader/src/loader.php";

```

##### And then use it!

[](#and-then-use-it)

```
$loader = new \Smuuf\Koloader\Autoloader(__DIR__ . "/temp/"); // The temp directory must exist beforehand.
$loader->addDirectory(__DIR__ . "/app")
	->register();

// Autoloading is enabled now!

$instance = new SomeClass; // Autoloading will be handled by the Koloader.
$instance->doClassStuff(); // Profit!

```

The Koloader must be instantiated with a path to an existing temporary directory as an argument:

- **Autoloader::\_\_construct**(*string* $pathToTmpDir) - Specified directory will be used for storing cached maps of scanned files. **This directory will *not* be created automatically** and thus must exist beforehand.

And then you need to call only two methods on the *Koloader* instance:

- **Autoloader::addDirectory**(*string* $pathToDirectory) - Add a directory to the list of directories that will be scanned for definitions of autoloadable tokens (those good ol' **class**, **interface**, **trait** keywords)
- **Autoloader::register**() - Call this after all directories were added. This will register the Koloader and from that moment it will handle autoloading.

That is all. Have fun!

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

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

Total

2

Last Release

1999d ago

### Community

Maintainers

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

---

Top Contributors

[![smuuf](https://avatars.githubusercontent.com/u/6860713?v=4)](https://github.com/smuuf "smuuf (11 commits)")

### Embed Badge

![Health badge](/badges/smuuf-koloader/health.svg)

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

PHPackages © 2026

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