Remove fragile bundled-vendor autoload require from OffsiteRedirect#19
Open
madsnorgaard wants to merge 1 commit into
Open
Remove fragile bundled-vendor autoload require from OffsiteRedirect#19madsnorgaard wants to merge 1 commit into
madsnorgaard wants to merge 1 commit into
Conversation
OffsiteRedirect.php began with:
require_once __DIR__ . '/../../../../vendor/autoload.php';
which resolves to payfast/vendor/autoload.php - a path that only exists
when the module is checked out and 'composer install' is run inside it.
Installed the normal way (composer require payfast/commerce_payfast), the
module ships no vendor/ of its own, so this require_once fatals with
'Failed opening required'.
It is also redundant: payfast/payfast-common is a declared dependency in
the module's composer.json, so Payfast\PayfastCommon\...\PaymentRequest is
resolved by the project autoloader through the existing 'use' statement.
Removing the line fixes standard installs and changes nothing for the
bundled-vendor dev layout.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The payment gateway plugin opens with:
That path resolves to
payfast/vendor/autoload.php, which only exists when the module is checked out andcomposer installis run inside it (the dev layout in this repo). Installed the normal way -composer require payfast/commerce_payfast- the module ships novendor/of its own, so therequire_oncefatals with Failed opening required.It is also redundant:
payfast/payfast-commonis a declared dependency in the module composer.json, soPayfast\PayfastCommon\Aggregator\Request\PaymentRequestis already resolved by the project autoloader through the existingusestatement.Removing the line fixes standard Composer installs and changes nothing for the bundled-vendor dev layout. One line removed.