Skip to content

Commit

Permalink
Fix paths not working when using the phar archive
Browse files Browse the repository at this point in the history
  • Loading branch information
hernanrz committed Mar 2, 2016
1 parent 19e2acf commit 1d1337a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions emulator/emulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
require 'util.php';

define('VERBOSE', false);
define('EMU_PATH', dirname(__DIR__));

if(\Phar::running()) {
define('EMU_PATH', dirname(\Phar::running(false)) . DIRECTORY_SEPARATOR);
}else {
define('EMU_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
}

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

$configFileName = __DIR__ . DIRECTORY_SEPARATOR . $argv[1];
$configFileName = EMU_PATH . $argv[1];
$port = $argv[2];

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

0 comments on commit 1d1337a

Please sign in to comment.