Download the PHP package teewurst/psr4-advanced-wildcard-composer-plugin without Composer
On this page you can find all versions of the php package teewurst/psr4-advanced-wildcard-composer-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download teewurst/psr4-advanced-wildcard-composer-plugin
More information about teewurst/psr4-advanced-wildcard-composer-plugin
Files in teewurst/psr4-advanced-wildcard-composer-plugin
Download teewurst/psr4-advanced-wildcard-composer-plugin
More information about teewurst/psr4-advanced-wildcard-composer-plugin
Files in teewurst/psr4-advanced-wildcard-composer-plugin
Vendor teewurst
Package psr4-advanced-wildcard-composer-plugin
Short Description Adds a parser to enable composer, to be used with wildcards
License MIT
Package psr4-advanced-wildcard-composer-plugin
Short Description Adds a parser to enable composer, to be used with wildcards
License MIT
Please rate this library. Is it a good library?
Informations about the package psr4-advanced-wildcard-composer-plugin
psr4-advanced-wildcard-composer-plugin
Adds a parser to enable composer, to be used with wildcards
How to install
Now we are able to require
composer require teewurst/psr4-advanced-wildcard-composer-plugin
How to use
Both glob and sprintf are used to dynamically replace content of the generated autoload file:
- Use GLOB Braces to define folder dynamically in your composer.json (Epx.:
"/modules/{*Domain,*Module}/{*}/src"
) - Use %s of sprintf to match findings of GLOB to your file path (Exp.:
"My\\Namespace\\%s\\%s\\"
) - GLOB is case in/sensitive on linux/windows
- Also you may use argument switching, but that is not recommended (Exp.:
"My\\Namespace\\%2$s\\%1$s\\"
) - IDEs cant handle Advanced Wildcards in composer.json (File creation, namespace auto-complete etc.)
- if you run in --dev mode, it will generate a composer.development.json at the same location
- it is a exact copy of composer.json, but resolved wildcards
- There are two ways of configuration in your composer.json (equivalent to autoload-dev)
- (Recommended) You add your wildcards to
extra.teewurst/psr4-advanced-wildcard-composer-plugin.autoload.psr-4
(see example) - You set
extra.teewurst/psr4-advanced-wildcard-composer-plugin
to a truthy value and set your namespaces in your defaultautoload.psr-4
- (Recommended) You add your wildcards to
Example
composer.json:
`
FileSystem:
``
AdvancedWildcards + FileSystem is equivalent:
`
Limitations and Performance
Be aware that...
- Glob/IO and performance? No, No, No... dump-autoload will take a bit longer
- This plugin is limited to one folder level per namespace replacement (Oh boy, it would escalate quickly)
- You will get weired results, if folders do not exist
Contribute
- Create any dummy repository locally, setup composer and add to that composer.json:
`
- in dummy repository, fire
composer require teewurst/psr4-advanced-wildcard-composer-plugin
- in dummy repository, you can execute the code by
composer dump-autoload
- to enable xDebug, you have to fire
export COMPOSER_ALLOW_XDEBUG=1
(session env variable = execute in every terminal) - addition needs to pass
composer test
andcomposer analyse
All versions of psr4-advanced-wildcard-composer-plugin with dependencies
PHP Build Version
Package Version
Requires
composer-plugin-api Version
^1.1|^2.0
php Version ^7.1|^8.0
ext-json Version *
php Version ^7.1|^8.0
ext-json Version *
The package teewurst/psr4-advanced-wildcard-composer-plugin contains the following files
Loading the files please wait ....