Created
November 17, 2023 23:16
-
-
Save noah-st-amand/573df038c805942165b836f1d9688b66 to your computer and use it in GitHub Desktop.
add-manual-autoload-2871616-6.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/S3fsStreamWrapper.inc b/S3fsStreamWrapper.inc | |
index c5b970f..fbf1576 100644 | |
--- a/S3fsStreamWrapper.inc | |
+++ b/S3fsStreamWrapper.inc | |
@@ -14,6 +14,13 @@ if (!module_exists('composer_manager')) { | |
_s3fs_load_awssdk_library(); | |
} | |
+// Work around the fact that this file may run before /vendor/autoloader.php, | |
+// generating a "class not found" error. See: | |
+// https://www.drupal.org/project/s3fs/issues/2871616#comment-15322671 | |
+if (!class_exists('Aws\Sdk')) { | |
+ require_once DRUPAL_ROOT . '/../vendor/autoload.php'; | |
+} | |
+ | |
use Aws\CacheInterface; | |
use Aws\S3\Exception\S3Exception; | |
use Aws\S3\StreamWrapper; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment