symbiotic/autoloader

There is no license information available for the latest version (1.4.0) of this package.

Symbiotic PSR-4 Autoloader for specific directories.

1.4.0 2022-09-14 12:04 UTC

This package is auto-updated.

Last update: 2024-12-14 17:06:46 UTC


README

Usage

// Include Autoloader file
include_once  $basePath.'/vendor/symbiotic/autoloader/src/Autoload/Autoloader.php';

$autoloaderConfig = [
    // Put the autoloader at the beginning of the queue
    'prepend' => false,
    // Directories for searching packages
    'scan_dirs' => [
         $basePath.'/modules',
         $basePath.'/plugins'
    ],
    // Directory for saving class maps
    'storage_path' => $basePath.'/protectedDir/'
    
];
Autoloader::register(
            $autoloaderConfig['prepend'] ?? false,
            $autoloaderConfig['scan_dirs'],
            $autoloaderConfig['storage_path']
        );