Non-composer install, inc/ files not `include`d.
I'm attempting to upgrade from v2.0.0.
Following the instructions in the README for a manual (non-composer) install, I've downloaded the 3.0.1 release and extracted into my wp-content/plugins/ folder:
$ ls wp-content/plugins/S3-Uploads-3.0.1/
CHANGELOG.md composer.json psalm README.md verify.txt
codecov.yml inc psalm.xml s3-uploads.php
Then I ran the wp command to activate the plugin:
$ wp plugin activate S3-Uploads-3.0.1
Error: Callable "S3_Uploads\\WP_CLI_Command" does not exist, and cannot be registered as `wp s3-uploads`.
It appears that none of the files in the inc/ folder are ever directly require'd or include'd in a non-composer setup so they're out of scope. Here's the chain as I understand it:
- WP entry --> s3-uploads.php
- s3-uploads.php -->
require_once __DIR__ . '/inc/namespace.php'; -
inc/namespace.php-->init() -
init()--> Only callsrequire_once dirname( __DIR__ ) . '/vendor/autoload.php';when! class_exists( '\\Aws\\S3\\S3Client' ), but of course I don't have avendor/autoload.phpanywhere in my installation.
It's not clear to me how PHP is supposed to know about any of the files in the inc/ folder when they aren't being explicitly include'd or require'd anywhere in this package. 😣
In the 2.0.0 release, this happened right at the top of s3-uploads.php:
if ( defined( 'WP_CLI' ) && WP_CLI ) {
require_once dirname( __FILE__ ) . '/inc/class-s3-uploads-wp-cli-command.php';
}
For 3.0.0 that's not the case anymore and I am unable to find the equivalent command.
It looks like the release script is broken again, so there's no "manual install zip" on the GitHub release page (see https://github.com/humanmade/S3-Uploads/runs/2828157924?check_suite_focus=true)
This might be the fix then?
with:
php-version: "7.4"
+ coverage: pcov
https://github.com/marketplace/actions/setup-php-action#pcov
Has this been fixed yet? Looks like there's a vendor/autoload.php in the manual-install.zip file, but its not getting included?
Tagging @kovshenin for visibility on this duplicate issue as well as he seems to be the only one looking at issues recently.