Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Zend Loader Laravel Package

zendframework/zend-loader

Autoloading and class loading utilities for Zend Framework applications. Provides standard and optimized autoloaders (including PSR-0/PSR-4 style support), plugin class loading, and tools to resolve and map class names to files for legacy or modular codebases.

View on GitHub
Deep Wiki
Context7

The ModuleAutoloader

Zend\Loader\ModuleAutoloader is a special implementation of the SplAutoloader interface, and is consumed by zend-modulemanager to autoload Module classes from different locations.

Apart from being able to autoload modules from directories, the ModuleAutoloader can also autoload modules packaged as Phar archives, which allows for packaging your modules in a single file for easier distribution. Supported archive formats are: .phar, .phar.gz, .phar.bz2, .phar.tar, .phar.tar.gz, .phar.tar.bz2, .phar.zip, .tar, tar.gz, .tar.bz2 and .zip. It is, however, recommended to avoid compressing your packages (be it either gz, bz2 or zip compression), as it introduces additional CPU overhead to every request.

Quickstart

As the ModuleAutoloader is meant to be used with the ModuleManager, for examples of it's usage and how to configure it, please see the Module Autoloader Usage documentation.

Configuration Options

The ModuleAutoloader expects an array of options, where each option is either a path to scan for modules, or a key/value pair of explicit module paths. In the case of explicit module paths, the key is the module's name, and the value is the path to that module.

$options = [
    '/path/to/modules',
    '/path/to/other/modules',
    'MyModule' => '/explicit/path/mymodule-v1.2'
];

Available Methods

__construct

__construct(array|Traversable $options = null) : void

Initialize and configure the object; if $options are provided, they will be passed to setOptions().

setOptions

setOptions(array|Traversable $options) : void

Configures the state of the autoloader, registering paths to modules. $options will be passed to registerPaths().

autoload

autoload(string $class) : false|string

Attempts to load the specified Module class. Returns a boolean false on failure, or a string indicating the class loaded on success.

register

register() : void

Registers the autoload() method of the current instance with spl_autoload_register().

unregister

unregister() : void

Unregisters the autoload() method of the current instance with spl_autoload_unregister().

registerPaths

registerPaths(array|Traversable $paths) : void

Register paths to modules. For an example array, please see the Configuration options section.

registerPath

registerPath(string $path, string $moduleName = false) : void

Register a single path with the autoloader. The first parameter, $path, is expected to be a string. The second parameter, $moduleName, is expected to be a module name, which allows for registering an explicit path to that module.

getPaths

getPaths() : string[]

Returns an array of all the paths registered.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport