php-pds / skeleton

Standard PHP package skeleton.
Creative Commons Attribution Share Alike 4.0 International
2.3k stars 167 forks source link

/bin particulars #39

Open cxj opened 7 years ago

cxj commented 7 years ago

Are the command-line executables which belong in /bin those which are delivered as part of the package? Or are they executables which are generated by the package, after delivery and installation, via some user-invoked means? Or both?

davidjeddy commented 6 years ago

Interesting, the README.md does not delimit the difference between CLI tools that are part of the package or provided by the package as a deliverable.

It does say "...If the package provides a root-level directory for command-line executable files, it MUST be named bin/....". To me that reads as any CLI executable provided by the package, IE the result of composer install {package}, belong in ./bin. So that covers commands the package implements.

As for other CLI tools...If ./bin is good enough for commands created by the package, why not for other executable? I guess ./tools or ./misc or ./helpers could also work.

What are you thoughts about this @cxj ?

cxj commented 6 years ago

I don't have a strong feeling one way or the other about using ./bin for all CLI tools, regardless of source or purpose. But I can imagine that separating them might make sense in some cases.

For example, I have written a number of packages where the end result of a compile-like step produces a phar file that can then be installed on any system hosting a copy of PHP. The Composer pieces and the entire skeleton will never be seen by the end user. In such a case, maybe it makes sense to have my compile process output to a different directory than ./bin for clarity, if nothing else.

As I said, though, I don't really have a strong case for either choice. I was hoping to get Paul's response.

TomasVotruba commented 6 years ago

I personally put both categories there. It's the least surprise.

See Rector package: https://github.com/rectorphp/rector/tree/master/bin

These are used by programmer who uses this package as dependency:

The rest is for package contributors.

Also, for composer you can specify files that should be used by public: https://getcomposer.org/doc/articles/vendor-binaries.md#how-is-it-defined-, so there is no reason to create multiple directories for public and contributor use.