S3-Uploads icon indicating copy to clipboard operation
S3-Uploads copied to clipboard

Non-composer install, inc/ files not `include`d.

Open beporter opened this issue 4 years ago • 5 comments

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 calls require_once dirname( __DIR__ ) . '/vendor/autoload.php'; when ! class_exists( '\\Aws\\S3\\S3Client' ), but of course I don't have a vendor/autoload.php anywhere 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. 😣

beporter avatar Jun 15 '21 19:06 beporter

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.

beporter avatar Jun 15 '21 19:06 beporter

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)

joehoyle avatar Jun 16 '21 08:06 joehoyle

This might be the fix then?

  with:
    php-version: "7.4"
+   coverage: pcov

https://github.com/marketplace/actions/setup-php-action#pcov

beporter avatar Jun 16 '21 12:06 beporter

Has this been fixed yet? Looks like there's a vendor/autoload.php in the manual-install.zip file, but its not getting included?

mycarrysun avatar Jan 10 '22 22:01 mycarrysun

Tagging @kovshenin for visibility on this duplicate issue as well as he seems to be the only one looking at issues recently.

MattWilliamsDev avatar Nov 29 '22 21:11 MattWilliamsDev