项目作者: dangoodman

项目描述 :
A plugin for Composer package manager making it working a bit better within WordPress plugins
高级语言: PHP
项目地址: git://github.com/dangoodman/composer-for-wordpress.git
创建时间: 2016-01-20T15:08:52Z
项目社区:https://github.com/dangoodman/composer-for-wordpress

开源协议:MIT License

下载


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:

  1. Fatal error: Call to undefined method Composer\Autoload\ClassLoader::setPsr4()
  2. 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:

  1. {
  2. "require-dev": {
  3. "dangoodman/composer-for-wordpress": "^2.0"
  4. }
  5. }

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

  1. {
  2. "config": {
  3. "classloader-suffix": "MySuffix"
  4. }
  5. }

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