Support General Best way to Bundle MetaBox.io? Reply To: Best way to Bundle MetaBox.io?

#9970
MauroMauro
Participant

Thanks for this!
I'm still running into a few issues.

I added all components I need and I've run composer install. The result differs from the composer install of metabox as documented on this site elsewhere since that one installed meta-box within the vendor/ directory.

This method instead created a wp-content/plugins/ directory into my target directory, and now the autoload.php returns an error because it can't find the plugins.

---- This is my composer.json ----

{
"repositories": [
{
"type": "composer",
"url": "https://packages.metabox.io/XXX"
},
{
"type": "composer",
"url": "https://wpackagist.org"
}
],
"require": {
"meta-box/meta-box-group": "dev-master",
"meta-box/meta-box-columns": "dev-master",
"meta-box/mb-custom-table": "dev-master",
"meta-box/mb-revision": "dev-master",
"meta-box/mb-term-meta": "dev-master",
"meta-box/meta-box-geolocation": "dev-master",
"meta-box/meta-box-tabs": "dev-master",
"wpackagist-plugin/meta-box": "dev-trunk",
"wpackagist-plugin/mb-rest-api": "dev-trunk",
"wpackagist-plugin/mb-relationships": "dev-trunk"
},
"extra": {
"installer-paths": {
"meta-box/meta-box/": ["my-foundation/meta-box"],
"meta-box/mb-rest-api/": ["my-foundation/mb-rest-api"],
"meta-box/mb-relationsihps/": ["my-foundation/mb-relationships"]
}
},
"autoload": {
"files": [
"meta-box/meta-box/meta-box.php",
"meta-box/mb-rest-api/mb-rest-api.php",
"meta-box/mb-rest-api/mb-rest-api.php"
]
}
}

---- This is composer's output ----

Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 11 installs, 0 updates, 0 removals
- Installing composer/installers (v1.5.0): Downloading (100%)
- Installing meta-box/meta-box-group (master): Downloading (100%)
- Installing meta-box/meta-box-columns (master): Downloading (100%)
- Installing meta-box/mb-custom-table (master): Downloading (100%)
- Installing meta-box/mb-revision (master): Downloading (100%)
- Installing meta-box/mb-term-meta (master): Downloading (100%)
- Installing meta-box/meta-box-geolocation (master): Downloading (100%)
- Installing meta-box/meta-box-tabs (master): Downloading (100%)
- Installing wpackagist-plugin/meta-box (dev-trunk): Checking out trunk
- Installing wpackagist-plugin/mb-rest-api (dev-trunk): Checking out trunk
- Installing wpackagist-plugin/mb-relationships (dev-trunk): Checking out trunk
Writing lock file
Generating autoload files


I added require_once('vendor/autoload.php'); to my core plug-in file and now I get this error:

Fatal error: require(): Failed opening required '/Users/mauro/GitHub/my_wordpress/wp-content/plugins/my-foundation/vendor/composer/../../meta-box/meta-box/meta-box.php' (include_path='.:/Applications/MAMP/bin/php/php7.2.1/lib/php') in /Users/mauro/GitHub/mundana_wordpress/wp-content/plugins/my-foundation/vendor/composer/autoload_real.php on line 66