Skip to content
This repository has been archived by the owner on Apr 22, 2019. It is now read-only.

Fixed BP constant issue in registration.php #102

Merged
merged 2 commits into from
Jan 31, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@
__DIR__
);

if (defined('BP')) {
// This path will work when extension is installed via composer or via manual installation
$vendorPath = BP . DIRECTORY_SEPARATOR . 'vendor';
} else {
// This path will work when extension is being run in the context of integration tests, where BP is not defined
$vendorPath = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..';
}

\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::LIBRARY,
'Avalara_AvaTax',
BP . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'avalara' . DIRECTORY_SEPARATOR . 'avatax'
$vendorPath . DIRECTORY_SEPARATOR . 'avalara' . DIRECTORY_SEPARATOR . 'avatax'
);