Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. InstallCommand.php

function 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
Executes the current command.

File

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

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;
}
RSS feed
Powered by Drupal