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

vendor include at binary file #226

Closed
dehenne opened this issue May 27, 2015 · 6 comments
Closed

vendor include at binary file #226

dehenne opened this issue May 27, 2015 · 6 comments

Comments

@dehenne
Copy link

dehenne commented May 27, 2015

Hello,

Thanks for the awesome work.
But I have some troubles to run the phpdox file with:
https://github.com/theseer/phpdox/blob/master/phpdox#L46

$found = false;
foreach(array(__DIR__ . '/vendor', __DIR__ . '/../../../vendor') as $vendor) {
    if (file_exists($vendor)) {
        $found = true;
        require __DIR__ . '/src/vendor.php';
    }
}

should it not be so: ?

$found = false;
foreach(array(__DIR__ . '/vendor.php', __DIR__ . '/../../../vendor.php') as $vendor) {
    if (file_exists($vendor)) {
        $found = true;
        require __DIR__ . '/src/vendor.php';
    }
}

it works for me only so

DIR . '/vendor' does not work for me.

And I have a second question, why you use not $vendor as the require?

$found = false;
foreach(array(__DIR__ . '/vendor.php', __DIR__ . '/../../../vendor.php') as $vendor) {
    if (file_exists($vendor)) {
        $found = true;
        require $vendor;
    }
}

thank you in advance for your explanation :-)

@dehenne
Copy link
Author

dehenne commented May 27, 2015

Ok, the fix is not correct. I made a very very bad fix for me.

foreach(array( __DIR__ . '/src/vendor', __DIR__ . '/../../../vendor') as $vendor) {
    if (file_exists($vendor.'.php')) {
        $found = true;
        $vendor = dirname(dirname(dirname(__FILE__)));
        require __DIR__ . '/src/vendor.php';
    }
}

to illustrate:
I use phpdox with the bin/phpdox from the composer installation. The execution is with phing.
the phing xml is:

<target name="phpdox" unless="phpdox.done" depends="phploc-ci,phpcs-ci,phpmd,phpunit" description="Generate project documentation using phpDox">
    <delete dir="${builddir}/docs"/>
    <exec command="${toolsdir}/phpdox -f ${project.basedir}/phpdox.xml" passthru="true"/>
  </target>

At the moment it works for. :-)

@theseer
Copy link
Owner

theseer commented May 27, 2015

I have to admit, I neither get your change nor the underlying issue.

@renanbr
Copy link

renanbr commented May 27, 2015

I'm not sure if I get what you said @dehenne, have you changed the vendor directory config in composer.json or the COMPOSER_VENDOR_DIR anyway?

... so maybe the problem is: phpdox always finds for standard vendor directory. If I got well the big picture, ignoring vendor directory name - like this solution - could fix that.

@dehenne
Copy link
Author

dehenne commented May 28, 2015

Sorry, if I have not expressed myself clearly.
The Problem is, i get the message "You need to set up the project dependencies...".
https://github.com/theseer/phpdox/blob/master/phpdox#L53

But all dependencies are installed.

@renanbr had the right idea :-) I change the name of my vendor dir.

@theseer
I do not understand the following:

foreach(array(__DIR__ . '/vendor', __DIR__ . '/../../../vendor') as $vendor) {

Is vendor the "vendor" directory from composer or a directory from your src dir?
If vendor is the "vendor" directory from composer you should check the autoload.php file such as in PHPUnit.

thanks again for your help

@theseer
Copy link
Owner

theseer commented May 28, 2015

Okay, I start to see the problem. And it indeed only exists due to the renamed the vendor directory.

I'll see how I can address that best.
Thank you for pointing that out!

@dehenne
Copy link
Author

dehenne commented May 28, 2015

awesome. the fix works 👍
Thank you.

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

3 participants