function InstallCommand::validateRecipe

Same name in other branches
  1. 10 core/lib/Drupal/Core/Command/InstallCommand.php \Drupal\Core\Command\InstallCommand::validateRecipe()

Validates a user provided recipe.

Parameters

string $recipe: The path to the recipe to validate.

Return value

bool TRUE if the recipe exists, FALSE if not.

1 call to InstallCommand::validateRecipe()
InstallCommand::execute in core/lib/Drupal/Core/Command/InstallCommand.php

File

core/lib/Drupal/Core/Command/InstallCommand.php, line 333

Class

InstallCommand
Installs a Drupal site for local testing/development.

Namespace

Drupal\Core\Command

Code

protected function validateRecipe(string $recipe) : bool {
    // It is impossible to validate a recipe fully at this point because that
    // requires a container.
    if (!is_dir($recipe) || !is_file($recipe . '/recipe.yml')) {
        return FALSE;
    }
    return TRUE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.