2017 © Pedro Peláez
 

composer-plugin composer-autoload-simplifier

Simplifies autoloader generated by Composer

image

nextras/composer-autoload-simplifier

Simplifies autoloader generated by Composer

  • Monday, July 11, 2016
  • by JanTvrdik
  • Repository
  • 2 Watchers
  • 5 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Nextras Composer Autoload Simplifier

Downloads this Month Stable version, (*1)

Nextras Composer Autoload Simplifier is a Composer plugin which can replace vendor/autoload.php with a simplified and therefore slightly faster version., (*2)

Installation

Use composer:, (*3)

$ composer require nextras/composer-autoload-simplifier

Example of Simplified Autoloader

<?php declare(strict_types = 1);

(function () {
    $requireClassScoped = function (string $path) {
        require $path;
    };

    $requireFileScoped = function (string $id, string $path) {
        if (empty($GLOBALS['__composer_autoload_files'][$id])) {
            require $path;
            $GLOBALS['__composer_autoload_files'][$id] = TRUE;
        }
    };

    spl_autoload_register(function (string $className) use ($requireClassScoped) {
        static $classMap = [
            'Tracy\\Bar' => __DIR__ . '/tracy/tracy/src/Tracy/Bar.php',
            'Tracy\\BlueScreen' => __DIR__ . '/tracy/tracy/src/Tracy/BlueScreen.php',
            ...
        ];

        if (isset($classMap[$className])) {
            $requireClassScoped($classMap[$className]);
        }
    });

    $requireFileScoped('7745382c92b7799bf1294b1f43023ba2', __DIR__ . '/tracy/tracy/src/shortcuts.php');
})();

License

MIT. See full license., (*4)

The Versions

11/07 2016

dev-master

9999999-dev https://github.com/nextras/composer-autoload-simplifier

Simplifies autoloader generated by Composer

  Sources   Download

MIT

The Requires

  • php >=7.0
  • composer-plugin-api ^1.0

 

composer autoloader

11/07 2016

v0.2.0

0.2.0.0 https://github.com/nextras/composer-autoload-simplifier

Simplifies autoloader generated by Composer

  Sources   Download

MIT

The Requires

  • php >=7.0
  • composer-plugin-api ^1.0

 

composer autoloader

05/06 2016

v0.1.0

0.1.0.0 https://github.com/nextras/composer-autoload-simplifier

Simplyfies autoloader generated by Composer

  Sources   Download

MIT

The Requires

  • php >=7.0

 

composer autoloader