Detailed Description
We're currently excluding composer.json and composer.lock from the git archives (which are used by GitHub tag releases) by setting the following in .gitattributes:
|
composer.json export-ignore |
|
composer.lock export-ignore |
Expected Behavior
Users should be able to add this plugin by register this GitHub repository as a Composer repository in their composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/fairpm/fair-plugin"
}
],
"require": {
"fairpm/fair-plugin": "^1.4"
}
}
which then pulls in the required plugin dependencies required for the functioning of the plugin. At least until we isolate and include in the releases #498.
Current Behavior
The composer require fairpm/fair-plugin step works but on plugin activation users get:
Warning: require_once(/var/www/html/wp-content/plugins/fair-plugin/vendor/autoload.php): Failed to open stream: No such file or directory in /var/www/html/wp-content/plugins/fair-plugin/plugin.php on line 28 Fatal error: Uncaught Error: Failed opening required '/var/www/html/wp-content/plugins/fair-plugin/vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/www/html/wp-content/plugins/fair-plugin/plugin.php:28 Stack trace: #0 /var/www/html/wp-settings.php(589): include_once() #1 /var/www/html/wp-config.php(150): require_once('/var/www/html/w...') #2 /var/www/html/wp-load.php(50): require_once('/var/www/html/w...') #3 /var/www/html/wp-admin/admin.php(35): require_once('/var/www/html/w...') #4 /var/www/html/wp-admin/plugins.php(10): require_once('/var/www/html/w...') #5 {main} thrown in /var/www/html/wp-content/plugins/fair-plugin/plugin.php on line 28
because:
- we're requiring
vendor/autoload.php in the plugin bootstrap file,
- the
composer.json and composer.lock are missing from the releases and fairpm/did-manager-wordpress dependency isn't therefore installed.
Steps to Reproduce
- See above.
Context (Environment)
- FAIR connect 1.4.0 and earlier versions.
Possible Solution
- Include
composer.json and composer.lock in git archives by updating .gitattributes.
- Load
vendor/autoload.php only if it exists.
Possible Implementation
Detailed Description
We're currently excluding
composer.jsonandcomposer.lockfrom the git archives (which are used by GitHub tag releases) by setting the following in.gitattributes:fair-plugin/.gitattributes
Lines 12 to 13 in 707135c
Expected Behavior
Users should be able to add this plugin by register this GitHub repository as a Composer repository in their
composer.json:{ "repositories": [ { "type": "vcs", "url": "https://github.com/fairpm/fair-plugin" } ], "require": { "fairpm/fair-plugin": "^1.4" } }which then pulls in the required plugin dependencies required for the functioning of the plugin. At least until we isolate and include in the releases #498.
Current Behavior
The
composer require fairpm/fair-pluginstep works but on plugin activation users get:because:
vendor/autoload.phpin the plugin bootstrap file,composer.jsonandcomposer.lockare missing from the releases andfairpm/did-manager-wordpressdependency isn't therefore installed.Steps to Reproduce
Context (Environment)
Possible Solution
composer.jsonandcomposer.lockin git archives by updating.gitattributes.vendor/autoload.phponly if it exists.Possible Implementation