Open darthvader666uk opened 4 years ago
Fixed by #63 . Unrelated to files
.
S3Client.php
use Test\Aws\Common\Client\AbstractClient;
use Test\Aws\Common\Client\ClientBuilder;
use Test\Aws\Common\Client\ExpiredCredentialsChecker;
use Test\Aws\Common\Client\UploadBodyListener;
use Test\Aws\Common\Enum\ClientOptions as Options;
use Test\Aws\Common\Exception\RuntimeException;
use Test\Aws\Common\Exception\InvalidArgumentException;
use Test\Aws\Common\Signature\SignatureV4;
use Test\Aws\Common\Model\MultipartUpload\AbstractTransfer;
use Test\Aws\S3\Exception\AccessDeniedException;
use Test\Aws\S3\Exception\Parser\S3ExceptionParser;
use Test\Aws\S3\Exception\S3Exception;
use Test\Aws\S3\Model\ClearBucket;
use Test\Aws\S3\Model\MultipartUpload\AbstractTransfer as AbstractMulti;
use Test\Aws\S3\Model\MultipartUpload\UploadBuilder;
use Test\Aws\S3\Sync\DownloadSyncBuilder;
use Test\Aws\S3\Sync\UploadSyncBuilder;
use Test\Guzzle\Common\Collection;
use Test\Guzzle\Http\EntityBody;
use Test\Guzzle\Http\Message\RequestInterface;
use Test\Guzzle\Iterator\FilterIterator;
use Test\Guzzle\Plugin\Backoff\BackoffPlugin;
use Test\Guzzle\Plugin\Backoff\CurlBackoffStrategy;
use Test\Guzzle\Plugin\Backoff\ExponentialBackoffStrategy;
use Test\Guzzle\Plugin\Backoff\HttpBackoffStrategy;
use Test\Guzzle\Plugin\Backoff\TruncatedBackoffStrategy;
use Test\Guzzle\Service\Command\CommandInterface;
use Test\Guzzle\Service\Command\Factory\AliasFactory;
use Test\Guzzle\Service\Command\Factory\CompositeFactory;
use Test\Guzzle\Service\Resource\Model;
use Test\Guzzle\Service\Resource\ResourceIteratorInterface;
{
"name": "test/mozart",
"description": "Test",
"type": "project",
"extra": {
"mozart": {
"dep_namespace": "Test\\",
"dep_directory": "/dist/vendor/",
"classmap_directory": "/dist/vendor/",
"classmap_prefix": "Test_",
"packages": [
"aws/aws-sdk-php"
],
"delete_vendor_directories": false
},
"patches": {
"coenjacobs/mozart": {
"Return one Autoloader per namespace": "https://github.com/coenjacobs/mozart/pull/63.patch"
}
}
},
"require": {
"aws/aws-sdk-php": "2.8.*"
},
"require-dev": {
"coenjacobs/mozart": "dev-master",
"cweagans/composer-patches": "~1.0"
}
}
I'm a noob to composer, but I don't think the problem has been properly identified yet. I got AWS working by chasing the errors and following them 1 by 1. There are a couple issues.
non-classed functions don't autoload when using autoload by classmap, so a handful of AWS & Guzzle files need to be included using autoload by filename. See my real example:
{ "require": { "aws/aws-sdk-php": "^3.193" }, "extra": { "mozart": { "dep_namespace": "DirectoryOffloader", "dep_directory": "/vendor/DirectoryOffloader/dep/", "classmap_directory": "/vendor/DirectoryOffloader/classes/", "classmap_prefix": "DirectoryOffloader_", "delete_vendor_directories": true } }, "scripts": { "post-install-cmd": [ "\"vendor/bin/mozart\" compose", "composer dump-autoload" ], "post-update-cmd": [ "\"vendor/bin/mozart\" compose", "composer dump-autoload" ] }, "require-dev": { "coenjacobs/mozart": "^0.7.1" }, "autoload": { "classmap": [ "vendor/DirectoryOffloader" ], "files": [ "vendor/DirectoryOffloader/dep/Aws/functions.php", "vendor/DirectoryOffloader/dep/GuzzleHttp/functions_include.php", "vendor/DirectoryOffloader/dep/GuzzleHttp/Promise/functions_include.php", "vendor/DirectoryOffloader/dep/GuzzleHttp/Psr7/functions_include.php" ] } }
When a function was used in a class, Mozart added the fqns to the front of the function. However, the page/class/method that called the function already has a fqns declared, so it doubled them up. IE: DirectoryOffloader/Aws/S3Client/DirectoryOffloader/Aws/someothernamespace/functionname() I fixed this by adding a "/" to the offending line so that it knows not to use the namespace of the current file also. Is this something Mozart should do for me?
In Aws/Result.php, I noticed that Mozart added my custom namespace to the 2nd part of the use statement near the top of a file. It changed use JmesPath\Env as JmesPath;
to use DirectoryOffloader\JmesPath\Env as DirectoryOffloader\JmesPath;
creating a syntax error. I manually changed it to use DirectoryOffloader\JmesPath\Env as JmesPath;
. Is this something that should be fixed in Mozart?
I've been developing Wordpress the wrong way since 2008, and I'm BRAND NEW to composer, so please be kind. I just hope this helps.
I'm running into the same exact issues as @porkifoy.
While this (https://github.com/coenjacobs/mozart/issues/43) issue was resolved, I found an issue with
aws/aws-sdk-php
not working once Mozart had been run.The Namespace etc. had changed once being ran:
But it still didnt appear to have found it. This is my Composer file:
As @BrianHenryIE Mentioned in the previous issue:
Any ideas?