BrianHenryIE / strauss

Prefix PHP namespaces and classnames to allow multiple versions of libraries to exist without conflict.
https://brianhenryie.github.io/strauss/
MIT License
142 stars 23 forks source link

Improve bin #97

Closed szepeviktor closed 7 months ago

szepeviktor commented 7 months ago

I hope there is no need to load 2 autoloaders. The original bin had 2 if-s.

This PR introduces a straight-forward and explicit bin.

szepeviktor commented 7 months ago

Are tests failing because we actually need 2 autoloaders??

szepeviktor commented 7 months ago

Are tests failing because we actually need 2 autoloaders??

Could it be that tests are failing a year ago?

BrianHenryIE commented 7 months ago

@szepeviktor Thanks, that's much nicer.

Yeah, Windows tests have never passed.

I added some code to run the tests first with the classes, and then as the packaged phar.

https://github.com/BrianHenryIE/strauss/blob/53cb03e7cd773fa0d5093c2e511700e1883be1ea/.github/workflows/main.yml#L41-L46

https://github.com/BrianHenryIE/strauss/blob/53cb03e7cd773fa0d5093c2e511700e1883be1ea/tests/Integration/Util/IntegrationTestCase.php#L55-L58

szepeviktor commented 7 months ago

Very glad to contribute.

BrianHenryIE commented 7 months ago

Here's why the code was whack before... it was to do with running it from arbitrary directories. E.g. I'm in ~/Sites/my-plugin and run it from ~/Sites/strauss/bin/strauss. I had to reorder the paths. And left some comments.

https://github.com/BrianHenryIE/strauss/commit/adff2eae37186d43bc081a0aacc011c5194791e0

szepeviktor commented 7 months ago

All right. The phar distribution is safer.