Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/piotrpress/composer-classmapper
This composer command allows to generate simple autoloader file based on a classmap file.
https://github.com/piotrpress/composer-classmapper
autoload autoloader autoloading classmap classmapping composer composer-scripts
Last synced: 5 days ago
JSON representation
This composer command allows to generate simple autoloader file based on a classmap file.
- Host: GitHub
- URL: https://github.com/piotrpress/composer-classmapper
- Owner: PiotrPress
- License: mit
- Created: 2021-05-12T16:28:39.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-03-27T15:47:38.000Z (8 months ago)
- Last Synced: 2024-10-17T13:27:10.650Z (28 days ago)
- Topics: autoload, autoloader, autoloading, classmap, classmapping, composer, composer-scripts
- Language: PHP
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# 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:
```shell
$ composer global require piotrpress/composer-classmapper
```2. Allow plugin execution:
```shell
$ composer config -g allow-plugins.piotrpress/composer-classmapper true
```## Usage
1. Execute the command in project's directory:
```shell
$ composer map [-e|--exclude [REGEX]]
```**NOTE:** The option `exclude` is regex that matches file paths to be excluded from the classmap.
2. After the command execution, simply include autoload file in the project:
```php
require __DIR__ . '/autoload.php';
```## Example
```shell
$ composer map -e"#/vendor/composer/(.*)#"
```## License
[MIT](license.txt)