Skip to content

Commit 2cb9f50

Browse files
committed
fixing script to work inside of require-ed composer structure
1 parent 851b762 commit 2cb9f50

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

bin/obfuscate

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
#!/usr/bin/env php
22
<?php
33

4-
include __DIR__ . '/../vendor/autoload.php';
4+
// Either local or composer installed autoload file
5+
$own = __DIR__ . '/../vendor/autoload.php';
6+
$installed = __DIR__ . '/../../../autoload.php';
7+
8+
if (file_exists($own)) {
9+
include $own;
10+
} elseif (file_exists($installed)) {
11+
include $installed;
12+
} else {
13+
throw new RuntimeException('Dependencies/Composer not installed');
14+
}
515

616
ini_set('xdebug.max_nesting_level', 2000);
717

0 commit comments

Comments
 (0)