php - Composer => Wordpress plugin workflow -
the question first know, while reading, problem is: what correct workflow updating plugin within in composer/wordpress project managed git?
i've wordpress project following directory structure:
- root
- httpdocs
- wp-content
- plugins
- wp-config.php
- ...
- composer.json
and inside plugins
folder:
- myplugin
- composer.json
the stripped root composer.json
looks this:
{ [...] "require": { "example/myplugin": "dev-master" }, "repositories": [ { "type": "composer", "url": "http://composer.example.com" } ], "extra": { "installer-paths": { "httpdocs/wp-content/plugins/{$name}": [ "example/myplugin" ] } } }
and composer.json
inside the myplugin folder:
{ [...] "license": "proprietary", "require": { [...] }, "type": "wordpress-plugin", "autoload": { "classmap": [ "controllers", "lib", "models" ] } }
at example.com installed private static composer repository (satis). far good, can install dependencies, myplugin , myplugin dependencies php composer.phar install
in root folder.
now (my) problems begin:
- updating: myplugin composer package, not git submodule. how can update package while developing , testing? git submodule commit , push changes, composer package have keep git repository myplugin somwhere else , update there, correct?
- autoloading: moved autoload parameter root
composer.json
myplugincomposer.json
. autoloader wont work correct. can reinstall composer dependencies without problems, , replaced path (before: httpdocs/.../myplugin/controllers, now: controllers)
i searching 6 hours there no information (or searched wrong keywords)
this answers part of question, if add git url root project's composer.json git repository, composer clone plugin directory. allow commit directly.
example:
"repositories": [ { "type": "git", "url": "git@github.com:my-git-name/my-plugin.git" }, ... ]
Comments
Post a Comment