Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 29a5806

Browse files
committed
Fixed autoloader
1 parent 31c6671 commit 29a5806

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

hyper-run

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ if (!is_dir($dir)) {
2222
exit(1);
2323
}
2424

25-
require __DIR__ . '/autoload.php';
25+
if (is_file(__DIR__ . '/../vendor/autoload.php')) {
26+
require __DIR__ . '/../vendor/autoload.php';
27+
} elseif (is_file(__DIR__ . '/../../../autoload.php')) {
28+
require __DIR__ . '/../../../autoload.php';
29+
} else {
30+
fwrite(STDERR,
31+
"You need to set up the project dependencies using the following commands:\n" .
32+
"curl -s http://getcomposer.org/installer | php\n" .
33+
"php composer.phar install\n"
34+
);
35+
}
36+
2637
$ps = new mpyw\HyperBuiltinServer\MasterProcess($dir);
2738
$ps->listen();

0 commit comments

Comments
 (0)