0
Many PHP managers are available in PHAR files, which are installed globally via Composer or in operating system environment variables.
This is the case of Composer himself, and also of Phpunit.
In any directory I can run the command phpunit
that it will collect the directory in which I ran and the phpunit.xml file.
The question is just this, on a phar or PHP executable how did I get the directory in which it ran? Because most of the time the directory is not the same as phar. The solution should work on all systems.
I searched but I couldn’t find anything like it. You can help?
Isn’t that right? http://php.net/manual/en/phar.running.php
– Daniel Omine
I think the function
getcwd
does that.– Woss
@Andersoncarloswoss that’s right, post the answer so I can mark it right.
– Leonardo