magento / magento/community-features

InstallSchema likes Vendor\Namespace but does not like Vendor\Name\Space

Open
#209 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

devguild Priority: P3
Dominant language
No language data
Stars
46
Forks
14
PR merge metrics
No merged PRs in 30d

Description

Environment

Magento 2.2

Summary (*)

First, I chose not to report this as a bug because it could just be me not following PSR-4 best practices. So, let's communicate about it first.

When Magento checks for InstallSchema it does not honor the composer-configured PSR-4 root.

Examples (*)
  • If I set my composer.json to the config below, it is honored by Composer and Magento. However, it is not honored for setup scripts when magento setup:module is attempting to discover them
    "autoload": {
      "psr-4": {
        "Vendor\\Name\\Space\\": ""
      },
    }
    
  • If I set my composer.json to the normal/popular config below, it is honored by Composer and Magento and the scripts are found during setup:upgrade
    "autoload": {
      "psr-4": {
        "Vendor\\Namespace\\": ""
      },
    }
    
Proposed solution

Have Magento's setup:upgrade logic consider the Composer-configured PSR-4 namespace root.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the setup:upgrade entry point and the InstallSchema discovery logic, then compare its namespace handling with the Composer PSR-4 configuration shown in the issue. Done means setup scripts are discovered when the configured PSR-4 root contains nested namespace segments such as Vendor\Name\Space.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.