Bolt\Exception\BootException::earlyExceptionComposer PHP Method

earlyExceptionComposer() public static method

Exception due to a missing vendor/autoload.php file.
public static earlyExceptionComposer ( )
    public static function earlyExceptionComposer()
    {
        $message = <<<EOM
Configuration auto-detection failed because the file <code>vendor/autoload.php</code> doesn't exist.
<br><br>
Make sure you've installed the required components with Composer.
EOM;
        echo sprintf(static::getEarlyExceptionHtml(), 'Bolt - Installation Incomplete', $message, static::getHintsComposer());
        throw new static(strip_tags($message));
    }

Usage Example

Beispiel #1
0
 // and autodetect an appropriate configuration class based on this
 // information. (autoload.php path maps to a configuration class)
 $autodetectionMappings = [$boltRootPath . '/vendor/autoload.php' => [Standard::class, $boltRootPath], $boltRootPath . '/../../autoload.php' => [Composer::class, $boltRootPath . '/../../..']];
 $error = true;
 foreach ($autodetectionMappings as $autoloadPath => list($resourcesClass, $rootPath)) {
     if (!file_exists($autoloadPath)) {
         continue;
     }
     require_once $autoloadPath;
     $error = false;
     break;
 }
 // None of the mappings matched, error
 if ($error) {
     include $boltRootPath . '/src/Exception/BootException.php';
     BootException::earlyExceptionComposer();
 }
 // Register handlers early
 ShutdownHandler::register();
 /*
  * Load initialization config needed to bootstrap application.
  *
  * In order for paths to be customized and still have the standard
  * index.php (web) and nut (CLI) work, there needs to be a standard
  * place these are defined. This is ".bolt.yml" or ".bolt.php" in the
  * project root (determined above).
  *
  * Yes, YAML and PHP are supported here (not both). YAML works for
  * simple values and PHP supports any programmatic logic if required.
  */
 $config = ['application' => null, 'resources' => null, 'paths' => []];