PHPackages                             exorg/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. exorg/autoloader

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

exorg/autoloader
================

Expansible Universal Autoloader.

2.0.0(2y ago)0252[1 PRs](https://github.com/exorg/php-autoloader/pulls)MITPHPPHP 8.1 - 8.3

Since May 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/exorg/php-autoloader)[ Packagist](https://packagist.org/packages/exorg/autoloader)[ RSS](/packages/exorg-autoloader/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

Autoloader
==========

[](#autoloader)

[![PHP workflow](https://github.com/ExOrg/php-autoloader/actions/workflows/php.yml/badge.svg)](https://github.com/ExOrg/php-autoloader/actions/workflows/php.yml/badge.svg)

Expansible Universal Autoloader.

Getting Started
---------------

[](#getting-started)

### Prerequisities

[](#prerequisities)

- [PHP](https://www.php.net/) 8.1 - 8.3
- [Git](https://git-scm.com/) 2.25.1+
- [Composer](https://getcomposer.org/) 2.6.0+

The instruction assumes using the Linux operating system or compatible tools for other operating systems.

### Installation

[](#installation)

#### php8.\*-cli, Git and Composer required

[](#php8-cli-git-and-composer-required)

The recommended way to install Autoloader into the source code of the project is to handle it as code dependency by [Composer](http://getcomposer.org). [Git](https://git-scm.com/) is needed to fetch packages from version control repositories.

The *php8.\*-cli* is needed for installing Composer.

#### Autoloader installation

[](#autoloader-installation)

Add to your **composer.json** file appropriate entry by running the following command

```
composer require exorg/autoloader
```

If it's project set-up stage and no one dependency have been installed yet, run

```
composer install
```

If another dependencies have been intalled previously, run

```
composer update
```

Usage
-----

[](#usage)

The simplest way to autoload all needed files in executable file is attaching *autoload.php* file generated by Composer (after running `composer install` or `composer update` command) like in following example

```
require_once (__DIR__ . '/vendor/autoload.php');
```

### PSR-4 autoloader

[](#psr-4-autoloader)

```
.
└── src
    └── Subject
        └── Core
            └── SomeComponent.php

```

```
