Skip to content

Commit f71a5ad

Browse files
committed
Add custom autoloader path
1 parent 6b4163d commit f71a5ad

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/environment.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
putenv("PRE_ISOLATE_DEPENDENCIES=1");
55
}
66

7+
if (empty(getenv("PRE_ISOLATE_DEPENDENCIES_AUTOLOADER"))) {
8+
putenv("PRE_ISOLATE_DEPENDENCIES_AUTOLOADER=" . __DIR__ . "/../vendor/autoload.php");
9+
}
10+
711
if (empty(getenv("PRE_BASE_DIR"))) {
812
putenv("PRE_BASE_DIR=" . realpath(__DIR__ . "/../../../../"));
913
}

src/functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ function compile($from, $to, $format = true, $comment = true)
158158
function expand($code, $includeStaticPaths = true, $includeStaticCompilers = true)
159159
{
160160
$base = getenv("PRE_BASE_DIR");
161-
$vendor = realpath("{$base}/vendor/autoload.php");
161+
$vendor = getenv("PRE_ISOLATE_DEPENDENCIES_AUTOLOADER");
162162

163163
static $staticCompilers = [];
164164

@@ -279,7 +279,7 @@ function formatCode($code)
279279
function formatFile($path)
280280
{
281281
$base = getenv("PRE_BASE_DIR");
282-
$vendor = realpath("{$base}/vendor/autoload.php");
282+
$vendor = getenv("PRE_ISOLATE_DEPENDENCIES_AUTOLOADER");
283283

284284
if ((int) getenv("PRE_ISOLATE_DEPENDENCIES") === 1) {
285285
$defer = '

0 commit comments

Comments
 (0)