2017 © Pedro Peláez
 

library lazy-apc-class-loader

image

alexey-kupershtokh/lazy-apc-class-loader

  • Tuesday, October 14, 2014
  • by AlexeyKupershtokh
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,142 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 18 % Grown

The README.md

LazyApcClassLoader

This package was heavily inspired by the Symfony2 ClassLoader component., (*1)

But it should be even better from performance point of view: It does not require composer's autoloader to be initially loaded which is necessary for the ApcClassLoader to work. Instead, LazyApcClassLoader can work alone in many cases and use composer's one only as a fallback on cache misses. Usually it's enough to load only 1 file instead of 8., (*2)

Installation

composer require alexey-kupershtokh/lazy-apc-class-loader

Usage

require_once(__DIR__ . '/vendor/alexey-kupershtokh/lazy-apc-class-loader/src/LazyApcClassLoader.php');

$loader = new \AlexeyKupershtokh\LazyApcClassLoader\LazyApcClassLoader(
    'my_prefix',
    function () {
        // init composer autoloader if ever needed
        return require_once __DIR__ . '/vendor/autoload.php';
    }
);
$loader->register();

Benchmark

https://github.com/AlexeyKupershtokh/AutoLoadBenchmark, (*3)

The Versions

14/10 2014

dev-master

9999999-dev

  Sources   Download

MIT

by Alexey Kupershtokh

13/10 2014

1.1.0

1.1.0.0

  Sources   Download

MIT

by Alexey Kupershtokh

06/10 2014

1.0.0

1.0.0.0

  Sources   Download

MIT

by Alexey Kupershtokh