Skip to content

A plugin for Composer package manager making it working a bit better within WordPress plugins

License

Notifications You must be signed in to change notification settings

dangoodman/composer-for-wordpress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Composer for WordPress

A plugin for Composer package manager making it working a bit better for WordPress plugins.

For now, the only purpose of the project is to fix the following error when there is a WordPress plugin built with an obsolete pre-PSR-4 Composer version:

Fatal error: Call to undefined method Composer\Autoload\ClassLoader::setPsr4()
in <...>/wp-content/plugins/<plugin-name>/vendor/composer/autoload_real.php on line 33

The plugin patches Composer's autoload scripts every time they are changed due to composer install, composer update, or other Composer actions.

More info and discussion

Installation

Require the package in your project's composer.json:

{
    "require-dev": {
        "dangoodman/composer-for-wordpress": "^2.0"
    }
}

To set a custom class loader suffix add to your composer.json:

{
    "config": {
        "classloader-suffix": "MySuffix"
    }
}

If it's not set, a random suffix will be generated instead.

About

A plugin for Composer package manager making it working a bit better within WordPress plugins

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages