Skip to content

Commit 165f2c1

Browse files
committed
fixed autoload path for padawan's cli scripts
1 parent 6bf7010 commit 165f2c1

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

bin/padawan

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

4-
require(dirname(__DIR__) . "/vendor/autoload.php");
4+
$autoloadPath = dirname(__DIR__) . "/autoload.php";
5+
if (!file_exists($autoloadPath)) {
6+
$autoloadPath =dirname(__DIR__) . "/vendor/autoload.php";
7+
}
8+
require($autoloadPath);
59

610
set_time_limit(0);
711
ini_set('memory_limit', '2048M');

bin/padawan-server

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ use React\Http\Response;
55
use React\Http\Request;
66
use Application\HTTP\App;
77

8-
define("ROOT", dirname(__DIR__));
8+
$autoloadPath = dirname(__DIR__) . "/autoload.php";
9+
$configPath = dirname(__DIR__) . "/mkusher/padawan/app/config/bin.php";
10+
if (!file_exists($autoloadPath)) {
11+
$autoloadPath = dirname(__DIR__) . "/vendor/autoload.php";
12+
$configPath = dirname(__DIR__) . "/app/config/bin.php";
13+
}
914

10-
require ROOT . "/app/config/bin.php";
11-
require ROOT . "/vendor/autoload.php";
15+
require($configPath);
16+
require($autoloadPath);
1217

1318
$noFsIO = false;
1419
$port = 15155;

0 commit comments

Comments
 (0)