Get current directory in either PHAR runs

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 itself, as well as 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, in a phar or executable PHP how do I get the directory in which it was run? For most of the time the directory is not the same as the phar. The solution should work across all systems.

I researched but did not find anything like it. Can you help?

    
asked by anonymous 04.06.2017 / 05:36

0 answers