Make sure COMPOSER_AUTOLOADER_PATH is always declared

Sacrifice dynamic composer autoloader path to do this, because we don't
need it anyway - it was a misconceived feature from the days when I used
the same workspace for PM3 and PM4 both.
This commit is contained in:
Dylan K. Taylor 2021-10-02 15:27:11 +01:00
parent f5266ec816
commit 54174eefa0
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 4 additions and 10 deletions

View File

@ -35,3 +35,4 @@ define('pocketmine\_CORE_CONSTANTS_INCLUDED', true);
define('pocketmine\PATH', dirname(__DIR__) . '/');
define('pocketmine\RESOURCE_PATH', dirname(__DIR__) . '/resources/');
define('pocketmine\COMPOSER_AUTOLOADER_PATH', dirname(__DIR__) . '/vendor/autoload.php');

View File

@ -214,20 +214,13 @@ JIT_WARNING
error_reporting(-1);
set_ini_entries();
$opts = getopt("", ["bootstrap:"]);
if(isset($opts["bootstrap"])){
$bootstrap = ($real = realpath($opts["bootstrap"])) !== false ? $real : $opts["bootstrap"];
}else{
$bootstrap = dirname(__FILE__, 2) . '/vendor/autoload.php';
}
if($bootstrap === false or !is_file($bootstrap)){
$bootstrap = dirname(__FILE__, 2) . '/vendor/autoload.php';
if(!is_file($bootstrap)){
critical_error("Composer autoloader not found at " . $bootstrap);
critical_error("Please install/update Composer dependencies or use provided builds.");
exit(1);
}
define('pocketmine\COMPOSER_AUTOLOADER_PATH', $bootstrap);
require_once(\pocketmine\COMPOSER_AUTOLOADER_PATH);
require_once($bootstrap);
$composerGitHash = InstalledVersions::getReference('pocketmine/pocketmine-mp');
if($composerGitHash !== null){