Skip to content

Commit de477d4

Browse files
committed
Fix up autoloading.
1 parent da9959c commit de477d4

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

bin/sniff.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
#!/usr/bin/php -q
22
<?php
33

4-
/**
5-
* Bin stub.
6-
*/
74
$options = [
8-
__DIR__ . '/../../../autoload.php',
9-
__DIR__ . '/../../autoload.php',
105
__DIR__ . '/../vendor/autoload.php',
116
__DIR__ . '/vendor/autoload.php'
127
];
8+
if (!empty($_SERVER['PWD'])) {
9+
array_unshift($options, $_SERVER['PWD'] . '/vendor/autoload.php');
10+
}
11+
1312
foreach ($options as $file) {
1413
if (file_exists($file)) {
1514
define('SNIFFER_COMPOSER_INSTALL', $file);

bin/tokenize.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
#!/usr/bin/php -q
22
<?php
33

4-
/**
5-
* Bin stub.
6-
*/
74
$options = [
8-
__DIR__ . '/../../../autoload.php',
9-
__DIR__ . '/../../autoload.php',
105
__DIR__ . '/../vendor/autoload.php',
116
__DIR__ . '/vendor/autoload.php'
127
];
8+
if (!empty($_SERVER['PWD'])) {
9+
array_unshift($options, $_SERVER['PWD'] . '/vendor/autoload.php');
10+
}
11+
1312
foreach ($options as $file) {
1413
if (file_exists($file)) {
1514
define('SNIFFER_COMPOSER_INSTALL', $file);

0 commit comments

Comments
 (0)