Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
autoload.php
Go to the documentation of this file.
1 <?php
10 
14 define('BP', dirname(__DIR__));
15 
16 define('VENDOR_PATH', BP . '/app/etc/vendor_path.php');
17 
18 if (!file_exists(VENDOR_PATH)) {
19  throw new \Exception(
20  'We can\'t read some files that are required to run the Magento application. '
21  . 'This usually means file permissions are set incorrectly.'
22  );
23 }
24 
26 $vendorAutoload = BP . "/{$vendorDir}/autoload.php";
27 
28 /* 'composer install' validation */
29 if (file_exists($vendorAutoload)) {
30  $composerAutoloader = include $vendorAutoload;
31 } else {
32  throw new \Exception(
33  'Vendor autoload is not found. Please run \'composer install\' under application root directory.'
34  );
35 }
36 
37 AutoloaderRegistry::registerAutoloader(new ClassLoaderWrapper($composerAutoloader));
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60
if(!file_exists(VENDOR_PATH)) $vendorDir
Definition: autoload.php:25
$vendorAutoload
Definition: autoload.php:26
const VENDOR_PATH
Definition: autoload.php:16
const BP
Definition: autoload.php:14