Skip to content

Commit 1d1337a

Browse files
committed
Fix paths not working when using the phar archive
1 parent 19e2acf commit 1d1337a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

emulator/emulator.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
require 'util.php';
99

1010
define('VERBOSE', false);
11-
define('EMU_PATH', dirname(__DIR__));
11+
12+
if(\Phar::running()) {
13+
define('EMU_PATH', dirname(\Phar::running(false)) . DIRECTORY_SEPARATOR);
14+
}else {
15+
define('EMU_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
16+
}
1217

1318
if('Linux' == PHP_OS) {
1419
echo "". "\033[34;34mE\033[0m" . "\033[33;33mm\033[0m" . "\033[1;31mu\033[0m";
@@ -27,7 +32,7 @@
2732
exit;
2833
}
2934

30-
$configFileName = __DIR__ . DIRECTORY_SEPARATOR . $argv[1];
35+
$configFileName = EMU_PATH . $argv[1];
3136
$port = $argv[2];
3237

3338
echo '* Reading configuration file ' . basename($configFileName) . '...' . PHP_EOL;

0 commit comments

Comments
 (0)