Skip to content

This composer command allows to generate simple autoloader file based on a classmap file.

License

Notifications You must be signed in to change notification settings

PiotrPress/composer-classmapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Composer ClassMapper

This Composer command generates a classmap.php file based on project files.

NOTE: The command can be executed in projects without composer.json file too.

Installation

  1. Add the command as a global composer plugin:
$ composer global require piotrpress/composer-classmapper
  1. Allow plugin execution:
$ composer config -g allow-plugins.piotrpress/composer-classmapper true

Usage

  1. Execute the command in project's directory:
$ composer map [-e|--exclude [REGEX]]

NOTE: The option exclude is regex that matches file paths to be excluded from the classmap.

  1. After the command execution, simply include autoload file in the project:
require __DIR__ . '/autoload.php';

Example

$ composer map -e"#/vendor/composer/(.*)#"

License

MIT

About

This composer command allows to generate simple autoloader file based on a classmap file.

Topics

Resources

License

Stars

Watchers

Forks

Languages