Skip to content

Commit

Permalink
fix issue/feature #202
Browse files Browse the repository at this point in the history
  • Loading branch information
llaville committed Feb 6, 2024
1 parent 96fcbe3 commit e311e16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .changes/unreleased/Fixed-20240206-091917.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kind: Fixed
body: '[#202](https://github.com/overtrue/phplint/issues/202) : composer config vendor-dir
is ignored'
time: 2024-02-06T09:19:17.199971457Z
9 changes: 4 additions & 5 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,19 @@
* @author Laurent Laville
*/

$autoloader = 'vendor/autoload.php';

if (Phar::running()) {
$phar = new Phar($_SERVER['argv'][0]);
if (isset($_composer_autoload_path)) {
$possibleAutoloadPaths = [
'phar://' . $phar->getAlias(),
dirname($_composer_autoload_path)
];
$autoloader = basename($_composer_autoload_path);
} else {
$possibleAutoloadPaths = [
// local dev repository
dirname(__DIR__),
// dependency
dirname(__DIR__, 4),
];
$autoloader = 'vendor/autoload.php';
}

$isAutoloadFound = false;
Expand Down

0 comments on commit e311e16

Please sign in to comment.