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

The composerRoot property does not contain the correct value. #3

Closed
jmolivas opened this issue Nov 12, 2016 · 2 comments
Closed

The composerRoot property does not contain the correct value. #3

jmolivas opened this issue Nov 12, 2016 · 2 comments

Comments

@jmolivas
Copy link

jmolivas commented Nov 12, 2016

The return TRUE; at DrupalFinder on line 88 stops the execution and makes $drupalRoot and $composerRoot contains the same value and $composerRoot never obtain the real path where the composer.json file is located.
https://github.com/webflo/drupal-finder/blob/master/src/DrupalFinder.php#L88

You can replicate by creating an example.php file containing:

use DrupalFinder\DrupalFinder;

require_once 'vendor/autoload.php';

$drupalFinder = new DrupalFinder();
$drupalFinder->locateRoot('/path/to/drupal/sites/drupal.dev/web');
$drupalRoot = $drupalFinder->getDrupalRoot();
$projectRoot = $drupalFinder->getComposerRoot();
echo 'projectRoot: ' . $projectRoot . PHP_EOL;
echo 'drupalRoot: ' . $drupalRoot . PHP_EOL;

and execute by php example.php and the output will be equal in both:

projectRoot: /path/to/drupal/sites/drupal.dev/web
drupalRoot: /path/to/drupal/sites/drupal.dev/web

Removing the offending line at 88 makes this works as expected.

@webflo
Copy link
Owner

webflo commented Nov 12, 2016

I forgot that the Drupal-Composer directory has a autoload.php as well. Fixed it in 4dcd328. Tagged 0.1.1

@webflo webflo closed this as completed Nov 12, 2016
@jmolivas
Copy link
Author

Thanks for taking care.

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