alexey-kupershtokh / lazy-apc-class-loader
Installs: 2 406
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 1
Open Issues: 1
This package is not auto-updated.
Last update: 2025-02-25 06:11:13 UTC
README
This package was heavily inspired by the Symfony2 ClassLoader component.
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.
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();