What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi all, I am trying to add my own namespace called "Unicorn" in the Spryker inside composer.json fi

U048WDEP3R7
U048WDEP3R7 Posts: 217 🧑🏻‍🚀 - Cadet

Hi all,

I am trying to add my own namespace called "Unicorn" in the Spryker inside composer.json file like this:

...
"autoload": {
        "psr-4": {
            "Generated\\": "src/Generated/",
            "Orm\\": "src/Orm/",
            "Pyz\\": "src/Pyz/",
            "Install\\": "src/Install/",
            "SprykerConfig\\": "src/SprykerConfig/",
            "Unicorn\\" : "src/Unicorn/"
        }
    },
...

But this is not working, can you please help? I also run composer dump-autoload.

Comments

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 ⚖️ - Guardians (admin)

    Hey, what exactly is not working? Have you also added the namespace to the config/Shared/config_default.php ?

  • U048WDEP3R7
    U048WDEP3R7 Posts: 217 🧑🏻‍🚀 - Cadet

    @florian.scholz Yes added it there as well like this:

    $config[KernelConstants::PROJECT_NAMESPACE] = 'Unicorn';
    $config[KernelConstants::PROJECT_NAMESPACES] = [
        'Unicorn',
        'Pyz',
    ];
    

    I have added a Transfer object xml file in this directory (see screenshot) and when I run console transfer:generate , it doesn't generate new Transfer Object.

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 ⚖️ - Guardians (admin)

    Hey, I think you forgot the application namespace folder src/Unicorn/Shared/…

  • U048WDEP3R7
    U048WDEP3R7 Posts: 217 🧑🏻‍🚀 - Cadet

    @florian.scholz It works now. Thank you 🙂