You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having trouble executing the Phar against my project.
The configuration file is located in a sub directory called app (Symfony).
The configuration file is named phpdoc.xml.dist.
The Phar is in a separate location in $PATH (or %PATH% in my case for Windows).
I renamed the Phar to phpdoc.phar.
Using PHPUnit frequently, I have grown accustomed to running it like this: phpunit -c app. Unfortunately that generates the following error for phpdoc -c app:
[Zend\Config\Exception\RuntimeException]
Filename "D:\Projects\CEMSv4\Application\app" is missing an extension and cannot be auto-detected
I then tried using the configuration file name: phpdoc -c app\phpdoc.xml.dist. That also did not work:
Thinking that the .dist extension is automatically appended, I tried: phpdoc -c app\phpdoc.xml. That, surprisingly to me, did not work either.
PHP Warning: chdir(): Invalid argument (errno 22) in phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/src/phpDocumentor/Command/ConfigurableCommand.php on line 70
PHP Stack trace:
PHP 1. {main}() C:\Users\kherrera\Programs\php-phars\phpdoc.phar:0
PHP 2. include() C:\Users\kherrera\Programs\php-phars\phpdoc.phar:9
PHP 3. require_once() phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/_cli_stub.php:11
PHP 4. phpDocumentor\Application->run() phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/bin/phpdoc.php:28
PHP 5. Symfony\Component\Console\Application->run() phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/src/phpDocumentor/Application.php:74
PHP 6. Symfony\Component\Console\Application->doRun() phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:105
PHP 7. Symfony\Component\Console\Command\Command->run() phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:192
PHP 8. phpDocumentor\Command\Project\RunCommand->execute() phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:238
PHP 9. phpDocumentor\Command\ConfigurableCommand->execute() phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/src/phpDocumentor/Command/Project/RunCommand.php:222
PHP 10. chdir() phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/src/phpDocumentor/Command/ConfigurableCommand.php:70
Warning: chdir(): Invalid argument (errno 22) in phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/src/phpDocumentor/Command/ConfigurableCommand.php on line 70
Call Stack:
0.0648 1058480 1. {main}() C:\Users\kherrera\Programs\php-phars\phpdoc.phar:0
0.0652 1051904 2. include('phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/_cli_stub.php') C:\Users\kherrera\Programs\php-phars\phpdoc.phar:9
0.0655 1058264 3. require_once('phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/bin/phpdoc.php') phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/_cli_stub.php:11
0.0988 2904368 4. phpDocumentor\Application->run() phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/bin/phpdoc.php:28
0.1001 3004808 5. Symfony\Component\Console\Application->run() phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/src/phpDocumentor/Application.php:74
0.1033 3152224 6. Symfony\Component\Console\Application->doRun() phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:105
0.1035 3152888 7. Symfony\Component\Console\Command\Command->run() phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:192
0.1039 3155528 8. phpDocumentor\Command\Project\RunCommand->execute() phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:238
0.1039 3155800 9. phpDocumentor\Command\ConfigurableCommand->execute() phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/src/phpDocumentor/Command/Project/RunCommand.php:222
0.1040 3156040 10. chdir() phar://C:/Users/kherrera/Programs/php-phars/phpdoc.phar/src/phpDocumentor/Command/ConfigurableCommand.php:70
Initializing parser and collecting files .. OK
Parsing files
[Exception]
No parsable files were found, did you specify any using the -f or -d parameter?
It seems that ConfigurableCommand.php#70 does not check for the distribution file, and Zend Config will not let me specify the distribution file for use. Renaming phpdoc.xml.dist to phpdoc.xml allows me to run the application.
The text was updated successfully, but these errors were encountered:
You need to use phpdoc.dist.xml as opposed to phpdoc.xml.dist.
(Strictly speaking, this is how PHPUnit should be doing it, except it doesn't...)
As for specifying the literal file name... that's a know bug with the PHAR file... for some reason, the path to the configuration file is relative to the PHAR file itself, rather than the CWD. Currently, the only workaround is to simply use the %cd% environment variable, e.g.
I am having trouble executing the Phar against my project.
app
(Symfony).phpdoc.xml.dist
.$PATH
(or%PATH%
in my case for Windows).phpdoc.phar
.Using PHPUnit frequently, I have grown accustomed to running it like this:
phpunit -c app
. Unfortunately that generates the following error forphpdoc -c app
:I then tried using the configuration file name:
phpdoc -c app\phpdoc.xml.dist
. That also did not work:Thinking that the
.dist
extension is automatically appended, I tried:phpdoc -c app\phpdoc.xml
. That, surprisingly to me, did not work either.It seems that ConfigurableCommand.php#70 does not check for the distribution file, and Zend Config will not let me specify the distribution file for use. Renaming
phpdoc.xml.dist
tophpdoc.xml
allows me to run the application.The text was updated successfully, but these errors were encountered: