3

I am trying to put up my first php project on packagist.org but my vendor name is already taken. I have already pushed a tagged release to github; now I have to modify my composer file without creating a new git tag which isn't as simple as just pushing your changes to github. My question is: how do I do a namespace check before naming the package? Same issue with the code name spacing too. How can I do a lookup to prevent a clash?

Yega
  • 356
  • 5
  • 10

1 Answers1

3

You can do a check using search:

composer search somevendor

Then just wait to see if some packages pop up.

You can't really do a check for namespacing though. I guess your best bet is sticking with your vendor name. And even if you have a colliding vendor name, your project name will usually still differ.

Kuba Birecki
  • 2,926
  • 1
  • 13
  • 16
  • 1
    Ended up doing `packagist.org/packages/myvendorname` in the browser to see if anything came up (redirects to search if name is unused). I still think there should be a tool for this and for looking up code namespaces (like a preflight check) – Yega May 05 '16 at 11:53
  • There is no way to find out which namespaces are used within one library other than actually going through all the files, as the namespaces are not strictly linked to your package name at all. As for the vendor name, well, how is composer supposed to know you're not actually creating a new package for that vendor. Even if there were checks for this, `packagist` is not the only package repository you can use. – Kuba Birecki May 05 '16 at 16:28
  • Like I said, it's best if you just stick with your original vendor/package and you shouldn't run into conflicts... Definitely not at code level. It's nothing bad if your packagist name differs from your namespace. – Kuba Birecki May 05 '16 at 16:31