Improve error handling for wrong autoloader permissions
authorGergő Tisza <tgr.huwiki@gmail.com>
Sat, 2 Feb 2019 19:56:31 +0000 (11:56 -0800)
committerGergő Tisza <tgr.huwiki@gmail.com>
Tue, 5 Feb 2019 23:27:37 +0000 (15:27 -0800)
Running Composer manually with a user different from the webserver
user and ending up with a vendor/autoload.php file that's unreadable
to MediaWiki seems like an easy mistake to make. Make the error
message when that happens less cryptic.

Change-Id: I52600adceb38a7fc5384d00b5298e46a782c684f

includes/Setup.php

index 4ebe426..cdbd527 100644 (file)
@@ -67,6 +67,8 @@ require_once "$IP/includes/GlobalFunctions.php";
 // Load composer's autoloader if present
 if ( is_readable( "$IP/vendor/autoload.php" ) ) {
        require_once "$IP/vendor/autoload.php";
+} elseif ( file_exists( "$IP/vendor/autoload.php" ) ) {
+       die( "$IP/vendor/autoload.php exists but is not readable" );
 }
 
 // Assert that composer dependencies were successfully loaded