NotionCommotion Posted August 24, 2019 Share Posted August 24, 2019 I've only seen composer packages using vendor name and package name namespace. Is it possible to use deeper namespace such as the following? For instance, package: { "name": "notioncommotion/my-sub-namespace/my-package", "description": "MyPackage located in MySubNamespace.", ... } is used in some project: { "require": { "notioncommotion/my-sub-namespace/my-package": "^1.2" } } If not, what do you think were the reasons composer does not allow? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/309138-using-a-sub-namespace-with-composer/ Share on other sites More sharing options...
requinix Posted August 24, 2019 Share Posted August 24, 2019 It isn't a namespace. It's a vendor name plus a slash plus a project name. Quote Link to comment https://forums.phpfreaks.com/topic/309138-using-a-sub-namespace-with-composer/#findComment-1569184 Share on other sites More sharing options...
NotionCommotion Posted August 25, 2019 Author Share Posted August 25, 2019 21 hours ago, requinix said: It isn't a namespace. It's a vendor name plus a slash plus a project name. Bad terminology on my side, but ultimately it maps to a namespace. And it seems that sometimes it is a vendor name +/+ project name and other times it is a vendor's project name +/+ sub-project. For instance, react used with react/http-client and react/http seems to be more of a project or library than a vendor name. Don't know where I am going with this, and guess it doesn't matter... Quote Link to comment https://forums.phpfreaks.com/topic/309138-using-a-sub-namespace-with-composer/#findComment-1569194 Share on other sites More sharing options...
requinix Posted August 25, 2019 Share Posted August 25, 2019 You can use whatever namespaces, actual PHP code namespaces, that you want. But the composer project is you + one name. Quote Link to comment https://forums.phpfreaks.com/topic/309138-using-a-sub-namespace-with-composer/#findComment-1569196 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.