-
Notifications
You must be signed in to change notification settings - Fork 32
Description
First of all: big thanks for this awesome tool!
Trying it out however, I have run into a small problem with using relative paths. Running the following line:
php /composer/vendor/phpcheckstyle/phpcheckstyle/run.php --src "./src"
I receive the error
Fatal error: Uncaught Error: Class 'PHPCheckstyle\PHPCheckstyle' not found in /composer/vendor/phpcheckstyle/phpcheckstyle/run.php:172
Stack trace:
#0 {main}
thrown in /composer/vendor/phpcheckstyle/phpcheckstyle/run.php on line 172
Trying to load the /composer/vendor/autoload.php solves this, but it will still complain about not finding the default config file, as it is defined relatively to the location the script is run from, not relatively to the script itself.
This dependency on the location where php is run from is found on other lines as well:
- to require the autoload file
- the default outdir
- the default config
Is there some way to update run.php to make the script run from anywhere? Or even make it possible to run it as a binary in /composer/vendor/bin (which might take advantage from these same changes)? Honestly, I'm not really sure if these would be the only changes needed to being able to run the above line, as --src "./src" is still using a relative path to the location the script has been called from...
Thanks for looking into this. I would be glad to help to provide further details if needed.