Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run phpdox with a cloned repository on Windows #299

Closed
onet4 opened this issue Dec 22, 2016 · 4 comments
Closed

Run phpdox with a cloned repository on Windows #299

onet4 opened this issue Dec 22, 2016 · 4 comments

Comments

@onet4
Copy link

onet4 commented Dec 22, 2016

Hi,

I could successfully generate documents using the phar file. However, it doesn't seem to run with a cloned repository.

  1. Cloned the repository to local.
  2. Performed composer install and it downloaded dependencies in the vendor directory.
  3. Performed php phpdox --version but it just does not respond. Ctrl + c does not terminate it so I have to close the console window.

Am I missing something?

@onet4 onet4 changed the title Run phpdox with a cloned repository Run phpdox with a cloned repository on WIndows Dec 27, 2016
@onet4
Copy link
Author

onet4 commented Dec 27, 2016

It seems the line

$git = exec('command -p git describe --always --dirty 2>'.$devNull, $foo, $rc);

has to be

$git = exec('git describe --always --dirty 2>'.$devNull, $foo, $rc);

The phar version runs just fine though.

@theseer
Copy link
Owner

theseer commented Dec 27, 2016

Thank you for the additional research and effort.

Good catch. I completely forgot about the usage of command for running git. This is of course a unix-ism and command doesn't exist on windows (sigh), so the problem makes sense.

I'm amazed that "git" without .exe works..?

The phar version is unaffected because it's not a git based checkout and thus no git call is performed.
I'll look into changing it. I have to rework the vesion detection anyhow as it is broken for nested git repositories.

@onet4
Copy link
Author

onet4 commented Dec 28, 2016

This is of course a unix-ism and command doesn't exist on windows (sigh), so the problem makes sense.

According to this web site,

The command command starts a new instance of the command.com command interpreter. The command command is available in MS-DOS as well as in all 32-bit versions of Windows. The command command is not available in 64-bit versions of Windows.

And my machine Windows 7 x86 supports the command command and when command is typed in a console window, it waits for user inputs. Probably that's why the script hangs on Windows machines that support the command command.

I'm amazed that "git" without .exe works..?

It seems to be working here even though the program path is not registered for the environment variable.

You may want to pay attention to that exec() doesn't halt the script if the command does not exist. It just stores an empty value to the variables and the execution flow continues. This can be confirmed by simply running test code like exec('abcde --version 2> null', $foo, $rc); This still makes me wonder though why the script still can find the version number although the command does not exist. Yet you said the phar version has a different handling for getting the version number so I guess it has something to do with it.

@onet4 onet4 changed the title Run phpdox with a cloned repository on WIndows Run phpdox with a cloned repository on Windows Dec 28, 2016
@theseer theseer closed this as completed in 3bd4017 Jan 9, 2018
@theseer
Copy link
Owner

theseer commented Jan 9, 2018

I don't have a windows environment to verify it actually is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants