Permalink
Browse files

Do not assume that `vendor-dir` is a directory called `vendor` for 3r…

…d-party installs.
  • Loading branch information...
1 parent d758a18 commit 3c4559d3f4c008c1b9c89d39feeeb00921b6b534 @whatthejeff whatthejeff committed Mar 7, 2013
Showing with 12 additions and 14 deletions.
  1. +6 −7 PHPUnit/Autoload.php
  2. +6 −7 PHPUnit/Autoload.php.in
View
@@ -47,16 +47,15 @@
}
$paths = array(
- '/..',
- '/../../../..'
+ __DIR__ . '/../vendor',
+ __DIR__ . '/../../..'
);
foreach ($paths as $path) {
- $vendor = __DIR__ . $path . '/vendor';
- if (is_dir($vendor . '/composer') &&
- is_file($vendor . '/autoload.php')) {
- require_once $vendor . '/autoload.php';
- define('PHPUNIT_COMPOSER_INSTALL', $vendor . '/autoload.php');
+ if (is_dir($path . '/composer') &&
+ is_file($path . '/autoload.php')) {
+ require_once $path . '/autoload.php';
+ define('PHPUNIT_COMPOSER_INSTALL', $path . '/autoload.php');
return;
}
View
@@ -47,16 +47,15 @@ if (defined('PHPUNIT_COMPOSER_INSTALL')) {
}
$paths = array(
- '/..',
- '/../../../..'
+ __DIR__ . '/../vendor',
+ __DIR__ . '/../../..'
);
foreach ($paths as $path) {
- $vendor = __DIR__ . $path . '/vendor';
- if (is_dir($vendor . '/composer') &&
- is_file($vendor . '/autoload.php')) {
- require_once $vendor . '/autoload.php';
- define('PHPUNIT_COMPOSER_INSTALL', $vendor . '/autoload.php');
+ if (is_dir($path . '/composer') &&
+ is_file($path . '/autoload.php')) {
+ require_once $path . '/autoload.php';
+ define('PHPUNIT_COMPOSER_INSTALL', $path . '/autoload.php');
return;
}

1 comment on commit 3c4559d

Contributor

whatthejeff commented on 3c4559d Mar 7, 2013

@sebastianbergmann, I think this is the final tweak :). I don't think it's necessary to rush out a release for this corner case, though.

Please sign in to comment.