php-pds / skeleton

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

Generate/Validate skeletons in arbitrary path #29

Closed sepehr closed 7 years ago

sepehr commented 7 years ago

Currently, it's only possible to use the pds-skeleton when it's required locally. When it's required globally, it will only generate/validate packages in the ~/.composer path.

This pull-request enables the pds-skeleton to generate/validate package skeletons in any existing arbitrary path. If no path is provided, it will fallback to its default behavior. Here's a usage example:

pds-skeleton generate path/to/existing/dir
pds-skeleton validate path/to/existing/package

Along the way, it fixes a bug in validator's getFiles() where it was unable to correctly detect if an entry is a directory or not. I didn't open a separate pull-request for this as it has merge conflicts with this one.

pmjones commented 7 years ago

Nice! @afilina any comments?

afilina commented 7 years ago

The tests pass and everything works as expected. I'd merge it.

P.S. I hope that people won't install it globally, since I believe that the original goal of the package was to make sure authors install it per project, to signal adherence to the standard.

pmjones commented 7 years ago

I hope that people won't install it globally

Same here. Even so, I can see a case for validating packages that have not yet required it, and then informing the package owners that they're compliant.