Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ComposerInformation for Mage-OS vendor name #42

Open
Vinai opened this issue Oct 7, 2023 · 0 comments
Open

Update ComposerInformation for Mage-OS vendor name #42

Vinai opened this issue Oct 7, 2023 · 0 comments
Assignees

Comments

@Vinai
Copy link
Contributor

Vinai commented Oct 7, 2023

The class Magento\Framework\Composer\ComposerInformation needs to be updated so it checks for the vendor name mage-os instead of magento.

Preconditions and environment

  • Mage-OS 1.0.0 preview

Steps to reproduce

Log into the admin and inspect the footer.

Expected result

I expect to see the Mage-OS ver. 1.0.0.

Actual result

I see Mage-OS ver. UNKNOWN.

Additional information

There are a number of regular expressions that need to be updated so they match the vendor-name mage-os:

  • \Magento\Framework\Composer\ComposerInformation::getRequiredPhpVersion
  • \Magento\Framework\Composer\ComposerInformation::isSystemPackage
  • \Magento\Framework\Composer\ComposerInformation::isMagentoRoot

Also, the tests in dev/tests/integration/testsuite/Magento/Framework/Composer/ComposerInformationTest.php need to be adjusted accordingly.

@Vinai Vinai changed the title Update Magento\Framework\Composer\ComposerInformation for Mage-OS vendor name Update ComposerInformation for Mage-OS vendor name Oct 7, 2023
@Vinai Vinai self-assigned this Oct 8, 2023
Vinai added a commit to Vinai/mageos-magento2 that referenced this issue Oct 8, 2023
The ComposerInformation class is used to extract information about the
current installation from the project root composer.json and
composer.lock files, for example the Magento version.
To find the relevant information, it looks at the package names, using a
vendor name magento.
Without this change, the installed version is reported as "UNKNOWN" in
the Magento admin when the mage-os/project-community-edition package is
used. This change fixes the regex so it correctly identifies the
installed version.

In future, it may be worth generalizing this so it is easier to switch
the project vendor for other distributions based on Mage-OS.

Fixes issue mage-os#42.
Vinai added a commit that referenced this issue Oct 8, 2023
The ComposerInformation class is used to extract information about the
current installation from the project root composer.json and
composer.lock files, for example the Magento version.
To find the relevant information, it looks at the package names, using a
vendor name magento.
Without this change, the installed version is reported as "UNKNOWN" in
the Magento admin when the mage-os/project-community-edition package is
used. This change fixes the regex so it correctly identifies the
installed version.

In future, it may be worth generalizing this so it is easier to switch
the project vendor for other distributions based on Mage-OS.

Fixes issue #42.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant