Bolt\Exception\BootException::earlyExceptionMissingLoaderConfig PHP Method

earlyExceptionMissingLoaderConfig() public static method

Exception due to a missing .bolt.yml or .bolt.php file.
    public static function earlyExceptionMissingLoaderConfig()
    {
        $message = <<<EOM
This installation is missing either a .bolt.yml file (default), or a .bolt.php file.
<br><br>
If you have uploaded this install via a file manager or FTP, please check that 
"show hidden files" is turned on. After doing so, you will be able to see this 
file and you can upload it to the root of your Bolt installation.
EOM;
        echo sprintf(static::getEarlyExceptionHtml(), 'Bolt - Installation Incomplete', $message, static::getHintsComposer());
        throw new static(strip_tags($message));
    }

Usage Example

Beispiel #1
0
    // Use resources from config, or instantiate the class based on mapping above.
    if ($config['resources'] instanceof ResourceManager) {
        $resources = $config['resources'];
    } else {
        if ($config['resources'] !== null && is_a($config['resources'], ResourceManager::class)) {
            $resourcesClass = $config['resources'];
        }
        /** @var \Bolt\Configuration\ResourceManager $resources */
        $resources = new $resourcesClass($rootPath);
    }
    // Set any non-standard paths
    foreach ((array) $config['paths'] as $name => $path) {
        $resources->setPath($name, $path);
    }
    if (!file_exists($resources->getPath('web')) && $resources instanceof Composer) {
        BootException::earlyExceptionMissingLoaderConfig();
    }
    /** @var \Bolt\Configuration\ResourceManager $config */
    $resources->verify();
    // Create the 'Bolt application'
    $appClass = Application::class;
    if ($config['application'] !== null && is_a($config['application'], Silex\Application::class, true)) {
        $appClass = $config['application'];
    }
    $app = new $appClass(['resources' => $resources]);
    // Initialize the 'Bolt application': Set up all routes, providers, database, templating, etc..
    if (method_exists($app, 'initialize')) {
        $app->initialize();
    }
    return $app;
});