Questions on the naming of modules for laminas, mezzio, api-tools

I have many modules which I have named with a prefix of zf- such as api-skeletons/zf-oauth2-doctrine. I’ve often wondered what the right way to name modules is. With Laminas now renaming all the modules I think it’s a good time to add some clarification.

A Zend library may be named zfcampus/zf-oauth2. This is clearly part of the zfcampus collection. However the prefix zf- isn’t clear to me. I think it means “this package is for Zend Framework” and as such any other library could prefix their name with zf- if the library is intended for Zend Framework (and not Symfony, for example.)

So, I want to know if the zf- prefix is intended to prefix official Zend Framework libraries only or if this is ment as a generic target framework identifier.

I really like the zf- prefix as a “Compatible with” framework identifier. I think it is a good way to group modules into a framework/category. If that is the intention then a future version of zf-oauth2-doctrine could become api-tools-oauth2-doctrine. Is this the correct usage of library prefixes?

The “zf” prefix (and zfcampus) confused me for the longest time. It sounds both too official and not official enough at the same time.

If I were to pick a name for a library it would most likely be under my own org, or its own org, but definitely nothing related to Laminas. Then the package might refer to other packages it is compatible with.

So possible choices for me would be:

  • myorg/oauth2-doctrine
  • myorg/api-tools-oauth2-doctrine
  • oauth2-doctrine/oauth2-doctrine
  • oauth2-doctrine/api-tools-oauth2-doctrine

Most likely the first or second choice. The compatibility with packages should anyway be described in composer.json tags and readme file.

1 Like

Those prefixes are there mainly to avoid naming collisions when forking on github.
You should use naming scheme that makes sense to you and is consistent for your vendor “namespace”.
Main discoverability comes from composer tags and github repo tags or web search, so names do not matter much.

1 Like

@PowerKiKi of the four options you gave I prefer #2.

1 Like